OnLink
Webhooks

Webhooks

We POST a signed event to your endpoint when money lands in your KES or USD account (USD credits usually include a collection payout, a deposit into your own USD account and the USD a failed USD to KES conversion returns; KES credits usually include the KES a failed KES to USD conversion returns), or when an order, a transfer, a USDT send, a collection or a conversion confirms funds or reaches a terminal state, or when you create, change or close a customer or a customer's identity check changes state, or when one of a customer's accounts opens or cannot be opened, or when a payment for a customer is credited or held for review, or when OnLink needs more documents for a business customer (remittance partners), or when a deposit is returned to the payer before it was credited. Thirty events, seven attempts, one idempotency key.

Money arrives without you asking, and an order changes state after the call that created it — so the completion signal has to reach you rather than be returned to you. Webhooks are that signal: we POST a signed JSON body to an HTTPS endpoint you give us.

Polling GET /v1/orders/{id} still works and still terminates. Use webhooks as the primary signal and polling as the fallback. An inbound credit is the one thing you cannot poll for, because you do not know its identifier until we tell you.

Registering your endpoint

The owner of your verified business sets the endpoint themselves, under Settings → Developers in the OnLink app. There is no API call for it, and you do not choose which events you receive: you receive every event your account can produce, up to thirty. Two things narrow that. confirmation.code_issued is sent only while your account is on webhook delivery, which is the default; an account moved to contact delivery never sees it — see Auto-confirm instructions. And the eight customer events (customer.created, customer.updated, customer.kyc.updated, customer.account.updated, customer.kyb.documents_requested, customer.deposit.received, customer.deposit.held and customer.deposit.refunded), and the four events of money moved for customers (internal_transfer.completed, internal_transfer.failed, customer.transfer.updated and customer.conversion.updated), are produced only for remittance partners.

From that page you can:

  • Set your webhook URL. Enter the HTTPS URL you want deliveries on and save. Saving asks you to confirm it is you with an authenticator app or a passkey; a code sent by SMS or email is not accepted here, so set one up under Settings → Security first. If you change the URL later, deliveries after the change go to the new one.
  • Get your signing secret. The first time you save a URL, we generate the signing secret you will verify with and show it to you once, on that screen. Copy it into your secrets store before you leave the page: we cannot show it again. Saving a different URL afterwards keeps the same secret. If a secret was already set for your account, the page says so instead of showing one.
  • Send a test event. See The test event below.
  • Read your delivery log and resend. The page lists your most recent deliveries with their status, the number of attempts and the last status code or error we got from your endpoint. A delivery that has failed can be sent again from there.

Replacing or removing a signing secret is not something you can do on that page. If you need to rotate it — a secret that leaked, for example — contact OnLink support and say so; rotating it makes the old secret stop verifying at once, so agree a moment to switch your verifier over.

If your OnLink partner account is suspended, you can still read the page but cannot change anything on it.

If the page says developer settings aren't available, or the person who owns your business cannot sign in to set it up, contact OnLink support: we can set your endpoint for you and send you the signing secret.

Your endpoint must:

  • be HTTPS and publicly reachable, on a hostname that resolves to a public address (we check the address before every delivery and do not send to a private or internal one);
  • answer within 10 seconds — that is the per-attempt timeout;
  • return any 2xx status to acknowledge. Anything else is a failed attempt;
  • not redirect. We never follow redirects, so a 301 or 302 is a failure, not a hop.

There is no IP allowlist to configure

Deliveries are authenticated by signature, not by source address. We do not publish a fixed set of egress addresses, so do not build a firewall rule around one — verify the signature instead.

The thirty events

Four belong to orders (buying or selling USDT). Fourteen belong to the ledger family: money landing in your KES or USD account, transfers out of your accounts, USDT leaving and arriving in your wallet, a collections contribution or a payment into your own USD account being paid out to you (or returned to the payer instead: collection.refunded and deposit.refunded), a conversion between USD and KES completing or failing, and the confirmation code that authorises value leaving — both the code itself and the news that it expired. Eight belong to customers, for remittance partners: a customer you created (customer.created), changed or closed (customer.updated), whose identity check changed state (customer.kyc.updated), one of whose accounts opened or could not be opened (customer.account.updated), or for whose business OnLink needs more documents (customer.kyb.documents_requested), and a payment for a customer that was credited (customer.deposit.received), held for review (customer.deposit.held) or returned to the payer (customer.deposit.refunded). The first five move no money; the last three report it. Two more belong to money you move between your own account and your customers' (internal_transfer.completed and internal_transfer.failed), one to a payout out of a customer's account (customer.transfer.updated), and one to a conversion of a customer's balance (customer.conversion.updated).

The order events

EventWhen it firesTerminal
order.funds_confirmedThe money behind this order is confirmed in hand.No
order.settledThe order completed. USDT sent, or KES paid out.Yes
order.rejectedThe order will not complete. Sell: your USDT is with us; talk to us. Buy: kesDebit.status on the order says what happened to your KES.Yes
order.expiredThe order was never funded and its window closed.Yes

Both legs use the same four. On a sell order order.funds_confirmed means your USDT deposit was matched; on a buy order it means the bank confirmed the KES debit taken from your own balance for this order — sent once, while the order is still funds_reserved. That is deliberate: you write one handler for "my money landed" without caring which leg's internal status carried it.

Not every status change sends an event

Statuses between funds-confirmed and terminal do not produce webhooks, and there is no order-created event — creation is synchronous, so you already have the 202 response. An order can therefore sit quietly for a while between order.funds_confirmed and its terminal event. That is expected, not a missed delivery.

The ledger events

These cover money arriving in your KES or USD account — including the USD of a collection payout, a deposit into your own USD account and the money a failed conversion returns — POST /v1/transfers, POST /v1/usdt/sends, POST /v1/conversions, and the confirmation code transfers and sends issue — see Send money from your KES account for the transfer flow and, in particular, for what a transfer.failed event does and does not mean.

EventWhen it firesTerminal
credit.receivedMoney landed in one of your accounts and cleared.Yes
transfer.settledThe bank completed the transfer.Yes
transfer.failedThe bank answered and refused the transfer. Value never moved.Yes
usdt_send.settledYour USDT send completed on chain.Yes
usdt_send.failedThe USDT send did not go out. Your balance is unchanged.Yes
usdt_credit.receivedWhere we hold your USDT, sent when it is credited to your balance; an arrival held for review is not announced. Where it is in your own wallet, sent when USDT arrives in that wallet.Yes
collection.receivedA collections contribution was paid out, net of fee, to your USD account. Sent when the collection becomes credited. No further event follows, but the collection can later read refunded, and no event is sent for that.No
collection.refundedThe deposit for a collection was returned to the payer before it was credited. Nothing is credited. Sent once per collection.Yes
deposit.receivedA payment into your own USD account was paid out, net of fee, to your USD balance. Sent when the deposit is credited. A payment held for review is not announced unless it is released.Yes
deposit.refundedA payment into your own USD account was returned to the payer before it was credited. Nothing is credited. Sent once per deposit.Yes
conversion.settledA conversion completed: the money you converted to is in your account in that currency (KES for USD to KES, USD for KES to USD).Yes
conversion.failedA conversion will not complete. Any money it took from your account has been returned.Yes
confirmation.code_issuedA confirmation code was issued for an instruction you created. Sent on webhook delivery, the default (not on contact delivery). Not retried after about 35 seconds and never redelivered — if you miss it, call POST /v1/confirmations/{id}/resend.No
confirmation.expiredThe confirmation code's window passed before anyone confirmed it.Yes

