AfroPin Developers
Postman Sign in Get test keys

Start here

Test and live

Build and test against test mode, then switch to live by changing keys. The URL and the requests stay the same.

One base URL, two modes

Test and live traffic go to the same base URL. The mode of a request comes from the API key it is signed with: a test key runs in test mode and a live key in live mode.

https://afropin.com/api/v1

Every object the API returns carries a mode field, so you can always tell which mode it belongs to.

test
For building and running your UAT. Works as soon as you create a test key, before your business is verified. Uses your test wallets, so no real money moves.
live
Real PINs and real balances. Live keys only work once your business KYC is approved and live API access has been switched on for your account.

Keys and webhooks per mode

Your dashboard has a test/live switch. API keys and webhooks are created in the mode the dashboard is in at that moment, and only work in that mode.

  • A webhook_id from the other mode is rejected with invalid_webhook_id.
  • Requests that take an ID, such as pin_id or store_id, only find objects created in the same mode.
  • Signing, headers and error codes are identical in both modes.
A live key used before live access is granted fails with invalid_api_key (401), the same as an unknown key. If your live key is rejected, check that your KYC is approved and that live access has been granted.

Test PINs for redemption

In test mode, redemption only accepts the fixed test PINs below; real PIN codes are rejected with test_pin_unknown. Each one triggers a different outcome, so you can try every branch of your checkout. Their balances never change: you can redeem the same PIN as often as you like.

PIN code Balance Status Redemption New code after redemption
2340-1000-0000-1001 25000 NGN active Partial or full Yes
2340-1000-0000-2002 0 NGN active Partial or full Yes
2340-1000-0000-3003 7500 NGN expired Partial or full Yes
2340-1000-0000-4004 12000 NGN disabled Partial or full Yes
2340-1000-0000-5005 15000 NGN active Full balance only Yes
2340-1000-0000-6006 5000 NGN active Full balance only No
  • Test PINs are in NGN, so your account needs an NGN test wallet; otherwise redemption fails with currency_not_supported.
  • Test redemptions return transaction_ref: null.
  • An external_reference can still only be used once, in test mode too.

Going live

  1. Pass the Go-live checklist

    Run every case in Go-live checklist with your test key and keep the requests and responses.

  2. Get your business verified

    Live keys only work once your KYC is approved.

  3. Ask for live access

    Send your UAT results to support. Once live API access is switched on, switch your dashboard to live mode and create a live API key and live webhook.

  4. Swap the keys

    Replace the test key ID, secret and webhook IDs in your configuration. No other change is needed.