{
  "info": {
    "_postman_id": "paynoc-v1",
    "name": "PayNOC API v1",
    "description": "Official PayNOC merchant REST API collection. Set `baseUrl` and `apiKey` variables.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://paynoc.bd",
      "type": "string"
    },
    {
      "key": "apiKey",
      "value": "sk_test_replace_me",
      "type": "string"
    }
  ],
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{apiKey}}",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "Create invoice",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/public/v1/invoices",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "invoices"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"amount\": 500,\n  \"currency\": \"BDT\",\n  \"customer_email\": \"customer@example.com\",\n  \"metadata\": {\n    \"order_id\": \"ORD-1\"\n  }\n}"
        }
      }
    },
    {
      "name": "Get invoice",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/api/public/v1/invoices/:id",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "invoices",
            ":id"
          ],
          "variable": [
            {
              "key": "id",
              "value": "inv_xxx"
            }
          ]
        }
      }
    },
    {
      "name": "Create refund",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          },
          {
            "key": "Idempotency-Key",
            "value": "{{$guid}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/public/v1/refunds",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "refunds"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"invoice_id\": \"inv_xxx\",\n  \"amount\": 500,\n  \"reason\": \"Customer request\"\n}"
        }
      }
    },
    {
      "name": "List refunds",
      "request": {
        "method": "GET",
        "url": {
          "raw": "{{baseUrl}}/api/public/v1/refunds?limit=25",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "public",
            "v1",
            "refunds"
          ],
          "query": [
            {
              "key": "limit",
              "value": "25"
            }
          ]
        }
      }
    }
  ]
}