{
  "info": {
    "name": "Payora API v1",
    "description": "Payora — self-hosted, non-custodial crypto payment gateway. HMAC-SHA256 signed requests (collection-level pre-request script signs every call automatically). Set apiBase / apiKey / apiSecret in the collection variables. See https://api.payora.money/openapi.json",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "apiBase", "value": "https://api.payora.money" },
    { "key": "apiKey", "value": "pk_..." },
    { "key": "apiSecret", "value": "sk_..." }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Sign every request: HMAC-SHA256 over `${ts}.${rawBody}` with apiSecret (matches the server).",
          "var ts = Math.floor(Date.now() / 1000).toString();",
          "var raw = '';",
          "if (pm.request.body && pm.request.body.mode === 'raw') { raw = pm.request.body.raw || ''; }",
          "var sig = CryptoJS.HmacSHA256(ts + '.' + raw, pm.variables.get('apiSecret')).toString(CryptoJS.enc.Hex);",
          "pm.request.headers.upsert({ key: 'X-Payora-Key', value: pm.variables.get('apiKey') });",
          "pm.request.headers.upsert({ key: 'X-Payora-Timestamp', value: ts });",
          "pm.request.headers.upsert({ key: 'X-Payora-Signature', value: sig });",
          "pm.request.headers.upsert({ key: 'Accept', value: 'application/json' });"
        ]
      }
    }
  ],
  "item": [
    {
      "name": "Health",
      "request": { "method": "GET", "url": "{{apiBase}}/v1/health" }
    },
    {
      "name": "Create invoice",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Idempotency-Key", "value": "ORDER-42" }
        ],
        "body": { "mode": "raw", "raw": "{\"order_id\":\"ORDER-42\",\"mode\":\"fiat\",\"amount\":\"9.99\",\"fiat_currency\":\"USD\"}" },
        "url": "{{apiBase}}/v1/invoice"
      }
    },
    {
      "name": "Get invoice",
      "request": { "method": "GET", "url": "{{apiBase}}/v1/invoice/123" }
    },
    {
      "name": "List invoices",
      "request": { "method": "GET", "url": "{{apiBase}}/v1/invoices?limit=25&status=paid" }
    },
    {
      "name": "Cancel invoice",
      "request": { "method": "POST", "url": "{{apiBase}}/v1/invoice/123/cancel" }
    },
    {
      "name": "Balance",
      "request": { "method": "GET", "url": "{{apiBase}}/v1/balance" }
    },
    {
      "name": "Create payout batch",
      "request": {
        "method": "POST",
        "header": [
          { "key": "Content-Type", "value": "application/json" },
          { "key": "Idempotency-Key", "value": "PAYOUT-1" }
        ],
        "body": { "mode": "raw", "raw": "{\"currency\":\"USDT_TRON\",\"items\":[{\"address\":\"T...\",\"amount\":\"10.00\"}]}" },
        "url": "{{apiBase}}/v1/payout"
      }
    },
    {
      "name": "Get payout",
      "request": { "method": "GET", "url": "{{apiBase}}/v1/payout/1" }
    },
    {
      "name": "List payouts",
      "request": { "method": "GET", "url": "{{apiBase}}/v1/payout" }
    },
    {
      "name": "Cancel payout",
      "request": { "method": "POST", "url": "{{apiBase}}/v1/payout/1/cancel" }
    }
  ]
}
