B2cRequest

constructor(initiatorName: String, securityCredential: String, b2cCommandId: B2cCommandId, amount: String, partyA: String, partyB: String, resultUrl: String, queueTimeOutUrl: String, remarks: String, occasion: String)

Parameters

initiatorName

This is an API user created by the Business Administrator of the M-PESA Bulk disbursement account that is active and authorized to initiate B2C transactions via API. Sample: initiator_1, John_Doe,John Doe

securityCredential

This is the value obtained after encrypting the API initiator password. The password on Sandbox has been provisioned on the simulator. However, on production the password is created when the user is being created on the M-PESA organization portal.

b2cCommandId

This is a unique command that specifies B2C transaction type. Sample: B2cCommandId.SalaryPayment

amount

The amount of money being sent to the customer.

partyA

This is the B2C organization shortcode from which the money is to be sent.

partyB

This is the customer mobile number to receive the amount. The number should have the country code (254) without the plus sign.

resultUrl

This is the URL to be specified in your request that will be used by M-Pesa to send notification upon processing of the payment request.

queueTimeOutUrl

This is the URL to be specified in your request that will be used by API Proxy to send notification in case the payment request is timed out while awaiting processing in the queue.

remarks

Any additional information to be associated with the transaction.

occasion

Any additional information to be associated with the transaction.


constructor(initiatorName: String, securityCredential: String, commandId: String, amount: Float, partyA: String, partyB: String, resultUrl: String, queueTimeOutUrl: String, remarks: String, occasion: String)

Parameters

initiatorName

This is an API user created by the Business Administrator of the M-PESA Bulk disbursement account that is active and authorized to initiate B2C transactions via API. Sample: initiator_1, John_Doe,John Doe

securityCredential

This is the value obtained after encrypting the API initiator password. The password on Sandbox has been provisioned on the simulator. However, on production the password is created when the user is being created on the M-PESA organization portal.

commandId

This is a unique command that specifies B2C transaction type.

amount

The amount of money being sent to the customer.

partyA

This is the B2C organization shortcode from which the money is to be sent.

partyB

This is the customer mobile number to receive the amount. The number should have the country code (254) without the plus sign.

resultUrl

This is the URL to be specified in your request that will be used by M-Pesa to send notification upon processing of the payment request.

queueTimeOutUrl

This is the URL to be specified in your request that will be used by API Proxy to send notification in case the payment request is timed out while awaiting processing in the queue.

remarks

Any additional information to be associated with the transaction.

occasion

Any additional information to be associated with the transaction.