Search routes

Search major documentation and API reference routes.

Developer Tools

Callback Testing

Use a mock endpoint service to test callback delivery and inspect sample callback payloads before wiring your real backend.

Mock API Endpoint

A mock endpoint is useful when you want to confirm callback delivery before your local or production callback handler is ready.

What this helps you verify

You can confirm that AfroPays sends the callback, inspect the request body, and compare the delivered status with the transaction state you expect.

Testing Steps

  1. 1

    Create a MockAPI Project

    Open https://mockapi.io and create a project for callback testing.

  2. 2

    Create a callbacks Resource

    Inside the project, create a resource such as callbacks so incoming requests can be stored and inspected.

    Add fields like reference, status, amount, currency, provider, and merchantOrderId if you want the records to be easy to read in the dashboard.

  3. 3

    Copy the Resource POST Endpoint

    Copy the resource endpoint generated by MockAPI and use it as your callbackUrl in a sandbox transaction request.

  4. 4

    Trigger a Sandbox Payment

    Create a test payment from AfroPays using the MockAPI resource URL as the callback destination.

  5. 5

    Inspect the Callback Records

    Open the MockAPI resource entries to verify which callbacks were received, what payload was posted, and which statuses were delivered.

https://<your-project>.mockapi.io/api/v1/callbacks

What to Verify

  • • The callback reached the endpoint without network errors.
  • • The reference and merchant order id match the transaction you created.
  • • The status sequence makes sense for the transaction lifecycle.
  • • Final statuses such as SUCCESS and CANCELED are treated as terminal in your system.