Mobile Consumer To Business (C2B)

Mobile Consumer To Business (C2B) functionality allows your application to receive payments that are initiated by a mobile subscriber. This is typically achieved by disctributing a PayBill or BuyGoods number (and optionally an account number) that clients can use to make payments from their mobile devices.

C2B functionality is implemented through validation and notification callback URLs configured for each product in your account. Where available, validation is usually the first callback that is invoked in order to complete a C2B transaction. This allows the detection of some error cases (for example wrong account number or amount), thereby reducing the need to reverse these transactions.

Notification is the final step in completing a transaction. The mechanism for notifications is the same as for all other payment categories, and is discussed at length in this section. In this section we will focus on how you can enable C2B validation in your account.


What is the content of each validation?[Go Top]

You can enable C2B validation for your payment product by configuring a validation URL in your account. The POST request that we submit to your callback URL will contain a JSON-encoded object that has the following variables:
Variable Name Type Description Presence
provider String This contains the payment provider that is facilitating this transaction. Supported providers at the moment are:
  • Mpesa: This identifies payments facilitated by Safaricom's M-PESA's APIs
  • Athena: This identifies payments facilitated by our Developer Sandbox. This is obviously not available on our production systems
Compulsory
clientAccount String This value contains the account name (if provided) used by a mobile subscriber to initiate this transaction. This value will only be present for Mobile C2B transactions. Optional
productName String This value identifies the Africa's Talking Payment Product that was used by your application to facilitate this transaction. Compulsory
phoneNumber String This value contains the phone number of the mobile subscriber who is initiating the C2B transaction. Compulsory
value String This string contains the value being exchanged in this transaction. The format of this string is: [3-digit currencyCode][space][Decimal Value]. An example would be: KES 100.50 or UGX 3500.00. Compulsory
providerMetadata String Map This value contains a map of any additional data that we receive from a payment provider for a particulat transaction. This could contain, for example, KYC data associated with thetransaction or any additional regulatory information that is passed to our APIs by payment providers. The map will be empty in the case where there is no additional data to provide. Compulsory