Why Use Webhooks
- Real-time updates: Immediate notification when payouts and orders complete
- Reliable delivery: Built-in retry mechanisms for failed deliveries
- Reduced polling: No need to constantly check payout status
- Better UX: Instant confirmation and account updates
Webhook Events
Zuba sends webhooks for the following events:Payout Events
payout.processing- Payout is being processed by the payment providerpayout.paid- Payout completed successfullypayout.failed- Payout failed before settlementpayout.reverted- A payout that had already settled (payout.paid) was later rejected by the provider’s downstream bank; an operator manually refunded the merchant and the amount was credited back. The payout fee may not come back with the amount: the payment was executed on the details given, as with any bank transfer the receiving bank bounces, sofeeRefundedon the payout (GET /v1/payouts/{id}) says whether the fee was refunded. Unlikepayout.failed(a pre-settlement failure, which refunds amount and fee), this payout did originally succeed: do not automatically re-issue it.payout.cancelled- Payout was cancelled, whether you cancelled it viaPOST /v1/payouts/{id}/cancelor it was cancelled downstream. The debited balance is returned to your account as part of the cancellation; confirm it from your balance rather than from this event
payout.paid) or to cancelled (payout.cancelled). A cancellation that follows a failure completes a balance return the failure did not finish and returns nothing the failure already returned; a fee kept on a returned payout stays kept. Confirm it from your balance.
Payout Lifecycle
Where each event fires in a payout’s life.created and queued are internal pre-processing states and fire no webhook. The first delivery you receive is normally payout.processing, but a payout that fails after it is created and before processing emits payout.failed as its first and only event. A payout funded from your own account at the bank holding a managed deposit account can also fail early. For a cross-currency payout, and for a USD-to-USD SWIFT wire sent without a quote, those funds are checked and drawn when the payout is created. If the bank declines to release them, the call returns 201 with the payout failed. If the account is frozen, unreachable or held at more than one institution, the payout is refused: sent without a quote it returns 201 with the payout failed, and sent with a quoteId it is refused with a 422 before any payout is created. A USD-to-USD SWIFT wire that the bank holding your managed deposit account delivers itself (to a receiving bank outside the US, on a corridor that bank serves) is not refused at creation when its funds are at that bank or at more than one institution. Any other same-currency payout from such an account is created as usual and, if its funds cannot be drawn, fails before it is sent, with its funds returned. A request refused before a payout is created, such as a submit-time validation error or a payout your balance cannot cover (a 400 whose code is INSUFFICIENT_BALANCE), emits no webhook:
payout.failed carries the reason in failureCategory and failureReason,
and payout.reverted says in failureReason that the payout was returned
(see Event-specific data fields). An event
recorded before those fields existed does not carry them; fetch
GET /v1/payouts/{id} for its failureReason.Order Events
Orders (POST /v1/orders) are executed manually by Zuba’s trade desk; webhooks are how you learn the outcome. See Trade Desk Orders for the full lifecycle.
order.created- The order was created. Fires together withorder.funds_received(balance-funded) ororder.awaiting_funds(settlement-funded)order.awaiting_funds- Funding instructions were issued; the payload’ssettlementblock carries the account or address, amount, and reference to fund the orderorder.funds_received- The source amount is held and the order is queued for desk executionorder.completed- The desk delivered to your beneficiary;uetris present for wire deliveries,txHashfor deliveries to a crypto walletorder.failed- The order failed (failureReasonset) and the held funds were returned to your balanceorder.expired- The funding window closed before the order was funded; a transfer arriving later credits the balance instead
order.cancelled event (cancellation is answered synchronously by POST /v1/orders/{id}/cancel) and no event for the executing status (desk review is internal).
Account Events
account.created- An account record was created viaPOST /v1/accounts
Application Events
Your onboarding application moves through review out of band, so these events report where it stands.application.under_review- The application was submitted and is being reviewedapplication.more_info_requested- Review needs more from you; the payload addsmoreInfoReasonand theeditableSectionsto completeapplication.approved- The application was approvedapplication.rejected- The application was rejectedapplication.identity_verification_updated- A director’s or shareholder’s own identity verification moved (topendingon a reopened attempt as well as to a decision), or the applicant’s own was verified or rejected (an expired attempt is rejected); the payload addspersonId, null for the applicant, andidentityVerificationStatus(pending,verifiedorrejected)
Information Request Events
After your application is approved, Zuba may need more from you, often because our banking partner asked. An information request carries the questions; it does not change your application or your ability to make payments. Read and answer it with the information requests API.accountId tells you which sub-account was asked; send it as Zuba-Account-Id on those calls. GET /v1/information-requests/all-accounts lists your master account’s requests and every sub-account’s in one list.
information_request.opened- Zuba asked you, or one of your sub-accounts, some questions; the payload carries the questions and any due dateinformation_request.closed- The request is finished;resolutionisfulfilledwhen you answered it andwithdrawnwhen Zuba closed it before you did
data is the request when the event was processed, so it can already show a later status; read GET /v1/information-requests/{id} for the current state. In the sandbox you can open and close a sample request yourself.
Virtual Account Events
Most currencies issue virtual accounts asynchronously:POST /v1/virtual-accounts returns status: "pending" and the account completes out of band, which can take far longer than a request cycle. These events are the completion signal, so use them rather than a polling loop. A failed delivery can be re-sent (see Redelivering a failed delivery), but no event exists for an account that has not completed, so if you have been waiting longer than you expect, repeat the POST: it is idempotent per owner and currency, and answers with the pending account, the active one, or the refusal that stands. GET /v1/virtual-accounts lists active accounts only, so a pending account and a refused one are both simply absent from it.
A refusal answers on the POST itself when it can be settled inside the request. 409 KYB_INCOMPLETE means the account owner’s own approved application is not complete enough to open the account, and the message names what is outstanding — a document still to upload, or an acceptance of the terms the account would be opened under that the owner has not given at the version currently in force. GET /v1/virtual-accounts/requirements reports the same set before you request anything, and for acceptance it hands back the documents themselves. 409 VIRTUAL_ACCOUNT_VERIFICATION_REQUIRED is the other half: the provider requires verification material beyond the application’s fields. Complete the outstanding onboarding verification and repeat the POST — the request is refused with the same code until the verification passes. A repeat within ten minutes of the last refusal is answered from that refusal without consulting the provider, so allow that interval before retrying. Where the message says the account was taken out of service, there is nothing to complete: repeating the POST once the ten minutes have passed issues a new account. 409 VIRTUAL_ACCOUNT_DEACTIVATED is different: the account was deactivated, and only support can re-issue it.
virtual_account.active- The account was approved and now carries its issued details; fetch them withGET /v1/virtual-accountsvirtual_account.failed- The account was refused after issuance, or can never produce usable payment details. A repeatPOST /v1/virtual-accountsfor the same currency answers with the refusal that stands (409 VIRTUAL_ACCOUNT_VERIFICATION_REQUIREDfor a provider verification refusal,409 VIRTUAL_ACCOUNT_DEACTIVATEDfor a deactivation only support can lift). Where the refusal came from onboarding the account holder, the payload addsfailureCode:account_holder_declinedis final, so contact support rather than retrying;onboarding_errormeans the onboarding can be completed or corrected and the request repeated
XOF/XAF/GHSaccounts are approved after creation, so a refusal lands on an account you already hold aspendingand firesvirtual_account.failed.ZARaccounts are opened by the bank partner, either inside the request (201withstatus: "active"and the details filled in) or after it (201withstatus: "pending"). APOSTthe partner answers with an account already out of service answers409 VIRTUAL_ACCOUNT_VERIFICATION_REQUIRED; aPOSTthat fails at the partner answers502and is safe to repeat. Once aPOSThas answeredpending,virtual_account.activecarries the issued details, andvirtual_account.failedmeans the partner refused the account; a repeat request then answers409 VIRTUAL_ACCOUNT_VERIFICATION_REQUIREDwhile the refusal stands. Where the refusal asks you to retry after ten minutes, repeating the request then opens the account again with a newpaymentReference; otherwise contact support.EUR/GBPaccounts are approved before creation: a refusal surfaces as an error onPOST /v1/virtual-accountsitself. Where the account holder’s onboarding is still under review, thePOSTanswerspendingand the account then firesvirtual_account.active, orvirtual_account.failedwith afailureCodeif the review refuses it. An account that stayspendingfar longer than usual needs support rather than a retry.USDaccounts are verified after creation, and part of the verification can also settle inside the request: aPOSTthe provider refuses outright answers409 VIRTUAL_ACCOUNT_VERIFICATION_REQUIREDwith nothing created — complete the outstanding verification and repeat the request. APOSTrefused409 KYB_INCOMPLETEnever reached the bank at all: the named document or acceptance is still owed on the owner’s application, and supplying it makes the repeat succeed. Once thePOSTanswers201withstatus: "pending", the remaining verification can run for days:virtual_account.activecarries the issued wire details, andvirtual_account.failedmeans the verification refused the account — a repeat request then answers409 VIRTUAL_ACCOUNT_VERIFICATION_REQUIREDwhile the refusal stands; where the refusal names verification material you can supply, completing it and repeating the request is the recovery, otherwise contact support.
accountId is not null the account belongs to that sub-account, and both follow-up calls are owner-scoped: send Zuba-Account-Id: <accountId> on the GET or the repeat POST, or the request addresses your master account’s accounts instead.
The payload identifies the account but never carries bank details — always read those from the authenticated GET /v1/virtual-accounts.
In production whether a sub-account can hold its own NGN account depends on which rail serves your workspace: POST /v1/virtual-accounts always issues one for the master, and a request naming a sub-account either issues one or answers 422 VIRTUAL_ACCOUNT_SELF_SERVE_UNSUPPORTED. Call GET /v1/virtual-accounts/requirements with the sub-account’s id to find out which: self_serve_unsupported means that workspace’s rail issues to the master only. The sandbox issues one for a sub-account. NG-incorporated workspaces also have one provisioned during onboarding review and read it from GET /v1/virtual-accounts once the application is approved. In production an NGN account that opens within the request emits no event; one that opens only after a review emits virtual_account.active when it opens, or virtual_account.failed if the review refuses it. In the sandbox, POST /v1/virtual-accounts returns the NGN account number directly, already active, and virtual_account.active follows as it does for every sandbox account.
Deposit Events
Incoming deposits notify on their terminal outcome, so you can credit your customer (or surface a failure) without pollingGET /v1/deposits.
deposit.completed- Funds were received and credited to your Zuba balance. The balance moves bycreditedAmount:amountlessserviceFee. Credit your own customer from that figure, not fromamount. Fires once when the deposit reachescompleted, on any rail — a bank transfer or mobile-money/paybill credit into a virtual account, an M-Pesa STK-push collection, a USD/EUR/GBP account credit, or an on-chain crypto deposit. A deposit held for compliance review (in_review) fires this only once it clears.deposit.failed- The deposit terminally failed — an M-Pesa STK push the payer declined or entered the wrong PIN for, an inbound transfer returned before it ever credited, or a deposit rejected during compliance review (in_review). Usually nothing was credited andcreditedAmountandserviceFeeare bothnull, but a deposit rejected in review after its credit had already landed carries the figures that credit moved. Readstatusbefore you credit anyone from them. A deposit that alreadycompletedand is later reversed is not adeposit.failed.
pending or processing, and the refund lifecycle (refunding/refunded) is not yet delivered as a webhook. The payload identifies the deposit by id + clientRef, and carries the amount, plus the charge and the credit where the deposit credited; read full detail from GET /v1/deposits.
deposit.completed
deposit.failed
Other Events
webhook.test- Test event sent via the test endpoint
Event Payload
Every webhook delivery is a JSON POST request with this envelope:Event-specific data fields
payout.* events
Events recorded before
failureCategory and failureReason were added do not carry either field, including when such an event is retried or redelivered. A redelivery of an event first delivered before developerFee and totalDebit were added does not carry them either.
order.* events
account.created
application.* events
information_request.* events
virtual_account.* events
deposit.* events
Each request includes these headers:
Setting Up Webhook Endpoints
Webhook endpoint URLs must use HTTPS: registering anhttp:// URL is rejected with a 400.
Basic Webhook Handler
Create an endpoint to receive webhook notifications:Processing Different Event Types
Handle specific webhook events:Webhook Security
Verifying Signatures
Every webhook delivery includes a cryptographic signature so you can verify the request genuinely originated from Zuba and has not been tampered with. You should always verify signatures before processing webhook events. The signature is computed as:signing_secretis the plaintext secret (thewhsec_-prefixed value returned when you created the endpoint)timestampis the value from theX-Zuba-Timestampheaderraw_bodyis the raw HTTP request body (not parsed JSON)- The result is hex-encoded (64 characters)
Verification Steps
- Extract the
X-Zuba-SignatureandX-Zuba-Timestampheaders - Concatenate the timestamp, a literal
., and the raw request body - Compute the HMAC-SHA256 of that string using your signing secret
- Compare your computed signature against the header value using a constant-time comparison
- Check that the timestamp is recent (within your tolerance window) to prevent replay attacks
Code Examples
Replay Protection
The timestamp is included in the signed content specifically to enable replay protection. An attacker who intercepts a valid webhook cannot replay it at a later time if you enforce a timestamp tolerance. We recommend rejecting any webhook where theX-Zuba-Timestamp is more than 5 minutes from your server’s current time. All the examples above implement this check.
Make sure your server’s clock is synchronized with NTP. A clock that drifts
significantly could cause valid webhooks to be rejected.
IP Allowlisting
Zuba does not currently publish a static egress IP range for webhook deliveries. Signature verification (above) is the supported way to authenticate incoming webhooks: it proves both origin and integrity, which an IP check alone does not.Handling Webhook Failures
Idempotency
Zuba delivers each event at least once, so the same event can reach you more than once. Every delivery of an event carries the sameid: record the IDs you have processed and skip any you have seen.
Ordering
Deliveries can arrive out of order: apayout.paid can reach you before the payout.processing that preceded it. Each payout.* event’s data is the payout as it stood at that change, not when it was delivered, so apply a payout event only if its sequence is higher than the last one you applied for that payout, and ignore it otherwise. To read a payout’s current state, call GET /v1/payouts/{id}.
Retry Logic
Implement exponential backoff for webhook processing:Delivery and Retries
Zuba retries failed deliveries up to 11 times (12 attempts in total) with exponential backoff, over roughly 40 to 75 minutes. A delivery is successful when your endpoint responds with a 2xx status code within 30 seconds. Redirects are not followed: a 3xx response counts as a failed attempt.
Delays include random jitter and can be up to twice these values. Treat them as lower bounds.
After all attempts are exhausted, the delivery is marked as failed. You can view delivery history via the API:
GET /v1/webhooks/{endpoint_id}/deliveries/{delivery_id}.
Redelivering a failed delivery
Once your endpoint is fixed, re-send a delivery whosestatus is failed:
id and, for payout events, the same sequence, so your deduplication and ordering treat it as the event you missed. The signature and X-Zuba-Timestamp are fresh. The response is the delivery, now pending; it is retried on the schedule above, and its attempt numbers continue from the earlier attempts. An API key needs the create:webhooks scope.
A delivery that is pending (still being retried) or delivered cannot be re-sent, and the request returns 409 with WEBHOOK_DELIVERY_NOT_REDELIVERABLE. A redelivery that succeeded makes the delivery pending, so a retry of the same request returns this 409 too; read the delivery to see its status. A delivery to a disabled endpoint returns 409 with WEBHOOK_ENDPOINT_DISABLED; enable the endpoint first. An endpoint or delivery outside your workspace returns 404.
Testing Webhooks
Sending a Test Event
Trigger awebhook.test delivery to a registered endpoint:
"test": true in the envelope and is signed like any other event, so you can exercise your signature verification and processing end to end.
Local Testing with ngrok
Expose your local development server with ngrok:Complete Example
Next Steps
- Learn about error handling strategies for webhook failures
- Explore the API reference for complete event schemas
- Set up monitoring and alerting for production webhook endpoints
- Implement webhook event replay for failed processing scenarios