Skip to content

Reversal ​

Reverses a C2B transaction. B2C payments can't be reversed through the API.

ts
await mpesa.reversal.request({
  transactionId: 'UIU030F3PZ',
  amount: 100,
  receiverParty: 600984,
  remarks: 'Paid twice',
  resultUrl: 'https://example.com/payments/reversal/result',
  queueTimeoutUrl: 'https://example.com/payments/reversal/timeout',
});
FieldDaraja fieldNotes
transactionIdTransactionIDThe M-Pesa receipt number to reverse.
amountAmountWhole shillings.
receiverPartyReceiverPartyYour organisation's shortcode.
remarksRemarks2 to 100 characters.
resultUrlResultURLReceives the result.
queueTimeoutUrlQueueTimeOutURLReceives a notice if the request times out.

RecieverIdentifierType (Daraja's spelling) is always "11".

Released under the MIT License.