Reversal
Request a reversal
Section titled “Request a reversal”await mpesa.reversal.reverse({ transactionId: "OEI2AK4Q16", amount: 100, resultUrl: "https://example.com/mpesa/reversal/result", queueTimeOutUrl: "https://example.com/mpesa/reversal/timeout", remarks: "Duplicate debit", occasion: "Customer refund",});Wire-level note
Section titled “Wire-level note”Daraja’s reversal payload uses the misspelled field name RecieverIdentifierType on the wire. The SDK keeps that API quirk internal and exposes a correctly spelled receiverIdentifierType input in TypeScript.
Defaults
Section titled “Defaults”commandIddefaults toTransactionReversalreceiverPartydefaults to your configured shortcodereceiverIdentifierTypedefaults to4
Operational advice
Section titled “Operational advice”- Capture the original
TransactionIDfrom your callback or settlement records before attempting a reversal. - Store both synchronous response IDs and the later async result payload for auditability.