DOCS Live

Merchants

Refunds and reversals

Give money back for a paid order, in full or in part, or reverse a duplicated mobile money payment.

A refund gives back all or part of a paid payment: the customer gets their money back through the method they paid with. A reversal undoes a duplicated or uncertain mobile money payment through the provider's own reversal (M-Pesa's), with the original reference; a payment whose outcome is still unknown is reversed whole.

Before you start

A key with refunds:write (refunds) or transactions:write (reversals), and the payment's KulPay ID (provider_payment_id).

The flow at a glance

#WhoWhat happens
1Your teamDecides to give money back for a paid payment.
2Your systemCreates the refund (or the reversal) with its own unique ID.
3KulPaySends it through the provider and tells you the result.

1. Refund a payment

Your system.

POST /refunds · API reference

refund_id is your own unique ID for the refund (retrying with it is safe). Leave amount out for a full refund, or give part of it. You can refund in several parts, up to what was paid.

Request

{
  "refund_id": "rf-ord-981-1",
  "provider_payment_id": "3KUXQ43bztiuf9tCMNgbcrYvne3",
  "amount": {
    "amount": "40.00",
    "currency": "MZN"
  },
  "reason": "requested_by_customer"
}

Response

{
  "refund_id": "rf-ord-981-1",
  "provider_refund_id": "3KWPrnqkKWDuWJClOCrLq4csLVz",
  "status": "succeeded",
  "money": {
    "amount": "40.00",
    "currency": "MZN"
  },
  "processed_at": "2026-10-22T10:15:51Z"
}

2. Reverse a duplicated payment

Your system, for mobile money paid twice or in doubt.

POST /v1/transactions/{id}/reversals · API reference

A settled payment is reversed for the amount you give (default what is left) and ends refunded or partially_refunded; one still in flight is reversed whole and ends cancelled. A provider without reversals answers 422 not_supported: refund instead.

Request

{
  "amount": "100.00",
  "reason": "Duplicate: the customer paid order 981 twice"
}

States

StateWhat it means
succeeded

The money went back to the customer.

failed

The provider refused it. Nothing went back.

When the money moves

The refunded amount leaves what you are owed for the payment (or your settled funds, when it was already settled to you). Fees follow your arrangement's refund policy.

Events

EventWhat it tells you
refund.succeeded

The refund reached the customer.

refund.failed

The refund failed.

payment.refunded

The payment is fully refunded.

payment.partially_refunded

Part of the payment was refunded.

reversal.succeeded

The reversal went through.

reversal.failed

The reversal failed.

Errors that matter here

Every error is application/problem+json with a stable code; branch on the code, not the message. The full list is in the error catalogue.

ErrorWhenWhat to do
409 idempotency_key_reused

The refund_id was used for a different refund.

A new refund, a new ID.

422 not_supported

The provider has no reversal.

Refund instead.

Testing it

Refund a test payment in full, then another in two parts, and check your order shows each state. Reverse a test M-Pesa payment to see the reversal events.


All flows · API reference · Error catalogue