{
  "protocol": "ibrese-pos-v1",
  "name": "IBRESE merchant POS / shop connect",
  "docs": "https://ibrese.com/docs/pos/",
  "overview": "https://ibrese.com/pos.html",
  "hostedByIbrese": false,
  "note": "ibrese.com does not host merchant-pos. Each shop runs its own service. This file is discovery metadata only.",
  "network": {
    "networkId": "ibrese",
    "chainId": "ibrese-l1",
    "asset": "NATIVE",
    "symbol": "IBR",
    "decimals": 5,
    "subunit": "1 IBR = 100000 subunits",
    "displayHint": "Till UI uses 2 decimal places: cents × 1000 = subunits. Example: 12.50 IBR → amount \"1250000\"."
  },
  "rpc": {
    "publicNode": "https://rpc.ibrese.com",
    "observePayment": "https://rpc.ibrese.com/payments/{paymentId}",
    "method": "GET",
    "authoritative": false,
    "note": "Observation only. Confirm FINALIZED + amount policy on a node you trust."
  },
  "paymentUri": {
    "scheme": "cryptoproject",
    "path": "pay",
    "example": "cryptoproject://pay?amount=1250000&asset=NATIVE&chainId=ibrese-l1&networkId=ibrese&paymentId=<64hex>&protocolVersion=1&recipient=<64hex>"
  },
  "merchantPos": {
    "listenDefault": "http://127.0.0.1:8101",
    "tillUi": "GET /",
    "info": "GET /v1/info",
    "registerDevice": "POST /v1/pos/devices",
    "createInvoice": "POST /v1/pos/invoices",
    "getInvoice": "GET /v1/pos/invoices/:paymentId",
    "listInvoices": "GET /v1/pos/invoices",
    "testWebhook": "POST /v1/pos/webhooks/test",
    "poll": "POST /v1/pos/poll",
    "auth": "Authorization: Bearer <apiKey>",
    "consensusAuthority": false,
    "finalityAuthority": false
  },
  "webhook": {
    "method": "POST",
    "contentType": "application/json; charset=utf-8",
    "headers": {
      "X-IBRESE-Webhook-Signature": "t=<unix-ms>,v1=<hmac-sha256-hex>",
      "X-IBRESE-Webhook-Event": "pos.ping | payment.updated | payment.finalized | payment.expired",
      "X-IBRESE-Webhook-Id": "<event-id>"
    },
    "signedPayload": "HMAC-SHA256(webhookSecret, \"<t>.<raw-body>\")",
    "maxSkewMs": 300000,
    "retry": {
      "maxAttempts": 5,
      "backoffMs": "50 * 2^(attempt-1)",
      "noRetry": "HTTP 4xx except 429"
    },
    "authoritative": false
  },
  "settlement": {
    "paidOnlyIf": "FINALIZED and amount MATCH or OVERPAYMENT",
    "underpayment": "not paid",
    "overpayment": "paid; excess is visible",
    "multipleFinalized": "paid; policy MULTIPLE",
    "markSalePaidOn": "payment.finalized with invoicePaid true, then re-check GET /payments/:id"
  }
}
