{
  "info": {
    "_postman_id": "7b1a7a79-4f0d-49b4-94a9-aerismerchant01",
    "name": "Aeris Merchant API",
    "description": "Public Aeris merchant contract. Hosted documentation: https://aeris-psp.net/docs\n\nAuthentication: every merchant request is signed with HMAC-SHA256. The collection pre-request script signs the compact JSON body (or {} for GET), using the same timestamp window as the API. Never put production secrets into a committed file: set api_key and secret_key in the collection variables locally.\n\nPay-ins support hosted card entry, card H2H with 3DS, and both Aeris checkout and direct H2H links for SBP and SberPay. Amounts are integer RUB values (1000 means 1000 RUB).",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "const apiKey = pm.variables.get('api_key') || '';",
          "const secret = pm.variables.get('secret_key') || '';",
          "const timestamp = Math.floor(Date.now() / 1000).toString();",
          "let data = {};",
          "if (pm.request.method !== 'GET' && pm.request.body && pm.request.body.mode === 'raw' && pm.request.body.raw) {",
          "  try { data = JSON.parse(pm.variables.replaceIn(pm.request.body.raw)); } catch (error) { throw new Error('Request body must be valid JSON before signing'); }",
          "}",
          "const pythonCompactJson = (value) => JSON.stringify(value).replace(/[\\u007f-\\uffff]/g, (character) => `\\\\u${character.charCodeAt(0).toString(16).padStart(4, '0')}`);",
          "const compactBody = pythonCompactJson(data);",
          "const message = `${compactBody}:${timestamp}++`;",
          "const hmacKey = CryptoJS.enc.Utf8.parse(CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(secret)));",
          "const signature = CryptoJS.HmacSHA256(message, hmacKey).toString(CryptoJS.enc.Hex);",
          "pm.request.headers.upsert({ key: 'X-API-KEY', value: apiKey });",
          "pm.request.headers.upsert({ key: 'X-TIMESTAMP', value: timestamp });",
          "pm.request.headers.upsert({ key: 'X-SIGNATURE', value: signature });"
        ]
      }
    }
  ],
  "variable": [
    { "key": "base_url", "value": "https://aeris-psp.net", "type": "string" },
    { "key": "api_key", "value": "", "type": "string" },
    { "key": "secret_key", "value": "", "type": "string" },
    { "key": "transaction_id", "value": "", "type": "string" },
    { "key": "three_ds_complete_fields", "value": "{}", "type": "string" },
    { "key": "payout_id", "value": "", "type": "string" },
    {
      "key": "merchant_webhook_url",
      "value": "http://localhost:8081/webhooks/aeris",
      "type": "string"
    },
    { "key": "merchant_order_id", "value": "order-10001", "type": "string" },
    { "key": "payout_order_id", "value": "payout-10001", "type": "string" }
  ],
  "item": [
    {
      "name": "Pay-ins",
      "description": "Create a payment through cards, SBP, or SberPay. Regular SBP and SberPay routes return the Aeris payment page; /h2h routes return a direct provider URL. Card H2H returns a normalized next_action when browser participation is required.",
      "item": [
        {
          "name": "Create hosted card pay-in (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-card\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"redirect_url_error\": \"https://merchant.example/payment/error\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payins/card",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payins", "card"]
            },
            "description": "Creates a card payment whose card details are entered on the bank page. Redirect the customer to payment_url."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create card H2H pay-in (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-card-h2h\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"redirect_url_error\": \"https://merchant.example/payment/error\",\n  \"card\": {\n    \"pan\": \"4111111111111111\",\n    \"expiry\": \"1230\",\n    \"cvv\": \"123\",\n    \"holder\": \"IVAN IVANOV\"\n  },\n  \"browser_info\": {\n    \"accept_header\": \"text/html,application/xhtml+xml\",\n    \"color_depth\": 24,\n    \"java_enabled\": false,\n    \"javascript_enabled\": true,\n    \"language\": \"ru-RU\",\n    \"screen_height\": 900,\n    \"screen_width\": 1440,\n    \"timezone_offset\": -300,\n    \"user_agent\": \"Mozilla/5.0 Aeris Postman\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payins/card-h2h",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payins", "card-h2h"]
            },
            "description": "Creates a card payment through Host-to-Host. Inspect next_action immediately after creation."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); if (body.next_action && body.next_action.complete_fields) pm.collectionVariables.set('three_ds_complete_fields', JSON.stringify(body.next_action.complete_fields)); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Complete optional 3DS browser method (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{{three_ds_complete_fields}}" },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/transactions/{{transaction_id}}/3ds/complete",
              "host": ["{{base_url}}"],
              "path": [
                "api",
                "v1",
                "merchant",
                "transactions",
                "{{transaction_id}}",
                "3ds",
                "complete"
              ]
            },
            "description": "Call only after executing all hidden steps returned by a three_ds_method next_action."
          }
        },
        {
          "name": "Create SberPay pay-in (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-sber\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"payer_phone\": \"+79991234567\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"redirect_url_error\": \"https://merchant.example/payment/error\",\n  \"front_type\": \"back2app\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payins/sber-pay",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payins", "sber-pay"]
            },
            "description": "Website flow: payer_phone receives a push or SMS, and no redirect is required. For a mobile app, use front_type=app2app with os_type and deep_link, then open the returned payment_url."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create SberPay app-to-app pay-in (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-sber-app\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"payer_phone\": \"+79991234567\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"front_type\": \"app2app\",\n  \"os_type\": \"android\",\n  \"deep_link\": \"merchant-app://payment/return\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payins/sber-pay",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payins", "sber-pay"]
            },
            "description": "Mobile app or WebView flow through the Aeris payment page. Open payment_url from the response; the bank returns the customer through deep_link. Set os_type to ios or android."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create SBP pay-in (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-sbp\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"payer_phone\": \"+79991234567\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"redirect_url_error\": \"https://merchant.example/payment/error\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payins/sbp",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payins", "sbp"]
            },
            "description": "Creates an SBP payment and returns the Aeris payment page in payment_url. Confirm completion by webhook or status API."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create direct SBP H2H pay-in (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-sbp-h2h\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"payer_phone\": \"+79991234567\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"redirect_url_error\": \"https://merchant.example/payment/error\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payins/sbp/h2h",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payins", "sbp", "h2h"]
            },
            "description": "Returns the provider SBP URL directly. Render payment_url as a QR code on desktop or open it on mobile."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create direct SberPay H2H pay-in (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-sber-h2h\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"payer_phone\": \"+79991234567\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"front_type\": \"app2app\",\n  \"os_type\": \"android\",\n  \"deep_link\": \"merchant-app://payment/return\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payins/sber-pay/h2h",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payins", "sber-pay", "h2h"]
            },
            "description": "Returns the SberPay app-to-app provider URL directly. front_type=app2app, os_type and deep_link are required."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create pay-in (v2 route: SberPay)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"amount_currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-v2-sber\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"payer_phone\": \"+79991234567\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"redirect_url_error\": \"https://merchant.example/payment/error\",\n  \"front_type\": \"back2app\",\n  \"payin_route\": {\n    \"merchant_country\": \"RU\",\n    \"requisite_country\": \"RU\",\n    \"requisite_currency\": \"RUB\",\n    \"requisite_type\": \"sberpay\",\n    \"rail\": \"sber-pay\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v2/merchant/payins",
              "host": ["{{base_url}}"],
              "path": ["api", "v2", "merchant", "payins"]
            },
            "description": "Route-based SberPay contract using RU/RU/RUB/sberpay/sber-pay."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create pay-in (v2 route: SBP)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 9000,\n  \"amount_currency\": \"RUB\",\n  \"merchant_order_id\": \"{{merchant_order_id}}-v2-sbp\",\n  \"payer_ip\": \"198.51.100.24\",\n  \"payer_phone\": \"+79991234567\",\n  \"callback_url\": \"https://merchant.example/webhooks/payment\",\n  \"redirect_url_success\": \"https://merchant.example/payment/success\",\n  \"redirect_url_error\": \"https://merchant.example/payment/error\",\n  \"payin_route\": {\n    \"merchant_country\": \"RU\",\n    \"requisite_country\": \"RU\",\n    \"requisite_currency\": \"RUB\",\n    \"requisite_type\": \"phone\",\n    \"rail\": \"sbp\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v2/merchant/payins",
              "host": ["{{base_url}}"],
              "path": ["api", "v2", "merchant", "payins"]
            },
            "description": "Route-based SBP pay-in. The selected route is RU/RU/RUB/phone/sbp."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); if (body.id) pm.collectionVariables.set('transaction_id', body.id); } catch (e) {} }"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Payments: read",
      "description": "Read payment status and merchant transaction history. GET requests are signed with an empty JSON object `{}`; query parameters are not part of the signature.",
      "item": [
        {
          "name": "Get payment by ID",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/transactions/{{transaction_id}}",
              "host": ["{{base_url}}"],
              "path": [
                "api",
                "v1",
                "merchant",
                "transactions",
                "{{transaction_id}}"
              ]
            },
            "description": "Returns a single merchant-owned transaction. Use the ID captured from a create pay-in response."
          }
        },
        {
          "name": "List payments",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/transactions?items_per_page=50&page_number=1",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "transactions"],
              "query": [
                { "key": "items_per_page", "value": "50" },
                { "key": "page_number", "value": "1" },
                { "key": "status", "value": "completed", "disabled": true }
              ]
            },
            "description": "Lists the authenticated merchant's payments. Optional status: pending, completed, expired, cancelled, or disputed."
          }
        },
        {
          "name": "Export payments (XLSX)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/transactions/export?limit=5000&offset=0",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "transactions", "export"],
              "query": [
                { "key": "limit", "value": "5000" },
                { "key": "offset", "value": "0" },
                { "key": "status", "value": "completed", "disabled": true },
                {
                  "key": "date_from",
                  "value": "2026-01-01T00:00:00Z",
                  "disabled": true
                },
                {
                  "key": "date_to",
                  "value": "2026-01-31T23:59:59Z",
                  "disabled": true
                }
              ]
            },
            "description": "Downloads an XLSX export for the authenticated merchant. The response is binary; save it to disk in Postman."
          }
        }
      ]
    },
    {
      "name": "Payouts",
      "description": "Create RUB card payouts or USDT payouts in the TRON network, then read their final status through the common payout GET methods.",
      "item": [
        {
          "name": "Create card payout (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 1000,\n  \"currency\": \"RUB\",\n  \"merchant_order_id\": \"{{payout_order_id}}\",\n  \"address\": \"4111111111111111\",\n  \"phone\": \"+79001234567\",\n  \"customer_name\": \"Ivan Ivanov\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payouts/card",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payouts", "card"]
            },
            "description": "Creates a RUB card payout. `amount` is an integer RUB value; `address` is the beneficiary card PAN; `phone` and `customer_name` are required."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); pm.collectionVariables.set('payout_id', body.id || body.withdraw_id || ''); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create USDT TRC-20 payout (v1)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 100,\n  \"currency\": \"USDT\",\n  \"merchant_order_id\": \"{{payout_order_id}}-usdt\",\n  \"address\": \"TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payouts/crypto-trc20",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payouts", "crypto-trc20"]
            },
            "description": "Creates an integer USDT payout to a TRON address. Creating a payout reserves the amount and payout fee from the available balance."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); pm.collectionVariables.set('payout_id', body.id || body.withdraw_id || ''); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create card payout (v2 route)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 1000,\n  \"source_currency\": \"RUB\",\n  \"merchant_order_id\": \"{{payout_order_id}}-v2\",\n  \"payout_route\": {\n    \"merchant_country\": \"RU\",\n    \"beneficiary_country\": \"RU\",\n    \"beneficiary_currency\": \"RUB\",\n    \"beneficiary_type\": \"card\",\n    \"rail\": \"card\"\n  },\n  \"beneficiary\": {\n    \"card_pan\": \"4111111111111111\",\n    \"phone\": \"+79001234567\",\n    \"customer_name\": \"Ivan Ivanov\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v2/merchant/payouts",
              "host": ["{{base_url}}"],
              "path": ["api", "v2", "merchant", "payouts"]
            },
            "description": "Route-based card payout. Only the RU/RU/RUB/card/card route is supported by the public payout contract."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); pm.collectionVariables.set('payout_id', body.id || body.withdraw_id || ''); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "Create USDT TRC-20 payout (v2 route)",
          "request": {
            "method": "POST",
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"amount\": 100,\n  \"source_currency\": \"USDT\",\n  \"merchant_order_id\": \"{{payout_order_id}}-usdt-v2\",\n  \"payout_route\": {\n    \"merchant_country\": \"RU\",\n    \"beneficiary_country\": \"crypto\",\n    \"beneficiary_currency\": \"USDT\",\n    \"beneficiary_type\": \"wallet\",\n    \"rail\": \"crypto_trc20\"\n  },\n  \"beneficiary\": {\n    \"wallet_address\": \"TXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\"\n  }\n}"
            },
            "url": {
              "raw": "{{base_url}}/api/v2/merchant/payouts",
              "host": ["{{base_url}}"],
              "path": ["api", "v2", "merchant", "payouts"]
            },
            "description": "Route-based USDT payout in the TRON network."
          },
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "if (pm.response.code >= 200 && pm.response.code < 300) { try { const body = pm.response.json(); pm.collectionVariables.set('payout_id', body.id || body.withdraw_id || ''); } catch (e) {} }"
                ]
              }
            }
          ]
        },
        {
          "name": "List payouts (v1)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payouts?page_number=1&items_per_page=50",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payouts"],
              "query": [
                { "key": "page_number", "value": "1" },
                { "key": "items_per_page", "value": "50" },
                { "key": "status", "value": "completed", "disabled": true }
              ]
            },
            "description": "Lists payouts. Optional status: pending, completed, or failed."
          }
        },
        {
          "name": "Get payout (v1)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/payouts/{{payout_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "payouts", "{{payout_id}}"]
            },
            "description": "Returns a single merchant-owned payout."
          }
        },
        {
          "name": "List payouts (v2)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v2/merchant/payouts?page_number=1&page_size=50",
              "host": ["{{base_url}}"],
              "path": ["api", "v2", "merchant", "payouts"],
              "query": [
                { "key": "page_number", "value": "1" },
                { "key": "page_size", "value": "50" },
                { "key": "status", "value": "completed", "disabled": true }
              ]
            },
            "description": "Lists payouts through the v2 route API. Optional status: pending, completed, or failed."
          }
        },
        {
          "name": "Get payout (v2)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v2/merchant/payouts/{{payout_id}}",
              "host": ["{{base_url}}"],
              "path": ["api", "v2", "merchant", "payouts", "{{payout_id}}"]
            },
            "description": "Returns a single merchant-owned payout through the v2 route API."
          }
        }
      ]
    },
    {
      "name": "Account",
      "description": "Merchant account read methods. These are authenticated with the same HMAC headers.",
      "item": [
        {
          "name": "Get balance (v1)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/balance",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "balance"]
            },
            "description": "Returns available, frozen, total, and settlement limit values."
          }
        },
        {
          "name": "Get balance (v2)",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v2/merchant/balance",
              "host": ["{{base_url}}"],
              "path": ["api", "v2", "merchant", "balance"]
            },
            "description": "v2 alias for the merchant balance contract."
          }
        },
        {
          "name": "Get merchant info",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/info",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "info"]
            },
            "description": "Returns merchant profile, webhook, conversion metrics, and settlement information."
          }
        },
        {
          "name": "List available banks",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/banks",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "banks"]
            },
            "description": "Returns bank names currently known by the system. This is informational; route selection remains card or SBP."
          }
        },
        {
          "name": "Get server timestamp",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/api/v1/merchant/timestamp",
              "host": ["{{base_url}}"],
              "path": ["api", "v1", "merchant", "timestamp"]
            },
            "description": "Returns the server Unix timestamp. Useful for checking clock skew before signing requests."
          }
        }
      ]
    },
    {
      "name": "Webhook example (merchant side)",
      "description": "Aeris sends signed POST callbacks to the callback_url configured on the pay-in. This saved request is an example for local handler testing; it is not sent to Aeris.",
      "item": [
        {
          "name": "Payment completed callback sample",
          "request": {
            "method": "POST",
            "header": [
              { "key": "Content-Type", "value": "application/json" },
              { "key": "X-API-KEY", "value": "aeris-public-key" },
              { "key": "X-TIMESTAMP", "value": "1785840000" },
              { "key": "X-SIGNATURE", "value": "hex-hmac-sha256" },
              { "key": "X-Event-ID", "value": "80b2192f-example" }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"id\": \"6b18e33c-example\",\n  \"merchant_order_id\": \"order-10001\",\n  \"status\": \"completed\",\n  \"amount\": 9000,\n  \"currency\": \"RUB\",\n  \"test\": false,\n  \"timestamp\": 1785840000\n}"
            },
            "url": {
              "raw": "{{merchant_webhook_url}}",
              "host": ["{{merchant_webhook_url}}"]
            },
            "description": "Verify X-SIGNATURE with the merchant secret over compact JSON plus the timestamp (`body:timestamp++`) and make the handler idempotent."
          }
        }
      ]
    }
  ]
}
