{
    "info": {
        "name": "DojaPay Collection API",
        "description": "Set publicKey and secretKey in this collection's variables, then send Authentication > Sign in. It stores the access and refresh tokens for every other request. Guide: https://developers.dojapay.com/",
        "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
    },
    "auth": {
        "type": "bearer",
        "bearer": [
            {
                "key": "token",
                "value": "{{accessToken}}",
                "type": "string"
            }
        ]
    },
    "variable": [
        {
            "key": "baseUrl",
            "value": "https://api.dojapay.com/api/v1"
        },
        {
            "key": "publicKey",
            "value": ""
        },
        {
            "key": "secretKey",
            "value": ""
        },
        {
            "key": "accessToken",
            "value": ""
        },
        {
            "key": "refreshToken",
            "value": ""
        }
    ],
    "item": [
        {
            "name": "Authentication",
            "item": [
                {
                    "name": "Sign in",
                    "request": {
                        "method": "POST",
                        "description": "Exchange your public and secret key for an access token. Send the keys as HTTP Basic credentials and no body.",
                        "url": {
                            "raw": "{{baseUrl}}/auth/login",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "login"
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ],
                        "auth": {
                            "type": "basic",
                            "basic": [
                                {
                                    "key": "username",
                                    "value": "{{publicKey}}",
                                    "type": "string"
                                },
                                {
                                    "key": "password",
                                    "value": "{{secretKey}}",
                                    "type": "string"
                                }
                            ]
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const body = pm.response.json();",
                                    "if (body.success) {",
                                    "    pm.collectionVariables.set(\"accessToken\", body.data.access_token);",
                                    "    pm.collectionVariables.set(\"refreshToken\", body.data.refresh_token);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Refresh a token",
                    "request": {
                        "method": "POST",
                        "description": "Get a new access token without sending your secret key. Needs no access token, so it works after the old one has expired.",
                        "url": {
                            "raw": "{{baseUrl}}/auth/refresh",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "refresh"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"refresh_token\": \"{{refreshToken}}\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ],
                        "auth": {
                            "type": "noauth"
                        }
                    },
                    "event": [
                        {
                            "listen": "test",
                            "script": {
                                "type": "text/javascript",
                                "exec": [
                                    "const body = pm.response.json();",
                                    "if (body.success) {",
                                    "    pm.collectionVariables.set(\"accessToken\", body.data.access_token);",
                                    "    pm.collectionVariables.set(\"refreshToken\", body.data.refresh_token);",
                                    "}"
                                ]
                            }
                        }
                    ]
                },
                {
                    "name": "Check your credentials",
                    "request": {
                        "method": "GET",
                        "description": "The merchant and key behind the current access token.",
                        "url": {
                            "raw": "{{baseUrl}}/auth/me",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "me"
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ]
                    }
                },
                {
                    "name": "Sign out",
                    "request": {
                        "method": "POST",
                        "description": "Invalidate the current access token immediately. Sign in again to get a new one.",
                        "url": {
                            "raw": "{{baseUrl}}/auth/logout",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "auth",
                                "logout"
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "Virtual accounts",
            "item": [
                {
                    "name": "Create a virtual account",
                    "request": {
                        "method": "POST",
                        "description": "Give a customer or an order its own bank account number. Payments into it are credited to your wallet and notified to your webhook URL. Requires a live key.",
                        "url": {
                            "raw": "{{baseUrl}}/virtual-account/create",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "virtual-account",
                                "create"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"accountType\": \"DYNAMIC\",\n  \"amountType\": \"EXACT\",\n  \"amount\": 15000,\n  \"expiryHours\": 3,\n  \"bank\": \"9psb\",\n  \"firstName\": \"Ada\",\n  \"lastName\": \"Obi\",\n  \"email\": \"ada@example.com\",\n  \"nin\": \"12345678901\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ]
                    }
                },
                {
                    "name": "Create a test account",
                    "request": {
                        "method": "POST",
                        "description": "The same request and response as create, with a sandbox key. You get a test account number starting 99: no bank is involved and no money can be paid into it. Pay it with Simulate a payment. Requires a sandbox key.",
                        "url": {
                            "raw": "{{baseUrl}}/virtual-account/create-test",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "virtual-account",
                                "create-test"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"accountType\": \"DYNAMIC\",\n  \"amountType\": \"EXACT\",\n  \"amount\": 15000,\n  \"expiryHours\": 3,\n  \"bank\": \"9psb\",\n  \"firstName\": \"Ada\",\n  \"lastName\": \"Obi\",\n  \"email\": \"ada@example.com\",\n  \"nin\": \"12345678901\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ]
                    }
                },
                {
                    "name": "Get an account",
                    "request": {
                        "method": "GET",
                        "description": "One of your virtual accounts, by its account number.",
                        "url": {
                            "raw": "{{baseUrl}}/virtual-account/details/:accountNumber",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "virtual-account",
                                "details",
                                ":accountNumber"
                            ],
                            "variable": [
                                {
                                    "key": "accountNumber",
                                    "value": "5030012345",
                                    "description": "The 10-digit account number."
                                }
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ]
                    }
                },
                {
                    "name": "List accounts",
                    "request": {
                        "method": "GET",
                        "description": "Your virtual accounts, newest first.",
                        "url": {
                            "raw": "{{baseUrl}}/virtual-account/list?status=active&per_page=20",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "virtual-account",
                                "list"
                            ],
                            "query": [
                                {
                                    "key": "status",
                                    "value": "active",
                                    "description": "Only accounts in this state.",
                                    "disabled": false
                                },
                                {
                                    "key": "bank",
                                    "value": "",
                                    "description": "Only accounts at this bank, for example 9psb.",
                                    "disabled": true
                                },
                                {
                                    "key": "per_page",
                                    "value": "20",
                                    "description": "Results per page, 1 to 100. Default 20.",
                                    "disabled": false
                                },
                                {
                                    "key": "page",
                                    "value": "",
                                    "description": "Page number. Default 1.",
                                    "disabled": true
                                }
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "Transactions",
            "item": [
                {
                    "name": "Confirm a payment",
                    "request": {
                        "method": "GET",
                        "description": "Look a payment up by its reference before you fulfil. It is confirmed when status is success.",
                        "url": {
                            "raw": "{{baseUrl}}/transaction/status/:reference",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "transaction",
                                "status",
                                ":reference"
                            ],
                            "variable": [
                                {
                                    "key": "reference",
                                    "value": "DPY-20261029101500482913",
                                    "description": "The reference from the payment notification."
                                }
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ]
                    }
                },
                {
                    "name": "Get a transaction",
                    "request": {
                        "method": "GET",
                        "description": "Everything status returns, plus the environment and when the record was created.",
                        "url": {
                            "raw": "{{baseUrl}}/transaction/:reference",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "transaction",
                                ":reference"
                            ],
                            "variable": [
                                {
                                    "key": "reference",
                                    "value": "DPY-20261029101500482913",
                                    "description": "The transaction reference."
                                }
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ]
                    }
                },
                {
                    "name": "List transactions",
                    "request": {
                        "method": "GET",
                        "description": "Your transactions, newest first. Each payment is followed by its fee as a separate fee entry referenced <reference>-FEE; filter type=credit for payments only.",
                        "url": {
                            "raw": "{{baseUrl}}/transaction/list?type=credit&from=2026-10-01&per_page=20",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "transaction",
                                "list"
                            ],
                            "query": [
                                {
                                    "key": "status",
                                    "value": "",
                                    "description": "Only transactions in this state.",
                                    "disabled": true
                                },
                                {
                                    "key": "type",
                                    "value": "credit",
                                    "description": "credit for payments in, fee for the fee taken on each.",
                                    "disabled": false
                                },
                                {
                                    "key": "channel",
                                    "value": "",
                                    "description": "Only transactions through this channel.",
                                    "disabled": true
                                },
                                {
                                    "key": "from",
                                    "value": "2026-10-01",
                                    "description": "Created on or after this date, YYYY-MM-DD.",
                                    "disabled": false
                                },
                                {
                                    "key": "to",
                                    "value": "",
                                    "description": "Created on or before this date, YYYY-MM-DD.",
                                    "disabled": true
                                },
                                {
                                    "key": "reference",
                                    "value": "",
                                    "description": "Matches any part of a reference.",
                                    "disabled": true
                                },
                                {
                                    "key": "per_page",
                                    "value": "20",
                                    "description": "Results per page, 1 to 100. Default 20.",
                                    "disabled": false
                                },
                                {
                                    "key": "page",
                                    "value": "",
                                    "description": "Page number. Default 1.",
                                    "disabled": true
                                }
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ]
                    }
                },
                {
                    "name": "Re-verify with the bank",
                    "request": {
                        "method": "POST",
                        "description": "Ask the bank to re-confirm a virtual account payment. On success, returns the payment details as the bank reported them. Confirm a payment is enough for most integrations.",
                        "url": {
                            "raw": "{{baseUrl}}/transaction/verify",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "transaction",
                                "verify"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"reference\": \"DPY-20261029101500482913\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "Wallet",
            "item": [
                {
                    "name": "Get your balance",
                    "request": {
                        "method": "GET",
                        "description": "Your DojaPay wallet balance, in naira. With a sandbox key, the total of your simulated payments after fees, marked \"environment\": \"sandbox\"; your real balance is never shown or touched.",
                        "url": {
                            "raw": "{{baseUrl}}/wallet/balance",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "wallet",
                                "balance"
                            ]
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            }
                        ]
                    }
                }
            ]
        },
        {
            "name": "Sandbox",
            "item": [
                {
                    "name": "Simulate a payment",
                    "request": {
                        "method": "POST",
                        "description": "Pay one of your test accounts as if a customer had transferred to it. You get an inflow.received webhook, and the payment shows in transaction status, the transaction list and your sandbox balance, exactly as a real one would. Requires a sandbox key.",
                        "url": {
                            "raw": "{{baseUrl}}/sandbox/simulate-payment",
                            "host": [
                                "{{baseUrl}}"
                            ],
                            "path": [
                                "sandbox",
                                "simulate-payment"
                            ]
                        },
                        "body": {
                            "mode": "raw",
                            "raw": "{\n  \"accountNumber\": \"9904790966\",\n  \"amount\": 15000,\n  \"senderName\": \"ADA OBI\"\n}",
                            "options": {
                                "raw": {
                                    "language": "json"
                                }
                            }
                        },
                        "header": [
                            {
                                "key": "Accept",
                                "value": "application/json"
                            },
                            {
                                "key": "Content-Type",
                                "value": "application/json"
                            }
                        ]
                    }
                }
            ]
        }
    ]
}