B2C validation notifications

The mobile B2C API provides optional functionality to validate B2C requests from your application. To receive these notifications you need to setup a B2C validation callback URL on your payment product. From the dashboard select Payments -> Products -> Actions -> Callback.

Validation Notification Content

B2C validation notifications are sent as POST requests to the validation callback URL provided and contain the following parameters:

Parameter Description
transactioId
String
The transaction id within Africa's Talking.
phoneNumber
String
The phone number of the mobile subscriber receiving the B2C payment.
currencyCode
String
The 3-digist ISO format currency for the value of this transaction (e.g KES, UGX ...)
amount
Decimal
Amount - in the provided currency - that the client will receive.
metadata
Map
A map of metadata associated with this request.
{
    "transactionId" : "SomeTransactionID",
    "phoneNumber": "+254711XXXYYY",
    "currencyCode": "KES",
    "amount": 500.00",
    "metadata": {
        "shopId": "1234",
        "itemId": "abcdef"
    }
}

Validation Notification Response

Once you receive a validation callback notification you'll be expected to send back a JSON response that marks the transaction as Validated or Failed. If validated we will proceed to send the b2c transaction, if failed, we will block the b2c transaction.


{
    "status": "Validated" // or "Failed"
}