usdt_send.* is keyed on the send, not on an order — a send is not a swap, so it carries no quote and no fiat leg. A usdt_send.failed for a send that failed before anything was sent means value never left: if we had already debited your USDT ledger balance, we return that debit, so your balance goes back to what it was before the send. The return normally lands before this event reaches you; if your balance still looks short when you read it, read it again shortly, and contact us with the send id if it stays short. For any other failure, read failureReason and contact us with the send id before you treat the balance as settled. usdt_credit.received is the inbound mirror and, like credit.received, is not tied to any instruction of yours.

transfer.settled and transfer.failed carry a different body from the order family:

{
  "id": "5b2e9f14-0000-4000-8000-000000000040",
  "type": "transfer.settled",
  "createdAt": "2026-09-11T00:05:00.000Z",
  "data": {
    "transferId": "bd9f1e6a-0000-4000-8000-000000000010",
    "partnerReference": "ACME-TRF-000123",
    "rail": "mpesa",
    "status": "settled",
    "amount": { "currency": "KES", "value": "1500.00" },
    "fee": { "currency": "KES", "value": "10.00" },
    "destinationAccountNumber": "254700000000",
    "failureCode": null,
    "settledAt": "2026-09-11T00:05:00.000Z"
  }
}

On transfer.failed, settledAt is null and failureCode names why — see Errors for the catalogue.

confirmation.expired is keyed on the confirmation, not the transfer — its subjectId is the confirmation id, not the transfer id, because the event is reporting what happened to the code, and a confirmation can in principle authorise something other than a transfer in future:

{
  "id": "6c3fa025-0000-4000-8000-000000000050",
  "type": "confirmation.expired",
  "createdAt": "2026-09-11T00:05:00.000Z",
  "data": {
    "confirmationId": "df9f1e6a-0000-4000-8000-000000000030",
    "subjectType": "transfer",
    "subjectId": "bd9f1e6a-0000-4000-8000-000000000010",
    "expiredAt": "2026-09-11T00:05:00.000Z"
  }
}

Read subjectId to find the transfer this expiry was about — it now reads expired on GET /v1/transfers/{id}. The same event fires for a send whose code expired, with subjectType: "usdt_send" and subjectId naming the send.

confirmation.code_issued

The one event that carries a live secret: the 6-digit code that authorises an instruction you created. Webhook delivery is the default: it is sent whenever your account is on webhook delivery, and a create that needs a code is refused 409 CONFIRMATION_WEBHOOK_NOT_CONFIGURED until you have a working webhook. Only an account OnLink has moved to contact delivery gets its code at the registered confirmation contact instead and never sees this event. See Auto-confirm instructions for how to use it.

{
  "id": "4a2d7e91-0000-4000-8000-000000000045",
  "type": "confirmation.code_issued",
  "createdAt": "2026-09-11T00:00:00.412Z",
  "data": {
    "confirmationId": "df9f1e6a-0000-4000-8000-000000000030",
    "subjectType": "transfer",
    "subjectId": "bd9f1e6a-0000-4000-8000-000000000010",
    "idempotencyKey": "trf-2026-09-11-000123",
    "partnerReference": "ACME-TRF-000123",
    "amount": { "currency": "KES", "value": "1500.00" },
    "code": "482913",
    "expiresAt": "2026-09-11T00:05:00.000Z"
  }
}
  • confirmationId is what you post the code to: POST /v1/confirmations/{confirmationId}.
  • subjectType is transfer, usdt_send or batch, and subjectId is that instruction's id. For a batch, partnerReference is null.
  • idempotencyKey and partnerReference are yours — the values you sent when you created the instruction. Use them, with subjectType, to find the instruction this code belongs to: transfers, sends and batches keep separate idempotency key spaces. You know the key before you create the instruction, and the first push can reach you before the create response does.
  • amount is the amount the code authorises, always in the fixed number of decimal places for its currency — KES 2, USD 2, USDT 6 — whatever form you sent. Compare it in minor units, not as a string. For a transfer it is the transfer's amount without its fee. For a batch it is the sum of each accepted item's amount plus its fee. The batch's create response lists which items were accepted but carries no amounts or fees, so read each accepted item's fee from GET /v1/transfers/{transferId} and add it to the amount you submitted.
  • code is a string, because a code can begin with zeros. It is valid until expiresAt, which is 5 minutes after it was issued, and five wrong attempts lock the confirmation.

This event is never stored and never retried later. We make up to three attempts, all over within about 35 seconds, and each attempt gives your endpoint 5 seconds to answer, not the usual 10. Then we stop. We keep no copy of the code, so there is nothing to redeliver. If you did not receive it, call POST /v1/confirmations/{id}/resend: that issues a new code under a new X-OnLink-Delivery id, and the code you missed stops working. A retry within one push reuses the delivery id; a resend does not, so do not treat a new id as a duplicate of the old one.

usdt_send.settled / usdt_send.failed

Keyed on the send, not on an order — a send is not a swap, so it carries no quote and no fiat leg:

{
  "id": "8e5bc247-0000-4000-8000-000000000070",
  "type": "usdt_send.settled",
  "createdAt": "2026-09-16T00:05:00.000Z",
  "data": {
    "sendId": "ed9f1e6a-0000-4000-8000-000000000040",
    "partnerReference": "ACME-SEND-000123",
    "status": "settled",
    "amount": { "currency": "USDT", "value": "25.500000" },
    "destinationWalletId": "fa9f1e6a-0000-4000-8000-000000000050",
    "failureReason": null
  }
}

On usdt_send.failed, status reads "failed" and failureReason names why — see Errors for the catalogue. If the send failed before anything was sent and we had already debited your USDT ledger balance for it, we return that debit, so your balance goes back to what it was before the send. For any other failure, contact us with the send id.

destinationWalletId is the wallet you registered at create time, not new information — and, deliberately, there is no provider or custody identifier anywhere in this body: which custody wallet the USDT actually moved from is an internal detail invisible to you (the partner-facing record always names your own wallet as the origin, whichever one it actually left from).

usdt_credit.received

