{
  "info": {
    "name": "zGate API (zPayLink)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "USDT (BEP-20) payments on BNB Smart Chain: create an invoice, show its unique deposit address, hosted page or payment link, and receive signed webhooks as the payment is detected, confirmed and settled.\n\nStatus (2026-10-15): Test environment open; limited Mainnet launch. The test environment on BNB Smart Chain Testnet is open to merchants with a key. On Mainnet, invoices are accepted only within a small, operator-set limit per merchant while the launch is limited. Merchant balance withdrawals, sweeps and refunds are not enabled.\n\nSet the collection variables baseUrl and apiKey (placeholder only; never commit real keys)."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://gate.zpaylink.com/staging/api/v1",
      "description": "Test (BNB Smart Chain Testnet, chain 97): https://gate.zpaylink.com/staging/api/v1 | Production (BNB Smart Chain, chain 56): https://gate.zpaylink.com/api/v1"
    },
    {
      "key": "apiKey",
      "value": "<your zgk_test_… key>",
      "description": "Placeholder"
    }
  ],
  "item": [
    {
      "name": "invoices",
      "item": [
        {
          "name": "POST /invoices | Create an invoice",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Idempotency-Key",
                "value": "{{$guid}}",
                "description": "Optional; reuse it when you retry"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/invoices",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "invoices"
              ]
            },
            "description": "Creates a USDT invoice with its own deposit address. Unknown body fields are rejected. Amounts are decimal strings (up to 18 decimals); the default range is 1 to 100000 USDT and merchant or launch limits can be lower.\n\nScope: invoices:write\n\nShow the customer hosted_url, or deposit_address with the exact amount, or payment_uri (EIP-681) as a QR code. Each invoice has its own address.\n\nFetch token_contract and required_confirmations from GET /network instead of hard-coding them.",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"merchant_order_id\": \"ORDER-1001\",\n  \"amount\": \"25.00\",\n  \"asset\": \"USDT\",\n  \"network\": \"bsc-testnet\",\n  \"description\": \"Order 1001\",\n  \"metadata\": {\n    \"customer_ref\": \"C-77\"\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            }
          },
          "response": [
            {
              "name": "Example 201 Created",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Idempotency-Key",
                    "value": "{{$guid}}",
                    "description": "Optional; reuse it when you retry"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "invoices"
                  ]
                },
                "description": "Creates a USDT invoice with its own deposit address. Unknown body fields are rejected. Amounts are decimal strings (up to 18 decimals); the default range is 1 to 100000 USDT and merchant or launch limits can be lower.\n\nScope: invoices:write\n\nShow the customer hosted_url, or deposit_address with the exact amount, or payment_uri (EIP-681) as a QR code. Each invoice has its own address.\n\nFetch token_contract and required_confirmations from GET /network instead of hard-coding them.",
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"merchant_order_id\": \"ORDER-1001\",\n  \"amount\": \"25.00\",\n  \"asset\": \"USDT\",\n  \"network\": \"bsc-testnet\",\n  \"description\": \"Order 1001\",\n  \"metadata\": {\n    \"customer_ref\": \"C-77\"\n  }\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Created",
              "code": 201,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"inv_7k2m9qx4r8t3w6y5p2n4\",\n  \"object\": \"invoice\",\n  \"merchant_id\": \"mch_9w4k7m2x5q8r3t6y2p4n\",\n  \"merchant_order_id\": \"ORDER-1001\",\n  \"status\": \"pending\",\n  \"late\": false,\n  \"final\": false,\n  \"network\": \"bsc-testnet\",\n  \"chain_id\": 97,\n  \"asset\": \"USDT\",\n  \"token_contract\": \"0xTOKEN_CONTRACT\",\n  \"token_decimals\": 18,\n  \"amount\": \"25.00\",\n  \"amount_raw\": \"25000000000000000000\",\n  \"amount_received\": \"0.00\",\n  \"amount_received_raw\": \"0\",\n  \"amount_pending\": \"0.00\",\n  \"amount_pending_raw\": \"0\",\n  \"deposit_address\": \"0xDEPOSIT_ADDRESS\",\n  \"required_confirmations\": 15,\n  \"payment_uri\": \"ethereum:0xTOKEN_CONTRACT@97/transfer?address=0xDEPOSIT_ADDRESS&uint256=25000000000000000000\",\n  \"hosted_url\": \"https://gate.zpaylink.com/staging/pay/inv_7k2m9qx4r8t3w6y5p2n4\",\n  \"description\": \"Order 1001\",\n  \"metadata\": {\n    \"customer_ref\": \"C-77\"\n  },\n  \"created_at\": \"2026-10-15T09:00:00.000Z\",\n  \"expires_at\": \"2026-10-15T09:30:00.000Z\",\n  \"updated_at\": \"2026-10-15T09:00:00.000Z\",\n  \"detected_at\": null,\n  \"finalized_at\": null,\n  \"expired_at\": null\n}",
              "_postman_previewlanguage": "json"
            }
          ]
        },
        {
          "name": "GET /invoices/{id} | Retrieve an invoice",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/invoices/:id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "invoices",
                ":id"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Invoice id (inv_…)"
                }
              ]
            },
            "description": "Returns the invoice with its on-chain transactions (up to 100, including orphaned ones after a reorganisation). Use it to confirm a status before you fulfil an order.\n\nScope: invoices:read"
          },
          "response": [
            {
              "name": "Example 200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/invoices/:id",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "invoices",
                    ":id"
                  ],
                  "variable": [
                    {
                      "key": "id",
                      "value": "",
                      "description": "Invoice id (inv_…)"
                    }
                  ]
                },
                "description": "Returns the invoice with its on-chain transactions (up to 100, including orphaned ones after a reorganisation). Use it to confirm a status before you fulfil an order.\n\nScope: invoices:read"
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"id\": \"inv_7k2m9qx4r8t3w6y5p2n4\",\n  \"object\": \"invoice\",\n  \"merchant_id\": \"mch_9w4k7m2x5q8r3t6y2p4n\",\n  \"merchant_order_id\": \"ORDER-1001\",\n  \"status\": \"pending\",\n  \"late\": false,\n  \"final\": false,\n  \"network\": \"bsc-testnet\",\n  \"chain_id\": 97,\n  \"asset\": \"USDT\",\n  \"token_contract\": \"0xTOKEN_CONTRACT\",\n  \"token_decimals\": 18,\n  \"amount\": \"25.00\",\n  \"amount_raw\": \"25000000000000000000\",\n  \"amount_received\": \"0.00\",\n  \"amount_received_raw\": \"0\",\n  \"amount_pending\": \"0.00\",\n  \"amount_pending_raw\": \"0\",\n  \"deposit_address\": \"0xDEPOSIT_ADDRESS\",\n  \"required_confirmations\": 15,\n  \"payment_uri\": \"ethereum:0xTOKEN_CONTRACT@97/transfer?address=0xDEPOSIT_ADDRESS&uint256=25000000000000000000\",\n  \"hosted_url\": \"https://gate.zpaylink.com/staging/pay/inv_7k2m9qx4r8t3w6y5p2n4\",\n  \"description\": \"Order 1001\",\n  \"metadata\": {\n    \"customer_ref\": \"C-77\"\n  },\n  \"created_at\": \"2026-10-15T09:00:00.000Z\",\n  \"expires_at\": \"2026-10-15T09:30:00.000Z\",\n  \"updated_at\": \"2026-10-15T09:00:00.000Z\",\n  \"detected_at\": null,\n  \"finalized_at\": null,\n  \"expired_at\": null,\n  \"transactions\": [\n    {\n      \"id\": \"trf_3n8p2q5r9t4w7y2k6m3x\",\n      \"object\": \"transaction\",\n      \"invoice_id\": \"inv_7k2m9qx4r8t3w6y5p2n4\",\n      \"network\": \"bsc-testnet\",\n      \"tx_hash\": \"0xTRANSACTION_HASH\",\n      \"log_index\": 4,\n      \"block_number\": 51234567,\n      \"block_hash\": \"0xBLOCK_HASH\",\n      \"token_contract\": \"0xTOKEN_CONTRACT\",\n      \"from\": \"0xPAYER_ADDRESS\",\n      \"to\": \"0xDEPOSIT_ADDRESS\",\n      \"amount\": \"25.00\",\n      \"amount_raw\": \"25000000000000000000\",\n      \"status\": \"confirmed\",\n      \"confirmations\": 15,\n      \"after_expiry\": false,\n      \"detected_at\": \"2026-10-15T09:04:10.000Z\",\n      \"confirmed_at\": \"2026-10-15T09:05:00.000Z\",\n      \"orphaned_at\": null,\n      \"explorer_url\": \"https://testnet.bscscan.com/tx/0xTRANSACTION_HASH\"\n    }\n  ]\n}",
              "_postman_previewlanguage": "json"
            }
          ]
        },
        {
          "name": "GET /invoices | List invoices",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/invoices",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "invoices"
              ],
              "query": [
                {
                  "key": "status",
                  "value": "",
                  "description": "pending, detected, confirming, paid, underpaid, overpaid, expired or failed",
                  "disabled": true
                },
                {
                  "key": "merchant_order_id",
                  "value": "",
                  "description": "Exact match",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "1 to 100, default 20",
                  "disabled": true
                },
                {
                  "key": "starting_after",
                  "value": "",
                  "description": "An invoice id",
                  "disabled": true
                }
              ]
            },
            "description": "Newest first, with cursor pagination: pass the last id of a page as starting_after to get the next one.\n\nScope: invoices:read\n\nList items are full invoice objects; the example is shortened."
          },
          "response": [
            {
              "name": "Example 200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/invoices",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "invoices"
                  ],
                  "query": [
                    {
                      "key": "status",
                      "value": "",
                      "description": "pending, detected, confirming, paid, underpaid, overpaid, expired or failed",
                      "disabled": true
                    },
                    {
                      "key": "merchant_order_id",
                      "value": "",
                      "description": "Exact match",
                      "disabled": true
                    },
                    {
                      "key": "limit",
                      "value": "",
                      "description": "1 to 100, default 20",
                      "disabled": true
                    },
                    {
                      "key": "starting_after",
                      "value": "",
                      "description": "An invoice id",
                      "disabled": true
                    }
                  ]
                },
                "description": "Newest first, with cursor pagination: pass the last id of a page as starting_after to get the next one.\n\nScope: invoices:read\n\nList items are full invoice objects; the example is shortened."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"inv_7k2m9qx4r8t3w6y5p2n4\",\n      \"object\": \"invoice\",\n      \"status\": \"paid\",\n      \"amount\": \"25.00\"\n    }\n  ],\n  \"has_more\": false\n}",
              "_postman_previewlanguage": "json"
            }
          ]
        }
      ]
    },
    {
      "name": "transactions",
      "item": [
        {
          "name": "GET /transactions | List transactions",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/transactions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "transactions"
              ],
              "query": [
                {
                  "key": "invoice_id",
                  "value": "",
                  "description": "Only this invoice",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "1 to 100, default 20",
                  "disabled": true
                },
                {
                  "key": "starting_after",
                  "value": "",
                  "description": "A transaction id (trf_…)",
                  "disabled": true
                }
              ]
            },
            "description": "On-chain transfers to your deposit addresses, newest detected first. Status is seen, confirmed or orphaned.\n\nScope: transactions:read"
          },
          "response": [
            {
              "name": "Example 200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/transactions",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "transactions"
                  ],
                  "query": [
                    {
                      "key": "invoice_id",
                      "value": "",
                      "description": "Only this invoice",
                      "disabled": true
                    },
                    {
                      "key": "limit",
                      "value": "",
                      "description": "1 to 100, default 20",
                      "disabled": true
                    },
                    {
                      "key": "starting_after",
                      "value": "",
                      "description": "A transaction id (trf_…)",
                      "disabled": true
                    }
                  ]
                },
                "description": "On-chain transfers to your deposit addresses, newest detected first. Status is seen, confirmed or orphaned.\n\nScope: transactions:read"
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"trf_3n8p2q5r9t4w7y2k6m3x\",\n      \"object\": \"transaction\",\n      \"invoice_id\": \"inv_7k2m9qx4r8t3w6y5p2n4\",\n      \"network\": \"bsc-testnet\",\n      \"tx_hash\": \"0xTRANSACTION_HASH\",\n      \"log_index\": 4,\n      \"block_number\": 51234567,\n      \"block_hash\": \"0xBLOCK_HASH\",\n      \"token_contract\": \"0xTOKEN_CONTRACT\",\n      \"from\": \"0xPAYER_ADDRESS\",\n      \"to\": \"0xDEPOSIT_ADDRESS\",\n      \"amount\": \"25.00\",\n      \"amount_raw\": \"25000000000000000000\",\n      \"status\": \"confirmed\",\n      \"confirmations\": 15,\n      \"after_expiry\": false,\n      \"detected_at\": \"2026-10-15T09:04:10.000Z\",\n      \"confirmed_at\": \"2026-10-15T09:05:00.000Z\",\n      \"orphaned_at\": null,\n      \"explorer_url\": \"https://testnet.bscscan.com/tx/0xTRANSACTION_HASH\"\n    }\n  ],\n  \"has_more\": false\n}",
              "_postman_previewlanguage": "json"
            }
          ]
        }
      ]
    },
    {
      "name": "network",
      "item": [
        {
          "name": "GET /network | Network status",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/network",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "network"
              ]
            },
            "description": "Token contract, confirmations required and the health of the chain connection (ok, degraded, down, misconfigured or not_started). Works with any valid key."
          },
          "response": [
            {
              "name": "Example 200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/network",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "network"
                  ]
                },
                "description": "Token contract, confirmations required and the health of the chain connection (ok, degraded, down, misconfigured or not_started). Works with any valid key."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"network\": \"bsc-testnet\",\n  \"chain_id\": 97,\n  \"asset\": \"USDT\",\n  \"token_contract\": \"0xTOKEN_CONTRACT\",\n  \"required_confirmations\": 15,\n  \"status\": \"ok\"\n}",
              "_postman_previewlanguage": "json"
            }
          ]
        }
      ]
    },
    {
      "name": "webhooks",
      "item": [
        {
          "name": "POST /webhooks/test | Send a test webhook",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/webhooks/test",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "webhooks",
                "test"
              ]
            },
            "description": "Queues a signed webhook.test event to every active endpoint of your account (10 per minute per key).\n\nScope: webhooks:write"
          },
          "response": [
            {
              "name": "Example 202 Accepted",
              "originalRequest": {
                "method": "POST",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/webhooks/test",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "webhooks",
                    "test"
                  ]
                },
                "description": "Queues a signed webhook.test event to every active endpoint of your account (10 per minute per key).\n\nScope: webhooks:write"
              },
              "status": "Accepted",
              "code": 202,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"object\": \"event\",\n  \"id\": \"evt_5q2w8e4r7t3y6u9p2k4m\",\n  \"type\": \"webhook.test\",\n  \"deliveries_queued\": 1\n}",
              "_postman_previewlanguage": "json"
            }
          ]
        }
      ]
    },
    {
      "name": "events",
      "item": [
        {
          "name": "GET /events | List events",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/events",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events"
              ],
              "query": [
                {
                  "key": "invoice_id",
                  "value": "",
                  "description": "Only events of this invoice",
                  "disabled": true
                },
                {
                  "key": "type",
                  "value": "",
                  "description": "An event type such as invoice.paid",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "",
                  "description": "1 to 100, default 20",
                  "disabled": true
                },
                {
                  "key": "starting_after",
                  "value": "",
                  "description": "An event id",
                  "disabled": true
                }
              ]
            },
            "description": "The webhook events of your account with the exact signed payload and the state of every delivery. Use it to reconcile after downtime.\n\nScope: invoices:read\n\npayload is the full signed body; the example is shortened."
          },
          "response": [
            {
              "name": "Example 200 OK",
              "originalRequest": {
                "method": "GET",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/events",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "events"
                  ],
                  "query": [
                    {
                      "key": "invoice_id",
                      "value": "",
                      "description": "Only events of this invoice",
                      "disabled": true
                    },
                    {
                      "key": "type",
                      "value": "",
                      "description": "An event type such as invoice.paid",
                      "disabled": true
                    },
                    {
                      "key": "limit",
                      "value": "",
                      "description": "1 to 100, default 20",
                      "disabled": true
                    },
                    {
                      "key": "starting_after",
                      "value": "",
                      "description": "An event id",
                      "disabled": true
                    }
                  ]
                },
                "description": "The webhook events of your account with the exact signed payload and the state of every delivery. Use it to reconcile after downtime.\n\nScope: invoices:read\n\npayload is the full signed body; the example is shortened."
              },
              "status": "OK",
              "code": 200,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"object\": \"list\",\n  \"data\": [\n    {\n      \"id\": \"evt_8m3k6p2q9r4t7w2y5x3n\",\n      \"object\": \"event\",\n      \"type\": \"invoice.paid\",\n      \"invoice_id\": \"inv_7k2m9qx4r8t3w6y5p2n4\",\n      \"created_at\": \"2026-10-15T09:05:01.000Z\",\n      \"payload\": {\n        \"id\": \"evt_8m3k6p2q9r4t7w2y5x3n\",\n        \"object\": \"event\",\n        \"type\": \"invoice.paid\"\n      },\n      \"deliveries\": [\n        {\n          \"url\": \"https://shop.example.com/webhooks/zgate\",\n          \"status\": \"delivered\",\n          \"attempts\": 1,\n          \"last_http_status\": 200,\n          \"last_error\": null,\n          \"last_attempt_at\": \"2026-10-15T09:05:02.000Z\",\n          \"delivered_at\": \"2026-10-15T09:05:02.000Z\",\n          \"next_attempt_at\": null\n        }\n      ]\n    }\n  ],\n  \"has_more\": false\n}",
              "_postman_previewlanguage": "json"
            }
          ]
        },
        {
          "name": "POST /events/{id}/redeliver | Redeliver an event",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/events/:id/redeliver",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "events",
                ":id",
                "redeliver"
              ],
              "variable": [
                {
                  "key": "id",
                  "value": "",
                  "description": "Event id (evt_…)"
                }
              ]
            },
            "description": "Sends an event again now to your active endpoints, with the same event id (10 per minute per key). The attempt counter is not reset.\n\nScope: webhooks:write"
          },
          "response": [
            {
              "name": "Example 202 Accepted",
              "originalRequest": {
                "method": "POST",
                "header": [],
                "url": {
                  "raw": "{{baseUrl}}/events/:id/redeliver",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "events",
                    ":id",
                    "redeliver"
                  ],
                  "variable": [
                    {
                      "key": "id",
                      "value": "",
                      "description": "Event id (evt_…)"
                    }
                  ]
                },
                "description": "Sends an event again now to your active endpoints, with the same event id (10 per minute per key). The attempt counter is not reset.\n\nScope: webhooks:write"
              },
              "status": "Accepted",
              "code": 202,
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json"
                }
              ],
              "body": "{\n  \"object\": \"event\",\n  \"id\": \"evt_8m3k6p2q9r4t7w2y5x3n\",\n  \"type\": \"invoice.paid\",\n  \"deliveries_queued\": 1\n}",
              "_postman_previewlanguage": "json"
            }
          ]
        }
      ]
    }
  ]
}
