The following documentation presents comprehensive resources to help developers integrate with Hubtel.
With these APIs, you can process online payments and connect to customers via SMS.
Please note that all endpoints on this page are rate-limited, allowing up to 5 requests per minute.
Further, all recipients (for SMS, send/request money) defaults to the owner of the API keys
Live endpoints (without stated restrictions) are available on the developer's portal
You need to authenticate every request you make mainly using basic authentication.
Visit here, click on 'Create Keys'; a ClientID and Client Secret will be generated for you.
When using the 'Try It' panel, input ClientID as username and Client Secret as password.
Security Scheme Type | HTTP |
---|---|
HTTP Authorization Scheme | basic |
This endpoint uses a GET verb to send SMS. No authorization is required in the header
Success
Bad Request
Not Found
Bad Request
Internal Server Error
curl -i -X GET \ 'https://devp-sms03726-api.hubtel.com/v1/messages/send?clientid=string&clientsecret=string&from=string&to=string&content=string'
{- "message": "string",
- "responseCode": "string",
- "data": {
- "rate": 0,
- "messageId": "string",
- "status": "string",
- "networkId": "string"
}
}
This endpoint uses a POST verb to send SMS. Authorization is required in the header.
Success
Bad Request
Bad Request
Not Found
Bad Request
Internal Server Error
{- "from": "MySenderId",
- "to": "string",
- "content": "hello world"
}
{- "message": "string",
- "responseCode": "string",
- "data": {
- "rate": 0,
- "messageId": "string",
- "status": "string",
- "networkId": "string"
}
}
This endpoint uses a GET verb to query the final status of a previously sent SMS. Authorization is required in the header
Success
Bad Request
curl -i -X GET \ -u <username>:<password> \ 'https://devp-sms03726-api.hubtel.com/v1/messages/{messageId}'
{- "message": "string",
- "responseCode": "string",
- "data": {
- "rate": 0,
- "units": 0,
- "messageId": "string",
- "content": "string",
- "to": "string",
- "from": "string",
- "status": "string",
- "clientReference": "string",
- "networkId": "string",
- "updateTime": "string",
- "time": "string"
}
}
This service enables you to verify your users via One-Time-Password.
This is especially useful for authentication.
When implemented, Hubtel generates 3 tokens: RequestId (an identifier for your OTP session), Prefix (a 4 character phrase) and Code (the 4 digit code that will only be delivered to your user via SMS).
Your system is expected to verify the user by presenting these 3 tokens.
You may resend an OTP using the same RequestID.
As a fallback option, Hubtel provides a USSD option to view the Code, in cases where SMS delivery fails.
The user is expected to dial the USSD code using the same phone number that should have received the SMS. The code is "711777#"
This endpoint sends an OTP to the recipient.
senderId | string Must be 11 alpha-numeric characters or less; subject to approval by Hubtel. |
phoneNumber | string The recipient's telephone number. Must be full international format (E164) |
countryCode | string Must be a valid ISO 3166-1 alpha-2 country code |
Success
Bad Request
Server Error
{- "senderId": "MySenderId",
- "phoneNumber": "string",
- "countryCode": "GH"
}
{- "message": "string",
- "code": "string",
- "data": {
- "requestId": "string",
- "prefix": "string"
}
}
This endpoint verifies an OTP.
Success
Bad Request
Server Error
{- "requestId": "string",
- "prefix": "string",
- "code": "string"
}
{- "errors": [
- {
- "field": "string",
- "errorMessage": "string"
}
], - "code": "string",
- "status": "string",
- "message": "string",
- "data": { }
}
This endpoint re-sends a previously issued OTP to your user. A common use case may be when the SMS delivery delays significantly.
Success
Bad Request
Server Error
{- "requestId": "string"
}
{- "message": "string",
- "code": "string",
- "data": {
- "requestId": "string",
- "prefix": "string"
}
}
This endpoint generates a URL ('paylinkUrl' in the response body) that can be used to receive money from a single customer into your Hubtel account for onward settlement.
Success
Bad Request
Failed Dependency
Server Error
{- "amount": 1,
- "title": "string",
- "description": "string",
- "clientReference": "string",
}
{- "message": "string",
- "code": "string",
- "data": {
- "paylinkId": "string",
- "clientReference": "string",
- "paylinkUrl": "string",
- "expiresAt": 0
}
}
This endpoint generates a URL ('paylinkUrl' in the response body) that can be used to receive money from multiple customers into your Hubtel account for onward settlement.
Success
Bad Request
Failed Dependency
Server Error
{- "amount": 1,
- "title": "string",
- "description": "string",
- "clientReference": "string",
- "audience": [
- "string"
]
}
{- "message": "string",
- "code": "string",
- "data": {
- "paylinkId": "string",
- "clientReference": "string",
- "paylinkUrl": "string",
- "expiresAt": 0
}
}
Callback sent from Hubtel after money is paid.
Return a 200 status to indicate that the data was received successfully
{- "message": "string",
- "responseCode": "string",
- "data": {
- "paymentType": "string",
- "status": "string",
- "amount": 0,
- "paylinkId": "string",
- "phoneNumber": "string",
- "clientReference": "string"
}
}
This endpoint notifies a single customer about a pending withdrawal. After funds are withdrawn successfully, a callback is sent to your 'callbackUrl'
Success
Bad Request
Failed Dependency
Server Error
{- "amount": 1,
- "title": "string",
- "description": "string",
- "clientReference": "string",
}
{- "message": "string",
- "code": "string",
- "data": {
- "transactionId": "string",
- "clientReference": "string"
}
}
This endpoint notifies list of customers about a pending withdrawal. After they withdraw funds successfully, a callback is sent to your 'callbackUrl'
Success
Bad Request
Failed Dependency
Server Error
{- "amount": 1,
- "title": "string",
- "description": "string",
- "clientReference": "string",
- "audience": [
- "string"
]
}
{- "message": "string",
- "code": "string",
- "data": {
- "transactionId": "string",
- "clientReference": "string"
}
}
Callback sent from Hubtel when money is withdrawn.
Return a 200 status to indicate that the data was received successfully
{- "message": "string",
- "responseCode": "string",
- "data": {
- "transactionId": "string",
- "clientReference": "string",
- "amount": 0,
- "mobileNumber": "string",
- "paylinkId": "string"
}
}