Where we hold your USDT for you (custody: "onlink_managed"), sent when the USDT is credited to your balance; an arrival held for review is not announced. Where your USDT is in your own wallet (custody: "partner_customer"), sent when USDT arrives in that wallet; nothing is credited to a balance with us. Like credit.received, this is not tied to any instruction of yours — it is the inbound mirror, keyed on the underlying on-chain activity rather than an order or a transaction reference:

{
  "id": "9f6cd358-0000-4000-8000-000000000080",
  "type": "usdt_credit.received",
  "createdAt": "2026-09-16T10:32:04.118Z",
  "data": {
    "activityId": "f7580ae0-05f8-4102-a1cf-9a6bd79fde4f",
    "amount": { "currency": "USDT", "value": "100.000000" },
    "receivedAt": "2026-09-16T10:32:01.000Z"
  }
}
  • activityId is the subject this delivery is anchored on — the only handle you have to correlate this event with anything else, since there is deliberately no order and no transaction hash in this body.
  • receivedAt is when the USDT landed on chain; createdAt is when we sent the event. On a redelivered or reconciled event they can be far apart — reconcile on receivedAt.

No sender identity travels in this event

There is no sending address, no chain, and no counterparty information in data — the same reasoning credit.received excludes a payer's identity.

credit.received

Somebody paid you. This fires once per cleared inbound credit on one of your accounts, whoever sent it and whichever rail it came in on — a Pay Bill payment or a bank transfer into your KES account, and a collection payout into your USD account. It is the only event whose subject you have never seen before it arrives, so there is no identifier for you to have polled. In rare cases — when we learn of a credit through our own reconciliation rather than the bank's notification — no credit.received is sent for it, so reconcile against GET /v1/balances periodically.

A conversion moves money into your accounts too: the currency it converts to, paid into your account in that currency, and, when one fails after taking your money, what it returns to your account in the currency it took. Each of those usually also produces a credit.received, but not always, so do not rely on it. Count a conversion once, on conversion.settled's target. Never count a credit.received for a conversion's funds, and never count money a conversion returned as income: it is your own money coming back.

{
  "id": "7d4ab136-0000-4000-8000-000000000060",
  "type": "credit.received",
  "createdAt": "2026-09-14T10:32:04.118Z",
  "data": {
    "transactionId": "e1c2d3f4-0000-4000-8000-000000000020",
    "accountId": "a7b8c9d0-0000-4000-8000-000000000001",
    "accountNumber": "00000000123456",
    "amount": { "currency": "KES", "value": "1500.00" },
    "rail": "mpesa",
    "reference": "SBX0EXAMPLE",
    "receivedAt": "2026-09-14T10:32:01.000Z"
  }
}
  • transactionId is the subject, and your idempotency anchor for the credit itself: exactly one credit.received is ever enqueued per transaction.
  • accountNumber says which of your accounts was credited. Match it against the accountNumber on GET /v1/balances — that is the identifier the balances read returns for an account. You hold one account per currency today, so amount.currency narrows it as well, but a business can hold more than one account in a currency, and "money arrived somewhere of yours" is not reconcilable.
  • accountId is our own identifier for the same account. GET /v1/balances does not return it, so there is nothing to match it against; match on accountNumber.
  • reference is the code the payer's own rail generated — the M-PESA transaction code, or the PesaLink/RTGS/EFT/SWIFT bank reference. It is what lets you attribute the credit to the customer who sent it. It is null when the credit carried none, and two customers paying the same amount are then indistinguishable — so a null reference is a credit your own reconciliation has to attribute some other way.
  • receivedAt is when the money landed. createdAt is when we sent the event. They are not the same instant, and on a redelivered or reconciled event they can be far apart — reconcile on receivedAt.

No payer identity travels in this event

There is no payer name, phone number, bank account number or narration in data, and there will not be: it is somebody else's personal data and it is not ours to publish. The one account number in data is your own, accountNumber. reference is a rail-generated code, and it is the whole of what we can tell you about who paid.

collection.received

A contribution to one of your collections was paid out, net of fee, to your USD account. It fires once per collection, when the collection becomes credited — not when the deposit first arrives, so received on the collection comes earlier than this event. It is keyed on the collection, and it carries the same envelope as every other ledger event:

{
  "id": "a07de469-0000-4000-8000-000000000090",
  "type": "collection.received",
  "createdAt": "2026-10-13T10:32:04.118Z",
  "data": {
    "collectionId": "a1b2c3d4-0000-4000-8000-000000000001",
    "reference": "DEMO-7K3Q2M",
    "gross": "100.00",
    "fee": "1.50",
    "net": "98.50",
    "currency": "USD",
    "senderName": "Jane Contributor",
    "treasuryCreditTxId": "UTRANS0000000000000000000000"
  }
}
  • collectionId is the subject, and your idempotency anchor for the credit itself: it matches id on GET /v1/collections/{id}.
  • reference is the code we minted when you opened the collection. It is not your own partnerReference, and it is not the depositMessage your contributor quoted.
  • gross is what the contributor sent, fee is what we deducted, and net is gross less fee — the amount actually paid into your account. Reconcile against net. All three are decimal strings in currency, never numbers.
  • senderName is the contributor's name as the deposit reported it, or null when the deposit carried none.
  • treasuryCreditTxId is the identifier of the payout into your account. Quote it if you ever need to ask us about this specific payout.

A cleared collection credit can also produce a credit.received for the same funds on your USD account. Count those funds once, on collection.received's net.

No sender bank details travel in this event

There is no sending bank, routing number or account number in data, and no stablecoin symbol, chain, wallet address or FX rate — a collection is reported in cash terms only.

collection.refunded

The deposit for one of your collections was returned to the payer, and nothing will be credited for it: the collection now reads refunded. It fires once per collection, as soon as OnLink learns the deposit was returned, and it is keyed on the collection:

{
  "id": "a07de469-0000-4000-8000-000000000092",
  "type": "collection.refunded",
  "createdAt": "2026-11-25T10:32:04.118Z",
  "data": {
    "collectionId": "a1b2c3d4-0000-4000-8000-000000000001",
    "reference": "DEMO-7K3Q2M",
    "amount": "100.00",
    "currency": "USD",
    "refundedAt": "2026-11-25T10:30:12.000Z",
    "reason": "returned_by_bank_after_review"
  }
}
  • collectionId is the subject, and your idempotency anchor: it matches id on GET /v1/collections/{id}.
  • reference is the code we minted when you opened the collection.
  • amount is what the payer sent and what was returned to them, a decimal string in currency. There is no fee: you were never paid.
  • refundedAt is when the return was recorded, ISO 8601 UTC.
  • reason is always returned_by_bank_after_review. It says the money went back, not why, and no further detail about the return is available to you.

A collection reads received while OnLink checks the deposit, and nothing is paid into your account until that check is done: allow a few minutes, and longer if the deposit is held for review. A deposit that was already credited is never announced by this event. If the payer's bank takes that money back after collection.received was sent, no event is sent: OnLink is alerted and contacts you.

deposit.received

