Core concepts
Webhooks
Aboki Data sends an HTTPS POST to your endpoint when an order reaches a final status or your wallet is funded, so you do not have to poll.
Set up an endpoint
- Create a public HTTPS endpoint that accepts
POSTrequests with a JSON body. - In Developer settings in the app, enter its URL and copy your webhook signing secret (
whsec_…). The secret is shown in full only when it is created or rotated, and it signs test and live events alike. - Developer settings has a Test / Live mode switch, and each mode has its own webhook URL. Test orders go to the test URL; until you set one, they go to the live URL.
- Use Send test webhook to receive a signed sample event at the URL of the mode you are in (or a URL you type in). It is an
order.successby default; chooseorder.failedto receive aFAILED_REFUNDEDsample instead. No order exists for it, so it always carriesis_test: true.
{
"event": "order.success",
"timestamp": "2026-10-17T12:00:03.512Z",
"is_test": true,
"data": {
"order_id": "0199f2a4-6c1e-7b3a-9d42-5e8f1a2b3c50",
"order_ref": "VTU-TEST-WEBHOOK",
"reference": "test_ref_1760702403512",
"status": "SUCCESS_SETTLED",
"recipient": "+2348030000000",
"face_value_kobo": 10000,
"amount_debited_kobo": 9800,
"provider_reference": "MOCK-PROVIDER-REF",
"is_test": true,
"created_at": "2026-10-17T12:00:03.512Z",
"updated_at": "2026-10-17T12:00:03.512Z"
}
}You can also pass a callback_url on an individual purchase. Events for that order go to that URL instead of your account's webhook URL, signed the same way.
Events
| Event | Sent when |
|---|---|
| order.success | An order reaches SUCCESS_SETTLED. |
| order.failed | An order fails. data.status is FAILED_UNRESERVED, or FAILED_REFUNDED when it failed after a pending period and the reserved amount was returned. |
| order.refunded | Aboki Data refunds an order after review, for example one that was reported as not delivered. data.status is FAILED_REFUNDED. |
| wallet.funded | A bank transfer to your account number is credited. Live mode only; sent to the account webhook URL. |
Events are sent for every order on your account that reaches these states, including orders placed in the Aboki Data app. Use is_test and your reference to match them to your records. New event types may be added; answer 200 to events you do not handle so they are not retried.
Headers
| Header | Value |
|---|---|
| X-Aboki-Signature | Hex HMAC-SHA256 signature (see below) |
| X-Aboki-Timestamp | Unix time in seconds when this attempt was signed (new on every attempt) |
| X-Aboki-Event | Event type, e.g. order.success |
| X-Aboki-Delivery-Id | ID of this delivery, the same on every retry; use it to ignore duplicates |
| User-Agent | Aboki-Webhook/1.0 |
Order event payload
{
"event": "order.success",
"timestamp": "2026-10-17T12:00:03.512Z",
"is_test": false,
"data": {
"order_id": "0199f2a4-6c1e-7b3a-9d42-5e8f1a2b3c4e",
"order_ref": "VTU-20261017-5D6E7F8A9B0C",
"reference": "your-order-1045",
"status": "SUCCESS_SETTLED",
"recipient": "45012345670",
"face_value_kobo": 100000,
"amount_debited_kobo": 99000,
"provider_reference": "PRV-77612390",
"token": "1234-5678-9012-3456-7890",
"is_test": false,
"created_at": "2026-10-17T12:00:00.000Z",
"updated_at": "2026-10-17T12:00:02.140Z"
}
}token, units, provider_reference and failure_reason are included when they apply; failure_reason is the same plain-language text as on the order, safe to show your customer. data.reference is your reference, or null if you did not send one. timestamp is an ISO 8601 string and amounts are whole kobo (₦1 = 100 kobo) in fields ending _kobo.
Wallet event payload
{
"event": "wallet.funded",
"timestamp": "2026-10-17T09:12:03.210Z",
"is_test": false,
"data": {
"deposit_reference": "DEP-20261017-7C1A9E3B5D2F",
"gateway_reference": "BST-92011873",
"gross_amount_kobo": 5000000,
"fee_amount_kobo": 5000,
"net_amount_credited_kobo": 4995000,
"new_available_balance_kobo": 16243050,
"currency": "NGN",
"timestamp": "2026-10-17T09:12:03.198Z"
}
}Verify signatures
Every delivery is signed with your webhook secret. Compute an HMAC-SHA256 of the timestamp, a full stop, and the raw request body, hex-encode it, and compare it with X-Aboki-Signature using a constant-time comparison:
signature = hex( HMAC_SHA256( secret, "<X-Aboki-Timestamp>.<raw body>" ) )Reject deliveries whose signature does not match, and ones whose timestamp is more than a few minutes old, which protects you against replayed requests.
import crypto from "node:crypto";
import express from "express";
const app = express();
const SECRET = process.env.ABOKI_WEBHOOK_SECRET; // whsec_...
// Use the raw body: re-serialised JSON will not match the signature.
app.post("/webhooks/aboki", express.raw({ type: "application/json" }), (req, res) => {
const timestamp = req.get("X-Aboki-Timestamp") ?? "";
const signature = req.get("X-Aboki-Signature") ?? "";
const expected = crypto
.createHmac("sha256", SECRET)
.update(`${timestamp}.${req.body}`)
.digest("hex");
const valid =
signature.length === expected.length &&
crypto.timingSafeEqual(Buffer.from(signature), Buffer.from(expected));
const fresh = Math.abs(Date.now() / 1000 - Number(timestamp)) < 300;
if (!valid || !fresh) return res.sendStatus(400);
const event = JSON.parse(req.body);
// Record X-Aboki-Delivery-Id and skip it if you have seen it before.
queueForProcessing(req.get("X-Aboki-Delivery-Id"), event);
res.sendStatus(200);
});Responses, retries and replays
- Any
2xxresponse within 10 seconds counts as delivered. - Otherwise Aboki Data tries again up to 4 more times, waiting about 30 seconds, 2 minutes, 10 minutes and 1 hour between attempts (5 attempts in total; each can be up to 30 seconds later than scheduled).
- The first attempt can arrive before or after the API response to the purchase.
- Recent deliveries, their status and response codes are listed in Developer settings (per mode), where you can replay any of them. A replay is a single attempt.
Process each event once
Retries and replays mean you can receive the same event more than once, and events can arrive out of order. Store X-Aboki-Delivery-Id (or the order ID and status) and skip work you have already done. Respond quickly and do slow work in a background job. In rare cases Aboki Data corrects an order after review, so accept a later event for an order you already treated as final.
A webhook tells you something changed. If you ever doubt one, confirm the order with GET /vtu/orders/{id}.