Payment Callback
Structure of the callback response received after a payment is processed.
Responses
200
This represents the JSON that will be sent to your request callback_url. NOTE: it contains the ExternalReference that you provided in the request and CheckoutRequestID that was returned in the request response. You can use those to track and update your payments in your system/app.
| Name | Type | Required | Description |
|---|---|---|---|
forward_url | string | No | An optional URL to which the user might be redirected after the callback is processed. |
response | object | Yes | An object containing the detailed results of the payment transaction. |
↳ Amount | number | Yes | The amount of the transaction. |
↳ CheckoutRequestID | string | Yes | A unique identifier for the checkout request. This can be used to track the payment status. |
↳ ExternalReference | string | Yes | The external reference provided by your system during the payment initiation. Use this to link the callback to your internal records. |
↳ MerchantRequestID | string | Yes | A unique identifier for the merchant request. |
↳ MpesaReceiptNumber | string | Yes | The M-Pesa receipt number for the successful transaction. |
↳ Phone | string | Yes | The phone number associated with the transaction, typically the payer's number. |
↳ ResultCode | number | Yes | A code indicating the result of the transaction. A value of 0 typically indicates success. |
↳ ResultDesc | string | Yes | A human-readable description of the transaction result. |
↳ Status | string | Yes | The overall status of the transaction (e.g., "Success", "Failed"). |
status | boolean | Yes | Indicates the overall success or failure of the callback processing. true for success, false for failure. |
{
"forward_url": "",
"response": {
"Amount": 10,
"CheckoutRequestID": "ws_CO_14012024103543427709099876",
"ExternalReference": "INV-009",
"MerchantRequestID": "3202-70921557-1",
"MpesaReceiptNumber": "SAE3YULR0Y",
"Phone": "+254709099876",
"ResultCode": 0,
"ResultDesc": "The service request is processed successfully.",
"Status": "Success"
},
"status": true
}
