Authentication and accounts
Authenticate with HTTP Basic authentication, and find the credentials, account numbers and base URL each Hubtel API uses.
Most Hubtel HTTP APIs use HTTP Basic authentication. Payment requests also need the relevant account number. SMPP uses its own connection credentials, and the service fulfilment callback uses IP allowlisting.
Choose credentials for the API you need below. Business APIs use a Hubtel merchant account, and lending uses separate myCreditScore credentials.
Credentials
For HTTP Basic authentication, send the first credential as the username and the second as the password. Use SMPP credentials when binding an SMPP connection.
| API | Keys | Where to get them |
|---|---|---|
| Payments, payouts and verification | API ID and API Key | API keys → Payments |
| Business SMS | Client ID and Client Secret | API keys → SMS |
| SMPP | Client ID and Client Secret | Ask your Retail Systems Engineer, then find them under API keys → SMPP |
| Lending | API ID and API Key | myCreditScore Lenders Portal (see Lending data) |
Your payment keys also cover status checks, refunds, balances, commission services and invoicing.
Set the variables below in your server environment. Keep their values out of source control.
| Example variable | Value |
|---|---|
HUBTEL_API_ID, HUBTEL_API_KEY | Your payment API ID and API key |
HUBTEL_COLLECTION_ACCOUNT | Collection account number |
HUBTEL_DISBURSEMENT_ACCOUNT | Disbursement account number |
HUBTEL_SMS_CLIENT_ID, HUBTEL_SMS_CLIENT_SECRET | Your SMS client ID and client secret |
These are example environment variable names, not API fields. In guides, replace example.com callback and return URLs with your own routes, use a fresh transaction reference, and replace sample customer details. For tests, use sandbox credentials, hosts and numbers.
Your HTTP client builds the Authorization: Basic base64(username:password) header for you:
curl -u "$HUBTEL_API_ID:$HUBTEL_API_KEY" \
--get "https://api-txnstatus.hubtel.com/transactions/$HUBTEL_COLLECTION_ACCOUNT/status" \
--data-urlencode "clientReference=order-1042"Keep credentials on your server
Never put an API key or client secret in a browser, a mobile app or a public repository. For web payments, create the checkout on your server and send only the checkout URL to the browser (see Online Checkout). Quick Send SMS also accepts keys as query parameters; use the POST endpoints instead, so your keys don't end up in logged URLs.
The published Checkout SDK examples accept credentials in client code. Their credential scope remains unconfirmed; review that limitation before choosing an SDK.
Account numbers
Your merchant account has two account numbers for each branch, listed under Develop → Account IDs. Put the one that matches where the money moves in the request path:
| Account | What it's for | Used by |
|---|---|---|
| Collection (POS sales) | Receives customer payments | Receive Money, Online Checkout, Direct Debit, invoicing, status checks, refunds, transfers out |
| Disbursement (prepaid) | Funds payouts | Send Money, Send to Bank, commission services |
To fund payouts from your sales, move money across with a balance transfer.
Base URLs
Each API has its own host. Many accept requests only from allowlisted server IP addresses; see IP allowlisting.
| API | Base URL |
|---|---|
| Receive Money, Direct Debit charges | https://rmp.hubtel.com |
| Direct Debit pre-approval | https://preapproval.hubtel.com |
| Online Checkout | https://payproxyapi.hubtel.com |
| Transaction status | https://api-txnstatus.hubtel.com |
| Refunds | https://refund-api.hubtel.com |
| Invoicing | https://invoicing.hubtel.com |
| Recurring Invoice | https://rip.hubtel.com |