Drinah Pay API Documentation

Verify API

Use the Verify API to confirm the status of a transaction after the payment has been made. You can use this to check whether the payment was successful or failed.

Request Format

To verify a payment, you need to send a POST request with the following parameters:

{
    "merchant_request_id": "12345",   // The MerchantRequestID from the charge API
    "checkout_request_id": "67890"    // The CheckoutRequestID from the charge API
}
    

Response Example

The response will include the status of the transaction and other details.

{
    "status": "success",               // The payment status (e.g. 'success' or 'failed')
    "transaction_id": "abcd1234",      // Unique transaction ID for the payment
    "amount": 1000,                    // Amount paid in the transaction
    "phone": "2547XXXXXXXXX",          // Phone number used for the transaction
    "payment_method": "M-Pesa"         // Payment method used
}
    

Error Codes

If the verification fails, you may receive an error with a specific error code.

Notes

- Make sure the `merchant_request_id` and `checkout_request_id` you are passing are correct and from the charge request. - If the payment is successful, the status will be "success". Otherwise, the status will be "failed" or "pending". - You can use this API to periodically check the status of a payment until it's confirmed.