{
  "info": {
    "name": "Xynex API · v1",
    "description": "Reference collection for the Xynex public REST API. Replace {{api_key}} with your real key.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    { "key": "base_url", "value": "https://api.xynex.app/v1" },
    { "key": "api_key", "value": "cp_test_REPLACE_ME" }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{api_key}}", "type": "string" }]
  },
  "item": [
    {
      "name": "Invoices",
      "item": [
        {
          "name": "Create invoice",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "{{$guid}}" }
            ],
            "url": { "raw": "{{base_url}}/invoices", "host": ["{{base_url}}"], "path": ["invoices"] },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reference\": \"order-1042\",\n  \"amount\": 49.00,\n  \"currency\": \"usd\",\n  \"customer\": { \"email\": \"buyer@example.com\" }\n}"
            }
          }
        },
        {
          "name": "Get invoice",
          "request": {
            "method": "GET",
            "url": { "raw": "{{base_url}}/invoices/:id", "host": ["{{base_url}}"], "path": ["invoices", ":id"] }
          }
        }
      ]
    },
    {
      "name": "Payments",
      "item": [
        { "name": "List payments", "request": { "method": "GET", "url": { "raw": "{{base_url}}/payments", "host": ["{{base_url}}"], "path": ["payments"] } } },
        { "name": "Get payment", "request": { "method": "GET", "url": { "raw": "{{base_url}}/payments/:id", "host": ["{{base_url}}"], "path": ["payments", ":id"] } } }
      ]
    },
    {
      "name": "Payouts",
      "item": [
        {
          "name": "Create payout",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "Idempotency-Key", "value": "{{$guid}}" }
            ],
            "url": { "raw": "{{base_url}}/payouts", "host": ["{{base_url}}"], "path": ["payouts"] },
            "body": {
              "mode": "raw",
              "raw": "{\n  \"beneficiary_id\": \"ben_…\",\n  \"amount\": 100.00,\n  \"coin\": \"usdttrc20\"\n}"
            }
          }
        },
        { "name": "Get payout", "request": { "method": "GET", "url": { "raw": "{{base_url}}/payouts/:id", "host": ["{{base_url}}"], "path": ["payouts", ":id"] } } }
      ]
    },
    {
      "name": "Balances",
      "item": [
        { "name": "List balances", "request": { "method": "GET", "url": { "raw": "{{base_url}}/balances", "host": ["{{base_url}}"], "path": ["balances"] } } }
      ]
    },
    {
      "name": "Reference",
      "item": [
        { "name": "List coins", "request": { "method": "GET", "url": { "raw": "{{base_url}}/coins", "host": ["{{base_url}}"], "path": ["coins"] } } },
        {
          "name": "Preview fees",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "url": { "raw": "{{base_url}}/fees/preview", "host": ["{{base_url}}"], "path": ["fees", "preview"] },
            "body": { "mode": "raw", "raw": "{\n  \"kind\": \"payout\",\n  \"amount\": 100,\n  \"coin\": \"usdttrc20\"\n}" }
          }
        }
      ]
    }
  ]
}