A payment into your own OnLink USD account was paid out, net of fee, to your USD balance. It applies once OnLink has set up a USD account of your own for you: a payment into that account is announced as deposit.received, never as collection.received. It fires once per deposit, when the deposit is credited — not when the payment first arrives. It is keyed on the deposit, and it carries the same envelope as every other ledger event:

{
  "id": "a07de469-0000-4000-8000-000000000091",
  "type": "deposit.received",
  "createdAt": "2026-11-11T10:32:04.118Z",
  "data": {
    "depositId": "a1b2c3d4-0000-4000-8000-000000000002",
    "reference": "DEMO-4F8N1R",
    "gross": "1000.00",
    "fee": "10.00",
    "net": "990.00",
    "currency": "USD",
    "paymentRail": "wire",
    "senderName": "Jane Contributor",
    "payerMessage": "Invoice 4471",
    "bankTransactionId": "SBX0000000001",
    "treasuryCreditTxId": "UTRANS0000000000000000000001"
  }
}
  • depositId is the subject, and your idempotency anchor for the credit itself. Quote it if you ever need to ask us about this deposit.
  • reference is the code OnLink minted for the deposit.
  • gross is what the payer sent, fee is what we deducted, and net is gross less fee — the amount actually paid into your account. Reconcile against net. All three are decimal strings in currency, never numbers.
  • paymentRail is how the payment arrived: exactly one of ach_push, fednow or wire. It is null when the payer's bank did not say, or said something outside those three.
  • senderName is the payer's name as the payment reported it, or null when it carried none.
  • payerMessage is the payer's own text on the transfer, exactly as they wrote it. It may be absent: when the payer wrote nothing it is null. It is the payer's text, not ours, so treat it as untrusted input — never render it as HTML and never use it to decide anything about money.
  • bankTransactionId is the wire's bank reference — what the payer can quote to their bank to trace a wire. It is set for a wire and null for ACH and FedNow, which carry no such reference. Do not require it.
  • treasuryCreditTxId is the identifier of the payout into your account. Quote it if you ever need to ask us about this specific payout.

A payment that arrives, or is still waiting to be credited, while your account is suspended or closed is held for review by OnLink: nothing is paid to your balance and no event is sent for it. If OnLink releases it, it is credited and deposit.received is sent then, once; if OnLink returns it to the payer itself instead, no event is sent. A payment the payer's bank returns is announced by deposit.refunded.

A cleared deposit credit can also produce a credit.received for the same funds on your USD account. Count those funds once, on deposit.received's net.

No sender bank details travel in this event

There is no sending bank, routing number, account number or address in data, and no stablecoin symbol, chain, wallet address or FX rate — a deposit is reported in cash terms only.

deposit.refunded

A payment into your own OnLink USD account was returned to the payer, and nothing will be credited for it. It fires once per deposit, as soon as OnLink learns the payment was returned, and it is keyed on the deposit:

{
  "id": "a07de469-0000-4000-8000-000000000093",
  "type": "deposit.refunded",
  "createdAt": "2026-11-25T10:32:04.118Z",
  "data": {
    "depositId": "a1b2c3d4-0000-4000-8000-000000000002",
    "reference": "DEMO-4F8N1R",
    "amount": "1000.00",
    "currency": "USD",
    "refundedAt": "2026-11-25T10:30:12.000Z",
    "reason": "returned_by_bank_after_review"
  }
}
  • depositId is the subject, and your idempotency anchor. It is the same depositId a deposit.received would have carried.
  • reference is the code OnLink minted for the deposit.
  • amount is what the payer sent and what was returned to them, a decimal string in currency. There is no fee: you were never paid.
  • refundedAt is when the return was recorded, ISO 8601 UTC.
  • reason is always returned_by_bank_after_review. It says the money went back, not why.

A deposit that was already credited is never announced by this event. If the payer's bank takes that money back after deposit.received was sent, no event is sent: OnLink is alerted and contacts you.

conversion.settled

A conversion you created with POST /v1/conversions completed: the from amount left your account in that currency and the to amount landed in your account in that currency. It fires once per conversion and is terminal. This is a USD to KES conversion:

{
  "id": "c41e2a90-0000-4000-8000-000000000100",
  "type": "conversion.settled",
  "createdAt": "2026-10-24T10:00:41.512Z",
  "data": {
    "conversionId": "c0a8012e-7b1a-4c39-9d3e-2f5c8a1b6d40",
    "from": "USD",
    "to": "KES",
    "rate": "128.35",
    "source": "100.00",
    "target": "12835.00"
  }
}
  • conversionId matches id on GET /v1/conversions/{id}.
  • from and to are the currencies you converted from and to, as you sent them when you created the conversion.
  • rate is always the KES per 1 USD the conversion was made at. source is the amount debited, in the from currency, and target the amount credited, in the to currency. All three are decimal strings, never numbers.
  • Going from USD to KES, rate is what you were paid per USD and target is source × rate, rounded down to the cent. Going from KES to USD, rate is what you paid per USD and target is source ÷ rate, rounded down to the cent.

The money landing in your account usually also produces a credit.received for the same funds, close to conversion.settled and in either order, but not always: do not rely on it. When it arrives it carries no conversion id. Count a conversion once, on conversion.settled's target, and never add a credit.received for the same money to your income on top.

conversion.failed

The conversion will not complete. It fires once and is terminal:

{
  "id": "c41e2a90-0000-4000-8000-000000000101",
  "type": "conversion.failed",
  "createdAt": "2026-10-24T10:03:12.004Z",
  "data": {
    "conversionId": "c0a8012e-7b1a-4c39-9d3e-2f5c8a1b6d41",
    "from": "USD",
    "to": "KES",
    "reason": "fx_unavailable"
  }
}

reason is one of insufficient_balance and debit_refused (your money was never taken), or fx_unavailable, provider_otp_not_received and rate_moved_beyond_tolerance (your money was taken and has been returned to your account in the from currency before this event fires). Nothing was credited in the to currency in any case, and you can create a new conversion.

When your money was returned, that return usually also produces a credit.received in the from currency on that account, but not always: do not rely on it. It is your own money coming back, not new income: never count what a failed conversion returned as a deposit, whether or not a credit.received arrives for it. A failed conversion changes nothing about your position: your balance in the from currency is what it was before.

The customer events

Five events, for remittance partners only. None of them moves money.

EventWhen it firesTerminal
customer.createdYou created a customer.No
customer.updatedYou changed or closed a customer.No
customer.kyc.updatedA customer's identity check changed state, or one of their currencies became usable (or stopped being). One event per change. rejected is final; verified is not the last event, so keep listening after it.No
customer.account.updatedOne of a customer's accounts opened, or could not be opened. One event per account.Yes
customer.kyb.documents_requestedOnLink needs more documents to finish reviewing a business customer. One event per request.No

customer.created and customer.updated

