Utilities
Validate a utility customer before payment, then initiate a bill payment using the values returned by the validation step.
Supported Bill Types
Pass the selected provider as bill_type. Values are case-sensitive.
Validate User
Use this endpoint to confirm that the customer account exists before initiating payment.
POST
https://testxchange.korba365.com/api/v1.0/utilities_validate_user/
Validate request
curl -X POST https://testxchange.korba365.com/api/v1.0/utilities_validate_user/ \ -H "Authorization: HMAC YOUR_CLIENT_KEY:YOUR_SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "bill_type": "DSTV", "client_id": 8, "customer_number": "7020000004", "transaction_id": "085694478" }'
Validate Response
200 OK
{ "results": { "message": "ANTHONY BASSAW-5.00" }, "error_code": null }
4xx Error
{ "success": false, "error_code": 405, "error_message": "Duplicate transaction id" }
Pay Bill
After validation, use the returned customer details to make a payment.
POST
https://testxchange.korba365.com/api/v1.0/utilities_pay_bill/
Pay bill request
curl -X POST https://testxchange.korba365.com/api/v1.0/utilities_pay_bill/ \ -H "Authorization: HMAC YOUR_CLIENT_KEY:YOUR_SIGNATURE" \ -H "Content-Type: application/json" \ -d '{ "bill_type": "DSTV", "client_id": 8, "customer_number": "7020000004", "sender_name": "ANTHONY BASSAW", "address": "Accra", "amount": "1.0", "transaction_id": "986887909", "callback_url": "https://myapp.com/utility_callback/" }'
Pay Bill Response
200 OK
{ "results": "Transaction initiated successfully.", "error_code": null, "success": true }
4xx Error
{ "success": false, "error_code": 405, "error_message": "Duplicate transaction id" }
Callback
The payment callback is called after processing and includes transaction_id, status (SUCCESS or FAILED), and message as query parameters.