About Lesson
Lesson Notes
-
B2C Overview:
B2C is used by businesses to send funds directly to customers’ Mpesa wallets, commonly for refunds, salary payments, or bonuses. -
Required Parameters:
- InitiatorName: User authorized to initiate B2C transactions.
- SecurityCredential: Encrypted password for the initiator.
- CommandID: Transaction type, e.g.,
SalaryPayment
,BusinessPayment
. - Amount: Amount to be transferred.
- PartyA: Business shortcode.
- PartyB: Recipient’s phone number.
-
API Integration:
- Implement logic to send B2C requests with proper headers and parameters.
- Handle responses to confirm transaction success or failure.
-
Testing:
- Use sandbox credentials to simulate B2C payouts.
- Ensure error handling for invalid recipients or insufficient funds.