Reverse payments

Give a customer the whole amount of a collection back.

Give a customer the whole amount of a SUCCEEDED collection back. The fee is not returned.

Reverse a collection

Call Reverse a payment with a key that has the refunds.write scope:

curl -X POST "https://malipo.flex.co.tz/api/v1/payments/<id>/reversal" \
  -H "Authorization: Bearer <token>" \
  -H "Idempotency-Key: 2c9e7f1a-4d6b-4a8e-b3c5-7d9f1e2a4b6c" \
  -H "Content-Type: application/json" \
  -d '{ "reason": "Customer returned the order" }'

You get 202 and the payment is REVERSING. Then your webhook endpoint gets one of:

EventStatusWhat happened
payment.reversedREVERSEDThe customer has the money back.
payment.reversal_failedSUCCEEDEDThe provider refused, or your available balance could not cover it.

The amount comes out of your balance. After payment.reversal_failed you can try again with a new Idempotency-Key. Sending the same key again does not start a second reversal.

Errors

CodeWhy
403The payment is a payout, or reversals are not available to you (contact support).
404No payment with this ID.
409The payment is not SUCCEEDED.
422The provider does not support reversals. Today only M-Pesa does.

On this page