Reconciliation and status checks
Check a payment's status when its callback hasn't arrived within 5 minutes, read the status values, and update the order.
Check the status of any payment that has no final result after 5 minutes, then update your order. Every payment integration must do this.
Before you start(4)
- Create one at business.hubtel.com
A Hubtel business with a merchant account
Business APIs work through your business's merchant account. If you don't have one yet, sign up and set it up first.
- Payment keys
API ID and API key
They identify you on every request. Send them using HTTP Basic authentication.
- Account IDs
Collection account number
This is where your customers' payments arrive. You'll add it to the request URL.
- IP allowlisting
An allowlisted server IP address
Send your server's public IP address to Hubtel to get it allowlisted. Until then, your requests return 403 Forbidden or time out.
Don't have these yet? Start in the sandbox with your test keys while you set them up.
Callbacks usually arrive within 30 seconds, but delivery isn't guaranteed. You must check the status of any payment without a final callback after 5 minutes. Schedule a job to check unresolved orders older than 5 minutes; running it every minute is one option. Make order updates idempotent so a callback and a status check cannot fulfil the same order twice.
For each unresolved order:
- Request its status using the original reference.
- If the request fails or the response is incomplete, keep the order unresolved and retry on a later run. Record repeated failures for investigation.
- For
Paid, match the returned reference and amount to the stored order, then fulfil once. - For
Unpaid, keep checking or escalate for investigation. This status alone does not distinguish pending, failed and expired payments. - For
Refunded, update your records and follow your refund workflow.
The contract does not define a timeout after which Unpaid becomes a final failure. Don't mark a payment failed solely because 30 minutes have passed, or create another charge while its outcome is unknown.
Check a collection's status
Check a collection's status works for payments made through Online Checkout, the Checkout SDK, Direct Receive Money, Direct Debit and Programmable Services. Implementing it is mandatory.
curl "https://api-txnstatus.hubtel.com/transactions/$HUBTEL_COLLECTION_ACCOUNT/status?clientReference=order-1042" \
-u "$HUBTEL_API_ID:$HUBTEL_API_KEY"- Put your collection account number in the path.
- Identify the payment with
clientReference(recommended),hubtelTransactionIdornetworkTransactionId. - Only allowlisted server IPs can reach this endpoint in production. Other addresses get
403or a timeout; see IP allowlisting.
{
"message": "Successful",
"responseCode": "0000",
"data": {
"date": "2024-04-25T21:45:48.4740964Z",
"status": "Paid",
"transactionId": "7fd01221faeb41469daec7b3561bddc5",
"externalTransactionId": "0000006824852622",
"paymentMethod": "mobilemoney",
"clientReference": "order-1042",
"currencyCode": null,
"amount": 45,
"charges": 0.88,
"amountAfterCharges": 45,
"isFulfilled": null
}
}transactionId is Hubtel's ID and externalTransactionId is the network's reference. currencyCode and isFulfilled can be null.
Payouts and balance transfers have their own status checks: Check a payout's status and Get a transfer's status. Invoices use Get an invoice's status.
Status values
status | Meaning | Do |
|---|---|---|
Paid | Money received | Fulfil once |
Unpaid | No confirmed payment; may be pending, failed or expired | Keep unresolved; check again or investigate |
Refunded | The payment was refunded | Reverse fulfilment as your business requires |
Status Check responses use camelCase (responseCode, data), unlike Receive Money's PascalCase. See Field casing.