Sent to remittance partners when a customer is created (customer.created) and each time one is changed or closed (customer.updated). Closing a customer is a change: it arrives as customer.updated with data.status closed. Neither is terminal and neither says anything about money.

Both use the envelope above. data is the customer exactly as GET /v1/customers/{id} returns it:

{
  "id": "d3f1b6a2-0000-4000-8000-0000000000d1",
  "type": "customer.updated",
  "createdAt": "2026-11-17T10:00:05.000Z",
  "data": {
    "id": "c0a8012e-7b1a-4c39-9d3e-2f5c8a1b6d40",
    "type": "individual",
    "status": "pending_kyc",
    "externalRef": "cust-001",
    "displayName": "Amina Wanjiru",
    "email": "amina@example.com",
    "phone": "+254700000001",
    "countryOfResidence": "KE",
    "legalName": null,
    "createdAt": "2026-11-17T10:00:00.000Z",
    "updatedAt": "2026-11-17T10:00:05.000Z",
    "closedAt": null
  }
}
  • The envelope id is the delivery id, the same value as the X-OnLink-Delivery header, and is new for every change. Deduplicate on it, as for every other event. The envelope type is the event, and createdAt is when the change was made.
  • data.id is the customer's id, and data.type is the customer's own type (individual or business), not the event.
  • data is the customer after the change. It does not say which fields changed: compare it with what you stored.
  • Nothing else is in it: no verification or provider reference, and nothing about how OnLink holds the customer's money.

customer.kyc.updated

A customer you onboarded changed state in identity verification. It fires once per change, so a customer who is asked to resubmit and then approved produces several of them, each with its own id:

{
  "id": "d52f3b01-0000-4000-8000-000000000110",
  "type": "customer.kyc.updated",
  "createdAt": "2026-11-17T09:16:00.000Z",
  "data": {
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "externalRef": "your-customer-ref-7",
    "status": "needs_info",
    "previousStatus": "kyc_in_review",
    "reason": "document_unreadable",
    "nextAction": "Upload a clearer photo of the ID document: all four corners visible, no glare, no blur.",
    "termsAccepted": false,
    "endorsements": { "usd": null, "gbp": null, "eur": null }
  }
}
  • customerId is the customer's id with us; externalRef is your own reference for them, or null if you set none.
  • status is where the customer is now and previousStatus is where they were. Both are one of pending_kyc (created, nothing submitted yet), kyc_in_review (submitted, or the customer has accepted the terms and the accounts are being opened), needs_info, awaiting_terms, verified, rejected or suspended. needs_info means the customer can fix something and resubmit; rejected is final; awaiting_terms means identity is verified and the customer must accept the account terms; verified means the customer is fully set up; suspended means the customer is paused (a customer suspended with a null reason was paused by OnLink: contact us). status and previousStatus can be the same: that is how we tell you a currency became usable, or stopped being, for a customer who is already verified (read endorsements). Such an event can arrive any time after verified, so do not stop listening there.
  • reason says why the customer is held, and nextAction is the sentence to show them or act on. Both are null once nothing is outstanding. reason is one of document_unreadable, document_expired, document_unsupported, selfie_mismatch, data_mismatch, resubmission_requested, identity_rejected, awaiting_terms, finalising (everything is received and the accounts are being opened: no action is needed) or details_incomplete (the customer's address, tax number (Kenya and the US) or account-use answers are missing or were not accepted: have them complete those and resubmit). A business customer adds directors_pending (a director still has to verify), business_documents_required (a reviewer is checking the company: only a company registered outside Kenya must send its certificate of incorporation, and other documents are optional), business_details_incomplete (a company detail or a director's home address is missing) and business_rejected (final). A customer that was verified can arrive as suspended with provider_declined: account services for that customer have been stopped, money no longer moves for them, and a deposit to them is held. It stays suspended until we decide otherwise, so contact us. Each reason, and what to do about it, is in Manage your customers. When the rejected detail is one of the ID details (name, date of birth, ID number or the issuing country) the reason is data_mismatch instead, and when it is the ID photo it is document_unreadable, so the reason names what to correct.
  • termsAccepted is true once the customer has accepted the account terms.
  • endorsements shows, per currency, whether that account type is approved, pending or unavailable, or null before the customer's accounts have been opened. unavailable means the customer's country of residence cannot hold that account type (a customer who lives in Kenya, for example, never has a usd account), so do not wait for it. pending means it was requested and is not usable yet. A late or out-of-order update never takes an approved currency back to pending. The one thing that does move it is us withdrawing that account type from the customer: it then reads unavailable, and you get an update like any other change, so stop offering that currency to them.

A customer whose terms were accepted but could not be used to open their accounts goes back, in one event, from kyc_in_review to awaiting_terms: termsAccepted reads false again and reason is awaiting_terms. Their identity stays approved and is not asked for again, so send the terms link (POST /v1/customers/{id}/kyc/terms-link) and have them accept once more; that finishes opening the accounts. If a detail of the customer is also wrong, the event is needs_info with the reason for that detail instead, and termsAccepted is false there too: correct the detail and resubmit, then the customer accepts the terms again.

A customer becomes verified as soon as their accounts are opened, and the currencies are approved after that, one at a time. Each time a currency changes state you get another customer.kyc.updated with status and previousStatus the same (both verified) and the new endorsements. Read endorsements, not the status, to learn that a currency became usable.

Duplicate deliveries of the same review do not produce duplicate events: dedupe on id, as with every other event.

customer.account.updated

One part of a customer's account reached the end of opening: it is ready to use, or it could not be opened. It fires once per part: a customer who opens a KES account and a USD account produces one event for each balance account, and a USD account also produces a second event when its own US bank details are ready (see component below). A part that is reported ready or refused is never reported again.

{
  "id": "f1a9c6d2-0000-4000-8000-000000000120",
  "type": "customer.account.updated",
  "createdAt": "2026-11-18T08:30:00.000Z",
  "data": {
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "currency": "KES",
    "component": "balance_account",
    "status": "active",
    "reason": null
  }
}
  • customerId is the customer's id with us, and currency is the account's currency. The event carries no account number or other bank detail: read those from the customer's accounts.
  • component says which part of the account the event is about. balance_account is the customer's balance account in that currency: once it is active it is ready to use. named_account is the USD account's own US bank details, in the customer's name: once it is active they can be read from the customer's accounts. A USD account therefore produces both: a balance_account event, and a named_account event when the bank details are ready (which can be later, or never if the customer is not approved for them). A KES account produces only balance_account. Today a named_account event is only ever sent as active; if the bank details cannot be opened the customer's accounts still show the USD balance account without them.
  • status is active (ready to use) or failed (it was refused and nothing was opened). Both end that part's opening. A failed balance account is not retried for you: open the currency again.
  • reason is null for active. For failed it is a short code that says why; PROVIDER_REJECTED means the account could not be opened and opening it again is the remedy.

Dedupe on id, as with every other event. If you never receive the event for an account you asked for, the customer's accounts are the source of truth: read them.

