In order to implement Customer Online Shopping by M-Pesa, the eCommerce merchant needs to integration the merchant system to use the following M-Pesa API functions: C2BPayment, Reversal and Query.
Customer Online Shopping on Mobile Web / App service flow
To submit a pay by M-Pesa request, the merchant mobile website or App can call the M-Pesa OpenAPI server using C2BPayment API to send the Customer’s M-Pesa Phone number, Order details and Amount to request payment. To confirm the payment, the M-Pesa customer will receive an USSD push message from M-Pesa and be asked to enter their M-Pesa PIN.
Reversal service flow
If customer wants to request a refund after a successful transaction, the customer will need to discuss and agree with the merchant. The merchant can call the Reversal API to refund the customer.
Query service flow
Merchant can query M-Pesa to check the status of the transaction by using the Query Txn API.