B2cRequest

@Serializable
data class B2cRequest(val initiatorName: String, val securityCredential: String, val commandId: String, val amount: Float, val partyA: String, val partyB: String, val resultUrl: String, val queueTimeOutUrl: String, val remarks: String, val occasion: String)

B2c request

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.

Constructors

Link copied to clipboard
constructor(initiatorName: String, securityCredential: String, b2cCommandId: B2cCommandId, amount: String, partyA: String, partyB: String, resultUrl: String, queueTimeOutUrl: String, remarks: String, occasion: String)
constructor(initiatorName: String, securityCredential: String, commandId: String, amount: Float, partyA: String, partyB: String, resultUrl: String, queueTimeOutUrl: String, remarks: String, occasion: String)

Properties

Link copied to clipboard
@SerialName(value = "Amount")
val amount: Float
Link copied to clipboard
@SerialName(value = "CommandID")
val commandId: String
Link copied to clipboard
@SerialName(value = "InitiatorName")
val initiatorName: String
Link copied to clipboard
@SerialName(value = "Occasion")
val occasion: String
Link copied to clipboard
@SerialName(value = "PartyA")
val partyA: String
Link copied to clipboard
@SerialName(value = "PartyB")
val partyB: String
Link copied to clipboard
@SerialName(value = "QueueTimeOutURL")
val queueTimeOutUrl: String
Link copied to clipboard
@SerialName(value = "Remarks")
val remarks: String
Link copied to clipboard
@SerialName(value = "ResultURL")
val resultUrl: String
Link copied to clipboard
@SerialName(value = "SecurityCredential")
val securityCredential: String