customer.kyb.documents_requested

OnLink is reviewing one of your business customers and needs more documents before it can decide. You are the one who can reach the customer, so the request comes to you: message is written to you by the OnLink reviewer and says what is needed.

{
  "id": "c7e2a9b4-0000-4000-8000-000000000140",
  "type": "customer.kyb.documents_requested",
  "createdAt": "2026-11-19T08:30:00.000Z",
  "data": {
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "requestId": "d4b7e1f0-0000-4000-8000-000000000141",
    "message": "Please upload a proof of the company's registered address dated within the last three months.",
    "requestedAt": "2026-11-19T08:30:00.000Z"
  }
}
  • customerId is the customer's id with us. requestId identifies this request: quote it if you ask us about it.
  • message is the reviewer's request, as written. Pass on what it asks for, then upload the documents with POST /v1/customers/{id}/kyb/documents (see Manage your customers). It names what is needed in words; there is no separate list of document types.
  • requestedAt is when the reviewer asked. The envelope's createdAt is the same instant.

It fires once per request. A later request for the same customer is a new event with a new requestId, and it replaces the earlier one: act on the latest. The event does not change the customer's status, and nothing else is in it: no reviewer's name, no director's details. When the review moves on, customer.kyc.updated tells you, as for every other change.

The customer deposit events

Three events, for remittance partners only, about money that arrives for one of your customers: customer.deposit.received when it was credited to the customer's balance, customer.deposit.held when it was held for review, and customer.deposit.refunded when the payer's bank took it back before it was credited.

EventWhen it firesTerminal
customer.deposit.receivedA payment into a customer's account was credited to the customer's balance. Sent when the deposit is credited, not when the payment first arrives.Yes
customer.deposit.heldA payment for a customer arrived, or was about to be credited, and OnLink is holding it for review. Nothing was credited. One event per deposit.No
customer.deposit.refundedA payment for a customer was returned to the payer before it was credited. Nothing was credited to the customer's balance. One event per deposit.Yes

customer.deposit.received

A payment into a customer's own US bank details was credited to the customer's USD balance, net of OnLink's fee. A KES payment into the customer's KES account, and a transfer from outside into the customer's USD, GBP or EUR account, are announced with the same event. It fires once per deposit and is keyed on the deposit:

{
  "id": "e41c7a90-0000-4000-8000-000000000130",
  "type": "customer.deposit.received",
  "createdAt": "2026-11-18T10:32:04.118Z",
  "data": {
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "currency": "USD",
    "depositId": "a1b2c3d4-0000-4000-8000-000000000002",
    "gross": "1000.00",
    "fee": "10.00",
    "net": "990.00",
    "rail": "wire",
    "payerName": "Jane Contributor",
    "receivedAt": "2026-11-18T10:30:12.000Z",
    "creditedAt": "2026-11-18T10:32:03.000Z",
    "treasuryCreditTxId": "UTRANS0000000000000000000001"
  }
}
  • customerId is the customer's id with us. depositId is the deposit's id, and your idempotency anchor for the credit. Quote it if you ever need to ask us about this deposit.
  • gross is what the payer sent, fee is what OnLink deducted, and net is gross less fee: the amount credited to the customer. Reconcile against net. All three are decimal strings in currency, never numbers. The fee is OnLink's, the one set out for your account; any fee you charge your customer is yours to apply. For a payment into the customer's own bank details (USD today), the percentage in your terms applies in any currency; the flat amount and the ceiling are USD amounts and apply to a USD deposit only.
  • rail is how the payment arrived. For a payment into the customer's own bank details it is exactly one of ach_push, fednow or wire, or null when the payer's bank did not say or said something outside those three. Should a payment into those details ever arrive by SEPA or Faster Payments, its rail would be null: those are not among the three, so do not branch on rail to tell the currencies apart; read currency.
  • payerName is the payer's name as the payment reported it, or null.
  • receivedAt is when the payment arrived and creditedAt is when it was credited to the customer. treasuryCreditTxId is the identifier of the credit. Quote it if you ask us about this specific credit.

A KES payment into the customer's KES account has the same envelope and the same keys, except that it has no creditedAt and no treasuryCreditTxId: the money lands in the customer's account directly. Its currency is KES, gross equals net, fee is "0.00", rail is kes_transfer and depositId is the transaction's id. A KES payment cannot be held: it reaches the customer's account before we can review it.

A transfer from outside into a USD, GBP or EUR account (a bank inside Kenya paying the account number, or a transfer from abroad quoting it as the payment reference, as Open accounts for your customers describes) has that same shape: no creditedAt and no treasuryCreditTxId, currency is the currency it arrived in (USD, GBP or EUR), gross equals net, fee is "0.00" and depositId is the transaction's id. rail is local_transfer for a bank inside Kenya, international_transfer for a transfer the bank classifies as international, or null when the bank did not say. It is the bank's classification of the payment, not something we infer, so treat international_transfer as "the bank called it international" rather than a guarantee about where the money started. Never branch on it to tell the currencies apart, read currency. It cannot be held: it reaches the customer's account before we can review it.

Only money from outside is a deposit. Money OnLink itself moves onto a customer's account (crediting a collection, and any conversion or other internal movement) is not announced as a deposit. A collection credit is already reported by its own event. One outside payment, one customer.deposit.received.

No sender bank, routing number, account number or address travels in this event.

customer.deposit.held

A payment for a customer is held for review: nothing is credited to the customer's balance, and the money is safe. It is sent once, when the deposit is first held, and has the same fields as customer.deposit.received except that it says why instead of when it was credited. If the first attempt to queue it fails, OnLink queues it again within a few minutes (for up to 7 days after the hold), and createdAt is then when the deposit was held, not when the event was sent:

{
  "id": "e41c7a90-0000-4000-8000-000000000131",
  "type": "customer.deposit.held",
  "createdAt": "2026-11-18T10:32:04.118Z",
  "data": {
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "currency": "USD",
    "depositId": "a1b2c3d4-0000-4000-8000-000000000003",
    "gross": "250.00",
    "fee": "2.50",
    "net": "247.50",
    "rail": "ach_push",
    "payerName": "Jane Contributor",
    "receivedAt": "2026-11-18T10:30:12.000Z",
    "heldReason": "customer_suspended"
  }
}

heldReason is one of:

  • customer_suspended: the customer is suspended, or has not been cleared to hold accounts (their identity check is not complete).
  • customer_closed: the customer has been closed.
  • partner_suspended: your partner account is suspended.
  • account_closed: the customer's account the payment was sent to has been closed.

gross, fee and net show what would be credited if OnLink releases the payment. Nothing has been credited yet, and you should not show the customer a balance change for it.

If OnLink releases the deposit it is credited and you receive customer.deposit.received for the same depositId, once. If OnLink returns it to the payer itself instead, no further event is sent. A deposit that is held, released and held again is announced as held only the first time. A payment the payer's bank takes back is announced by customer.deposit.refunded, whether or not it was held first.

