{
  "info": {
    "_postman_id": "4d5e6f7a-8b9c-0d1e-2f3a-4b5c6d7e8f9a",
    "name": "EaglePay Backend Controller API Collection",
    "description": "Postman Collection pack designed specifically for the actual EaglePay phoenix gateway API controller endpoints. Supports mobile money collections (deposits), and payouts.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "1. Core API Transactions (Protected)",
      "item": [
        {
          "name": "Initiate Deposit",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Basic {{basicAuth}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reference_id\": \"f4401bd2-1568-4140-bf2d-eb77d2b2b639\",\n  \"payer\": {\n    \"method_type\": \"ewallet\",\n    \"method_id\": 1,\n    \"msisdn\": \"260978942121\",\n    \"amount\": \"10\"\n  },\n  \"platform\": \"web\",\n  \"source\": \"lite\",\n  \"region_name\": \"zambia\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/transaction/deposit",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "transaction",
                "deposit"
              ]
            },
            "description": "Submit a collection deposit transaction matching the actual parameters processed by `GatewayWeb.Api.TransactionController.initiate_deposit`."
          },
          "response": []
        },
        {
          "name": "Check Deposit Status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Basic {{basicAuth}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/transaction/deposit/:reference_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "transaction",
                "deposit",
                ":reference_id"
              ],
              "variable": [
                {
                  "key": "reference_id",
                  "value": "f4401bd2-1568-4140-bf2d-eb77d2b2b639",
                  "description": "The original transaction UUID string."
                }
              ]
            },
            "description": "Query details and deposit payment outcomes from the database using the unique reference_id."
          },
          "response": []
        },
        {
          "name": "Initiate Payout",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Basic {{basicAuth}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"reference_id\": \"f4401bd2-1568-4140-bf2d-eb77d2b2b639\",\n  \"recipient\": {\n    \"method_type\": \"ewallet\",\n    \"method_id\": 1,\n    \"msisdn\": \"260978942121\",\n    \"amount\": \"10\"\n  },\n  \"platform\": \"web\",\n  \"source\": \"lite\",\n  \"region_name\": \"zambia\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/transaction/payout",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "transaction",
                "payout"
              ]
            },
            "description": "Perform an instant payout disbursement to recipient mobile wallet, bank account, or voucher."
          },
          "response": []
        },
        {
          "name": "Check Payout Status",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Basic {{basicAuth}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/transaction/payout/:reference_id",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "transaction",
                "payout",
                ":reference_id"
              ],
              "variable": [
                {
                  "key": "reference_id",
                  "value": "f4401bd2-1568-4140-bf2d-eb77d2b2b639"
                }
              ]
            },
            "description": "Get payout disbursement statuses."
          },
          "response": []
        }
      ]
    },
    {
      "name": "2. Callback Hooks",
      "item": [
        {
          "name": "Deposit Callback Notification",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": true,\n  \"code\": 200,\n  \"message\": \"Transaction is successful\",\n  \"data\": {\n    \"reference_id\": \"f4401bd2-1568-4140-bf2d-eb77d2b2b639\",\n    \"created\": \"2020-10-19T11:17:01Z\",\n    \"method_type\": \"ewallet\",\n    \"method_id\": 1,\n    \"msisdn\": \"260978942121\",\n    \"amount\": \"10\",\n    \"platform\": \"web\",\n    \"source\": \"lite\",\n    \"region_code\": \"zm\",\n    \"region_name\": \"zambia\",\n    \"status\": \"Complete\",\n    \"currency\": \"ZMW\",\n    \"transaction_type\": \"deposit\",\n    \"transaction\": {\n      \"external_id\": \"TID:PP260604.0903.J45030\",\n      \"message\": \"Dear Customer, your number **78 has been debited with 10. Your balance: 20.00. TID:PP260604.0903.J45030\",\n      \"date\": \"2020-10-19T11:17:01Z\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/your-callback-endpoint",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "your-callback-endpoint"
              ]
            },
            "description": "Simulate and trigger an incoming deposit callback hook notification."
          },
          "response": []
        },
        {
          "name": "Payout Callback Notification",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"status\": true,\n  \"code\": 200,\n  \"message\": \"Transaction is successful\",\n  \"data\": {\n    \"reference_id\": \"f4401bd2-1568-4140-bf2d-eb77d2b2b639\",\n    \"created\": \"2020-10-19T11:17:01Z\",\n    \"method_type\": \"ewallet\",\n    \"method_id\": 1,\n    \"msisdn\": \"260978942121\",\n    \"amount\": \"10\",\n    \"platform\": \"web\",\n    \"source\": \"lite\",\n    \"region_code\": \"zm\",\n    \"region_name\": \"zambia\",\n    \"status\": \"Complete\",\n    \"currency\": \"ZMW\",\n    \"transaction_type\": \"payout\",\n    \"transaction\": {\n      \"external_id\": \"TID:PP260604.0903.J45030\",\n      \"message\": \"Dear Customer, your number **78 has been credited with 10. Your balance: 20.00. TID:PP260604.0903.J45030\",\n      \"date\": \"2020-10-19T11:17:01Z\"\n    }\n  }\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "url": {
              "raw": "{{baseUrl}}/your-callback-endpoint",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "your-callback-endpoint"
              ]
            },
            "description": "Simulate and trigger an incoming payout callback hook notification."
          },
          "response": []
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:8001",
      "type": "string"
    },
    {
      "key": "basicAuth",
      "value": "YOUR_BASIC_AUTH_BASE64",
      "type": "string"
    }
  ]
}
