Refunds & captures

Refund a transaction

bash
POST /api/v1/transactions/{id}/refund
{
  "amount": 50.00   // omit for full refund
}

Behaviour:

  • If amount equals the transaction amount → status becomes REFUNDED.
  • If partial → status becomes PARTIALLY_REFUNDED; you can refund again until the full amount is refunded.
  • If the gateway declines, the call returns 422 and the status stays SUCCESS.
Most gateways reject refunds after 6 months. If you need to issue something later, refund what's possible and credit the rest via your bank.

Capture an authorization

If the gateway is configured for auth+capture (instead of immediate capture), call:

bash
POST /api/v1/transactions/{id}/capture

This captures the full authorized amount. Partial captures are not supported today.

SDK

ts
await minnha.transactions.refund(id, { amount: 50.00 });
await minnha.transactions.capture(id);