Skip to main content
POST
/
v1
/
mpesa
/
reverse
JavaScript
import FingoPay from '@fingoafrica/fingo-pay';

const client = new FingoPay({
  apiKey: process.env['FINGO_PAY_API_KEY'], // This is the default and can be omitted
});

const response = await client.mpesa.requestReversal({ transactionId: 'txn_01j7b6f9p5y9h' });

console.log(response.data);
{
  "status": "success",
  "message": "Reversal initiated successfully",
  "data": {
    "transactionId": "txn_01j7refund"
  }
}

Authorizations

Authorization
string
header
required

Use your API key as a Bearer token. Example: Authorization: Bearer sk_live_...

Headers

Idempotency-Key
string<uuid>

Unique key to safely retry POST without duplicates. Required in live environment.

Body

application/json
transactionId
string
required

Original transactionId (public ID) to reverse.

Example:

"txn_01j7b6f9p5y9h"

narration
string

Optional narration for the reversal request. Maximum 140 characters.

Maximum string length: 140
Example:

"Customer refund"

Response

Accepted — reversal will be processed asynchronously.

status
string
required
Example:

"success"

message
string
required
Example:

"Reversal initiated successfully"

data
object
required