Requests and responses
Client references, amounts and fees, phone numbers, channel codes, field casing, asynchronous results and rate limits across the Hubtel APIs.
Client references
For APIs that accept ClientReference (or clientReference), use it to match requests with callbacks and status checks. Invoicing and pre-approval use different identifiers; follow their guides.
- Make it unique for every transaction, and never reuse one. Use your order or payout ID.
- Use letters and digits. Receive Money accepts up to 36 characters and Online Checkout up to 32.
- If a request times out, don't send it again with a new reference. Check the status with the reference you sent first, then decide.
Amounts and fees
Amounts are in Ghana cedis (GHS) with at most 2 decimal places, for example 0.50.
Responses and callbacks report fees separately:
| Field | Meaning |
|---|---|
Amount | The amount in your request. |
Charges | Hubtel's fee for the transaction. |
AmountAfterCharges | What reaches your account after the fee. |
AmountCharged | What the customer paid. |
AmountDebited | For payouts: what left your disbursement account, fee included. |
Phone numbers
Send mobile numbers in international format without +, for example 233249111411.
Mobile money channels
| Network | Receive and Send Money | Direct Debit | Recurring Invoice |
|---|---|---|---|
| MTN | mtn-gh | mtn-gh-direct-debit | mtn_gh_rec |
| Telecel | vodafone-gh | vodafone-gh-direct-debit | vodafone_gh_rec |
| AirtelTigo | tigo-gh | — | — |
The channel must match the number's network.
Field casing
Field names are case-sensitive and differ between APIs. Copy them from the API reference.
- Receive Money, Send Money, Send to Bank and their callbacks use PascalCase:
ResponseCode,Data,ClientReference. So do Online Checkout callbacks. - Status checks, Online Checkout requests, refunds, balances and Direct Debit pre-approval use camelCase:
responseCode,data,clientReference.
Asynchronous results
Payments, payouts, transfers, refunds and commission services complete asynchronously:
- Read the result using the field and codes documented for that operation. Receive Money, payouts, transfers and refunds return
0001for an accepted, pending request. Online Checkout returns0000when the checkout is created; this does not confirm payment. - Hubtel sends the final result to your callback URL. See the callback reference.
- If no final result arrives within 5 minutes, use the status check for that product.
Rate limits
Send requests at a steady pace rather than in bursts, and wait before you retry a failed request. If you expect high volumes, tell your Retail Systems Engineer before you go live.
Authentication & API keys
Authenticate with HTTP Basic authentication, and find the credentials, account numbers and base URL each Hubtel API uses.
Build a complete integration
Collect a mobile money payment with Direct Receive Money, handle the callback, deal with failed payments and reconcile payments whose callback doesn't arrive.