API Reference - Online Checkout

This enables you to create a checkout invoice by providing the necessary details for your Customer to make payment.

Payment can be made via Mobile Money, Bank Card, G-Money, Zeepay, GHQR, BankPay or Hubtel wallet. After making a payment, your website is notified through a redirect, and your online system is also notified by a web callback.

REQUEST PARAMETERS

ParameterTypeRequirementDescription
totalAmountFloatMandatorySpecifies the total amount expected to be paid for the Items being purchased.
descriptionStringMandatoryA brief description about the item to be purchased.
callbackUrlStringMandatoryThe callback URL expected to receive the final status of the payment.
returnUrlStringMandatoryThe merchant website URL where the customer should be redirected to after payment.
cancellationUrlStringMandatoryThe merchant website URL where the customer should be redirected to after cancellation.
clientReferenceStringMandatoryA unique string identifying the request. Useful for reference purposes. It cannot be empty but must have a maximum of 32 characters.
PayeeNameStringOptionalThis refers to the name of the Payee.
PayeeMobileNumberStringOptionalThis refers to the mobile number of the Payee.
PayeeEmailStringOptionalThis refers to the Email of the Payee.

RESPONSE PARAMETERS

ParameterTypeDescription
checkoutUrlStringA payee should be redirected to this link to make payment.
checkoutIdStringA unique Hubtel reference for the transaction.
clientReferenceStringThis is a unique string identifying the request. Same as what was parsed in the request.
checkoutDirectUrlStringA payee can make payment on the same page request was made from with this URL.

SAMPLE REQUEST

POST https://payproxyapi.hubtel.com/items/initiate
Host: payproxyapi.hubtel.com
Accept: application/json
Content-Type: application/json
Authorization: Basic endjeOBiZHhza24=
Cache-Control: no-cache

{  
  "totalAmount": 100,
  "description": "Book Shop Checkout",
  "callbackUrl": "https://webhook.site/8b4bbd0a-5f98-4b3d-abbe-b9b49767f7d5",
  "returnUrl": "http://hubtel.com/online",
  "merchantAccountNumber": "11684",
  "cancellationUrl": "http://hubtel.com/online",
  "clientReference": "inv0012"
}

SAMPLE RESPONSE

{
    "responseCode": "0000",
    "status": "Success",
    "data": {
        "checkoutUrl": "https://pay.hubtel.com/7569a11e8b784f21baa9443b3fce31ed",
        "checkoutId": "7569a11e8b784f21baa9443b3fce31ed",
        "clientReference": "inv0012",
        "message": "",
        "checkoutDirectUrl": "https://pay.hubtel.com/7569a11e8b784f21baa9443b3fce31ed/direct"
    }
}