customer.deposit.refunded

A payment for a customer was returned to the payer, and nothing was or will be credited to the customer's balance for it. It is sent once per deposit, as soon as OnLink learns the payment was returned, and it is keyed on the deposit:

{
  "id": "e41c7a90-0000-4000-8000-000000000132",
  "type": "customer.deposit.refunded",
  "createdAt": "2026-11-25T10:32:04.118Z",
  "data": {
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "depositId": "a1b2c3d4-0000-4000-8000-000000000003",
    "amount": "250.00",
    "currency": "USD",
    "refundedAt": "2026-11-25T10:30:12.000Z",
    "reason": "returned_by_bank_after_review"
  }
}
  • customerId is the customer's id with us. depositId is the deposit's id, and your idempotency anchor: it is the same depositId a customer.deposit.received or customer.deposit.held would have carried.
  • amount is what the payer sent and what was returned to them, a decimal string in currency. There is no fee, because nothing was credited.
  • refundedAt is when the return was recorded, ISO 8601 UTC.
  • reason is always returned_by_bank_after_review. It says the money went back, not why.

If you already received customer.deposit.held for the deposit, this event closes it: you will not receive customer.deposit.received for it. A deposit that was already credited is never announced by this event. If the payer's bank takes that money back after customer.deposit.received was sent, no event is sent: OnLink is alerted and contacts you.

The internal transfer events

Sent for POST /v1/internal-transfers (remittance only), when a transfer between your own account and your customers' accounts reaches its end.

EventWhen it firesTerminal
internal_transfer.completedThe transfer completed and the money moved. Your partner fee, if you attached one, is paid after this.Yes
internal_transfer.failedThe transfer failed and nothing moved. No fee is owed. data.failureCode says why.Yes

internal_transfer.completed and internal_transfer.failed

Both carry the same data; internal_transfer.failed adds failureCode:

{
  "id": "e41c7a90-0000-4000-8000-000000000142",
  "type": "internal_transfer.failed",
  "createdAt": "2026-11-19T10:01:12.000Z",
  "data": {
    "internalTransferId": "3f0c1f0e-5a3e-4d6e-9b53-0b8d2f6f4a51",
    "from": { "type": "partner" },
    "to": {
      "type": "customer",
      "customerId": "a9c1d2e3-0000-4000-8000-000000000020"
    },
    "amount": "250.00",
    "currency": "USD",
    "partnerFee": "0.00",
    "partnerReference": null,
    "failureCode": "CUSTOMER_NOT_ACTIVE"
  }
}

from and to are { type, customerId }; a partner end has no customerId. amount and partnerFee are decimal strings in currency. failureCode is one of CUSTOMER_NOT_ACTIVE (a customer was suspended or closed after you confirmed), ACCOUNT_NOT_READY (an account could not send or receive) or TRANSFER_REFUSED. In every case nothing moved: fix the cause and send a new transfer with a new idempotency key.

Two things are deliberately not announced here. A transfer whose confirmation code was never verified ends expired, and confirmation.expired is the event for it. A transfer whose outcome OnLink cannot yet be sure of stays executing and is never reported failed: it is resolved by OnLink, and GET /v1/internal-transfers/{id} shows it until it ends.

The customer payout event

Sent for POST /v1/customers/{customerId}/transfers (remittance only), when a payout out of a customer's account ends.

EventWhen it firesTerminal
customer.transfer.updatedA payout out of a customer's account was settled (the money moved) or failed (it did not). data.status says which.Yes

One event, once, for either ending: a customer payout never produces transfer.settled or transfer.failed, which are for payouts from your own account, so you write one handler for it and not two overlapping ones.

{
  "id": "e41c7a90-0000-4000-8000-000000000143",
  "type": "customer.transfer.updated",
  "createdAt": "2026-11-19T10:04:31.000Z",
  "data": {
    "transferId": "bd9f1e6a-0000-4000-8000-000000000010",
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "status": "failed",
    "rail": "swift",
    "amount": "250.00",
    "currency": "GBP",
    "fee": "22.00",
    "partnerFee": "1.50",
    "partnerReference": "ACME-PAYOUT-000123",
    "failureCode": "SETTLEMENT_FAILED"
  }
}

amount, fee and partnerFee are decimal strings in currency; fee is OnLink's fee and partnerFee is yours. failureCode is present only when status is failed, and names why: it is the failureCode that GET /v1/customers/{customerId}/transfers/{transferId} shows, for example CUSTOMER_NOT_ACTIVE (the customer was suspended or closed after you confirmed, so nothing was sent) or SETTLEMENT_FAILED (the bank answered and refused it). On failed, no partnerFee is taken, and the money the bank returned to the customer's account is not announced as a deposit: you receive this event and no customer.deposit.received.

A payout whose confirmation code was never verified ends expired, and confirmation.expired is the event for it. A payout whose outcome OnLink cannot yet be sure of stays where it is, is never reported failed, and is resolved by OnLink: GET shows it until it ends.

The customer conversion event

Sent for POST /v1/customers/{id}/conversions (remittance only), when a conversion of a customer's balance reaches its end. One event, customer.conversion.updated, with a data.status of settled or failed. A conversion of your own balance (POST /v1/conversions) keeps its own events, conversion.settled and conversion.failed; a customer's conversion never sends those.

EventWhen it firesTerminal
customer.conversion.updatedThe conversion settled (status: "settled") or failed (status: "failed"). Sent once, when it reaches that outcome.Yes

customer.conversion.updated

A settled conversion:

{
  "id": "e41c7a90-0000-4000-8000-000000000151",
  "type": "customer.conversion.updated",
  "createdAt": "2026-11-19T10:04:31.000Z",
  "data": {
    "conversionId": "7d0a2f4e-3c1b-4b8e-9a52-6e1f0c3d8a17",
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "status": "settled",
    "from": "GBP",
    "to": "KES",
    "source": "100.00",
    "target": "17000.00",
    "rate": "170.00",
    "partnerFee": "1.50"
  }
}

source is what left the customer's from account and target what reached their to account, as decimal strings. rate is the rate the customer was paid at: KES per one unit of the foreign currency, and target is source x rate (foreign to KES) or source / rate (KES to foreign), rounded down to the cent. partnerFee is your own fee, in the source currency (from); it is paid to your account after the conversion settles.

A failed conversion carries reason and no target or rate, because none was ever fixed for it, and its partnerFee is always "0.00": no fee is charged on a conversion that does not happen, whatever fee you asked for:

{
  "id": "e41c7a90-0000-4000-8000-000000000152",
  "type": "customer.conversion.updated",
  "createdAt": "2026-11-19T10:06:02.000Z",
  "data": {
    "conversionId": "7d0a2f4e-3c1b-4b8e-9a52-6e1f0c3d8a18",
    "customerId": "a9c1d2e3-0000-4000-8000-000000000020",
    "status": "failed",
    "from": "KES",
    "to": "EUR",
    "source": "13000.00",
    "partnerFee": "0.00",
    "reason": "rate_moved_beyond_tolerance"
  }
}

