{
  "info": {
    "name": "NTPay API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Set api_key to your test key to start: the sandbox simulates operators (numbers ending 0002 insufficient balance, 0003 wrong PIN, 0004 never confirmed, 0005 operator unavailable, others paid after 5 s)."
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{api_key}}",
        "type": "string"
      }
    ]
  },
  "variable": [
    {
      "key": "base_url",
      "value": "https://gateway.ntoprog.org/api"
    },
    {
      "key": "api_key",
      "value": ""
    },
    {
      "key": "ntpay_reference",
      "value": ""
    }
  ],
  "item": [
    {
      "name": "Collection (c2b)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{base_url}}/c2b",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "c2b"
          ]
        },
        "description": "Copy content.ntpay_reference into the ntpay_reference variable.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"phone_number\": \"0851230001\",\n  \"amount\": 5000,\n  \"currency\": \"CDF\",\n  \"trans_code\": \"CMD-{{$timestamp}}\",\n  \"callback_url\": \"https://votre-site.cd/ntpay\"\n}"
        }
      }
    },
    {
      "name": "Status",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{base_url}}/status/{{ntpay_reference}}",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "status",
            "{{ntpay_reference}}"
          ]
        },
        "description": ""
      }
    },
    {
      "name": "Payout",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{base_url}}/payout",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "payout"
          ]
        },
        "description": "trans_code of a completed collection.",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"trans_code\": \"CMD-1042\",\n  \"account_number\": \"0812340001\",\n  \"amount\": 4850,\n  \"currency\": \"CDF\"\n}"
        }
      }
    },
    {
      "name": "Send a payout now (b2c)",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{base_url}}/b2c",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "b2c"
          ]
        },
        "description": "",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"transaction_code\": \"{{ntpay_reference}}\"\n}"
        }
      }
    },
    {
      "name": "Former collection endpoint",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{base_url}}/new-transaction",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "new-transaction"
          ]
        },
        "description": "",
        "body": {
          "mode": "raw",
          "raw": "{\n  \"phone_number\": \"0851230001\",\n  \"amount\": 5000,\n  \"currency\": \"CDF\",\n  \"trans_code\": \"OLD-{{$timestamp}}\",\n  \"operation\": \"c2b\",\n  \"callback_url\": \"https://votre-site.cd/ntpay\",\n  \"output\": 1\n}"
        }
      }
    }
  ]
}
