View as Markdown llms.txt

Disbursement and treasury#

Moving money out, and the treasury operations around it. Nothing here asks a human to approve anything, which is why most of it is disabled in production until you opt in.

b2c_payment#

money gated in production

Pay money out to a customer: refunds, withdrawals, salaries, promotional winnings. Asynchronous; the result arrives on a callback.

ParameterTypeNotes
phoneNumber requiredstringRecipient phone number.
amount requirednumberAmount in KES, whole numbers only.
commandId"BusinessPayment" | "SalaryPayment" | "PromotionPayment"BusinessPayment for general payouts, SalaryPayment for salaries (allows unregistered recipients), PromotionPayment for winnings. Defaults to "BusinessPayment".
remarksstringDefaults to "Payment".
occasionstring
shortCodestring
resultUrlstring

b2c_payment_and_wait#

money waits for callback gated in production

Pay money out to a customer and wait for the result callback, returning the receipt number on success.

ParameterTypeNotes
phoneNumber requiredstringRecipient phone number.
amount requirednumberAmount in KES, whole numbers only.
commandId"BusinessPayment" | "SalaryPayment" | "PromotionPayment"BusinessPayment for general payouts, SalaryPayment for salaries (allows unregistered recipients), PromotionPayment for winnings. Defaults to "BusinessPayment".
remarksstringDefaults to "Payment".
occasionstring
shortCodestring
resultUrlstring
timeoutSecondsnumberDefaults to 120.

b2b_payment#

money gated in production

Pay another business: a PayBill, a Buy Goods till, or a B2C working account top-up.

ParameterTypeNotes
target required"paybill" | "buygoods" | "topup"paybill pays a PayBill, buygoods pays a till, topup funds a B2C working account.
receiverShortCode requiredstringShortcode being paid.
amount requirednumberAmount in KES, whole numbers only.
accountReferencestringRequired for paybill. Ignored for buy goods.
requesterstringOptional phone number of the person on whose behalf you are paying.
remarksstringDefaults to "Payment".
shortCodestring
resultUrlstring

tax_remittance#

money gated in production

Remit tax to the Kenya Revenue Authority using a Payment Registration Number.

ParameterTypeNotes
amount requirednumberAmount in KES, whole numbers only.
paymentRegistrationNumber requiredstringKRA Payment Registration Number (PRN) for the tax being paid.
remarksstringDefaults to "Tax payment".
shortCodestring
resultUrlstring

business_to_pochi#

money gated in production

Pay a Pochi la Biashara number.

ParameterTypeNotes
phoneNumber requiredstringPochi la Biashara number receiving the payment.
amount requirednumberAmount in KES, whole numbers only.
remarksstringDefaults to "Payment".
shortCodestring
resultUrlstring

account_balance#

control

Query the balance of your M-Pesa business account. Asynchronous; the balance arrives on a callback as a pipe-delimited string per account type.

ParameterTypeNotes
shortCodestring
remarksstringDefaults to "Balance query".
resultUrlstring

transaction_status#

control

Check the status of any past transaction by receipt number, or by conversation id when the original request timed out. Use this before retrying a payment you are unsure about.

ParameterTypeNotes
transactionIdstringM-Pesa receipt number, for example NEF61H8J60.
originalConversationIdstringUse when you never received a receipt number.
shortCodestring
remarksstringDefaults to "Status query".
resultUrlstring

reversal#

money gated in production

Reverse a transaction that was paid into your shortcode.

ParameterTypeNotes
transactionId requiredstringM-Pesa receipt number of the transaction to reverse.
amount requirednumberAmount in KES, whole numbers only.
receiverShortCodestringShortcode that received the money.
remarksstringDefaults to "Reversal".
resultUrlstring