reason is one of insufficient_balance, debit_refused, fx_unavailable, provider_otp_not_received, rate_moved_beyond_tolerance or customer_not_active (the customer was no longer verified when the conversion was about to start, so nothing was taken). When the amount had already left the customer's from account it is returned to it, and no partner fee is owed. Send a new conversion with a new idempotency key to try again; for customer_not_active, once the customer is verified again.

The test event

webhook.test is the one event that does not describe anything that happened. We send it only when you ask: press Send test event under Settings → Developers and we POST one to your endpoint straight away. It is not one of the thirty above, no order or transfer ever produces it, and we never send it on our own.

It is signed like every other event: the same string-to-sign, the same four headers and the same signing secret. So if your verifier accepts it, it will accept the rest, and if it rejects it, you have found the problem before a real event depends on it. Verify it first (Verifying signatures), then acknowledge it with any 2xx and ignore it. There is nothing to act on.

  • type is webhook.test.
  • id is a fresh UUID for each test, and the same value is in X-OnLink-Delivery.
  • createdAt is when we sent it.
  • data has one field, message: Test event from OnLink. No action needed.

It is sent once. It is never retried, never stored, and never appears in your delivery log, so a test that fails is not queued for later. The answer comes back to the screen instead: the status your endpoint returned, or the reason we could not reach it (a timeout, a DNS or TLS failure, a refused connection), and how long it took. We wait the same 10 seconds as for a real delivery, so an endpoint that is too slow to pass a test is too slow to pass an event. If you have not saved a webhook URL, the test tells you nothing was sent.

The payload

{
  "id": "0f3c8b21-5d4e-4a97-9c6b-2f81ad0e7c53",
  "type": "order.settled",
  "createdAt": "2026-09-04T09:15:22.481Z",
  "data": {
    "orderId": "c4e8a9d1-7f36-4b02-a58c-1e9d3b7f5a24",
    "partnerReference": "your-ref-000123",
    "side": "sell",
    "status": "settled",
    "kesAmount": "130500.00",
    "feeKesAmount": "2479.80",
    "kesTotalAmount": "128020.20",
    "usdtAmount": "1000.000000",
    "rate": "130.5000"
  }
}

type is authoritative — branch on it, not on the X-OnLink-Event header, which is a convenience hint. status is the order's status when the event was recorded. GET /v1/orders/{id} may already report a later one: a buy order's order.funds_confirmed carries funds_reserved, and the order moves on right after it.

Amounts are decimal strings, never numbers. See Money for why, and what to do with them.

The three KES figures

kesAmount is the trade principal, feeKesAmount is our fee, and kesTotalAmount is the figure that actually moved. On a sell — as above — the total is the principal less the fee, and it is what we paid into your account. On a buy the total is the principal plus the fee, and it is what was debited from your KES balance.

Reconcile against kesTotalAmount, because that is the number your bank statement shows. The other two explain it.

feeKesAmount is "0.00" rather than absent when no fee applies, so a handler can read it unconditionally. The pricing terms behind the fee — the percentage, the flat component and any ceiling — are not in the payload; read them from the order or the quote, which is where they were disclosed to you. Fees has the arithmetic.

Ignore fields you do not recognise

We may add fields to data, and we may add new event types. Both are additive changes. A handler that rejects an unknown field or an unknown type will break on a change that is not supposed to break anything — log it and move on.

Headers

HeaderValue
X-OnLink-Signaturev1=<lowercase hex HMAC-SHA256>
X-OnLink-TimestampUnix milliseconds at signing time.
X-OnLink-DeliveryDelivery id. Stable across every retry — your idempotency key.
X-OnLink-EventThe event type, as a hint. type in the body is authoritative.

Verifying signatures has the algorithm and a worked example in Node and Python.

confirmation.code_issued carries a live code: verify the signature before reading data.code, and never log it.

Delivery and retries

The first attempt goes out within about a minute of the transition. If it fails we retry with exponential backoff — 7 attempts in total, spanning roughly 30 minutes — and then stop and dead-letter the delivery.

sequenceDiagram
    autonumber
    accTitle: A delivery that succeeds on its third attempt
    accDescr: An order reaches a new state. OnLink posts the event to your endpoint and the first attempt times out or answers a non-2xx. OnLink posts again, carrying the same X-OnLink-Delivery id, and the second attempt also answers a non-2xx. OnLink backs off and posts a third time, and your endpoint answers 200. The delivery is complete and no further attempts are made.
    participant OnLink
    participant You as Your endpoint

    Note over OnLink: order reaches a new state
    OnLink->>You: POST (attempt 1)
    You--xOnLink: timeout or non-2xx
    OnLink->>You: POST (attempt 2, same X-OnLink-Delivery)
    You--xOnLink: non-2xx
    OnLink->>You: POST (attempt 3, backing off)
    You-->>OnLink: 200
    Note over OnLink,You: delivered — no further attempts

Read in order, that is:

  1. The order reaches a new state and we post the event to your endpoint.
  2. The attempt times out or answers something other than a 2xx, so it failed.
  3. We post again with the same X-OnLink-Delivery id, and that attempt fails too.
  4. We back off and post a third time. Your endpoint answers 200.
  5. The delivery is done. Nothing further is sent for that event.

Every attempt carries the same X-OnLink-Delivery id. Use it as an idempotency key: record it, and if you see one twice, acknowledge and do nothing. A duplicate is normal — it means your 2xx did not reach us, not that the event happened twice.

Order, transfer, confirmation, collection and conversion events are also reconciled: if one of those is ever missed, it is queued and sent afterwards, so it arrives late rather than never. credit.received, usdt_credit.received and the usdt_send.* events are not reconciled this way today — check your balances and sends on your own schedule as well.

confirmation.code_issued follows different rules

It is never stored, so none of the above applies to it: up to three attempts, all over within about 35 seconds, a 5-second timeout on each, no reconciliation and no dead-letter. If it does not reach you, resend with the /v1/confirmations/{id}/resend endpoint for a new code. See confirmation.code_issued.

Respond fast, process afterwards

You have 10 seconds. Do not do your settlement work inside the request — write the delivery down, return 2xx, and process it on your own schedule. A handler that calls your ledger, your bank and your email provider before responding will eventually exceed the timeout, and we will retry an event you already handled.

If a delivery dead-letters

Seven failed attempts stop the delivery permanently. Nothing is lost — the order is still readable with GET /v1/orders/{id}, and its status carries the same information the event would have. Reconcile any order you have not seen a terminal event for; that is the safety net worth building, and it is why you should store orderId and partnerReference before you move funds.

Once your endpoint is healthy again, you can find the failed delivery in your delivery log under Settings → Developers and send it again.

On this page