const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({transactionId: 'txn_01j7b6f9p5y9h', narration: 'Customer refund'})
};
fetch('https://api.fingopay.io/v1/mpesa/reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"message": "Reversal initiated successfully",
"data": {
"transactionId": "txn_01j7refund"
}
}Initiate a reversal for a previously completed M-Pesa C2B transaction. The reversal will be processed asynchronously.
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({transactionId: 'txn_01j7b6f9p5y9h', narration: 'Customer refund'})
};
fetch('https://api.fingopay.io/v1/mpesa/reverse', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"status": "success",
"message": "Reversal initiated successfully",
"data": {
"transactionId": "txn_01j7refund"
}
}Use your API key as a Bearer token. Example: Authorization: Bearer sk_live_...
Unique key to safely retry POST without duplicates. Required in live environment.
Was this page helpful?