Apply for M-PESA B2B Transfer v2

POST /trans/v2/applyForMpesaBusinessTransfer

This is the v2 of applyForMpesaBusinessTransfer endpoint. Currencies supported: USD, GBP, EUR, KES, CNY, TZS, UGX and RWF.

The updates of this endpoint involve:

  1. Parameters like otpType and otpMobile are no longer needed to reduce the redundancy, meaning no OTP will be automatically sent when this endpoint is called. BaaS server should call /common/sendOtp endpoint to trigger the OTP sending.

  2. With the /common/sendOtp and /common/confirmOperation API pair, users can specify the OTP service and the account manager (if the OTP should not go to account owner), meaning with proper parameters, the OTP can be send to account owner's mobile/email or to account manager's mobile/email.

  3. Users can approve a batch of mpesa b2b transfers in one go. As endpoint /common/sendOtp allows server to pass a list of txIds as a parameter and use ONE OTP to validate all transactions within the approved list, and our system will process the approved transactions one by one.

  4. /common/sendOtp can be used to re-send if the OTP sent does not reach customer.

Fields
Data Type
Description
Requirement

payerAccountId

String

The number of the account that is to be debited

Mandatory

payeeShortCode

String

Counterparty shortcode of (paybill/paytill)

Mandatory

payType

Integer

0 for Paybill1 for Paytill

Mandatory

payeeReferenNumber

String

Sub-account Number. Mandatory if paytype is 0

Conditional

amount

Decimal

We assume it's KES amount

Mandatory

description

String

Message to the beneficiary

Optional

payeeMobileForNotification

String

Mobile number of the beneficiary if the payment initiator wants to send sms notification to the beneficiary

Optional

Response Data

{
  "txId": "", //String, Unique Transaction ID
}

OTP Mechanism

Confirm OTP API

Use /common/confirmOperation

Send/Resend OTP API

Use /common/sendOtp or /common/sendAccAdminOtp

Confirm OTP API

Use /common/confirmOperation

OTP Notification Template

1014 OR E318

Generate QR Code (M-Pesa Paybill)

POST /trans/generateQRCode

Perfect for: business customers who have paybills and wish to be able to generate M-pesa QR codes to assist in the payment process for their customers

This API generates a dynamic QR which enables Safaricom M-pesa customers who have My Safaricom App or M-PESA app, to scan a QR (Quick Response) code, to capture Choice's paybill number and amount automatically then authorize to pay bill and credit the Choice customer account.

Request Params

Fields
Data Type
Description
Required?

accountId

String

Credit account number

Mandatory

amount

String

Amount to be credited

circle-info

Must be a whole amount <= 250,000

Mandatory

Response Data

Last updated