Refunds
Refund a payment in full or in part. Large refunds wait for approval; results arrive by webhook.
curl https://beta.api.epay.lk/v1/refunds \
-H "Authorization: Bearer $EPAY_SECRET_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: refund-order-1042-1" \
-d '{ "payment_id": "pay_8Hq2LxV0cT4mZr7N", "amount": 25000, "reason": "One item returned" }'| Parameter | Type | Description |
|---|---|---|
payment_id | string, required | The payment to refund. It must be succeeded or partially_refunded. |
amount | integer | Minor units to refund. Defaults to everything still refundable. |
reason | string ≤ 500 | Internal note, shown in your dashboard. |
{
"id": "re_5Tn0QeK8dW1pXy3B",
"object": "refund",
"payment_id": "pay_8Hq2LxV0cT4mZr7N",
"amount": 25000,
"currency": "LKR",
"status": "succeeded",
"reason": "One item returned",
"failure_message": null,
"approval_request_id": null,
"created_at": "2026-11-23T08:02:11.000Z",
"succeeded_at": "2026-11-23T08:02:12.000Z"
}Always send an Idempotency-Key: retrying a refund request without one can refund twice.
Partial and full refunds
- Full refund: omit
amount. The payment becomesrefunded. - Partial refund: pass
amount. The payment becomespartially_refundedandamount_refundedgrows. You can issue several partial refunds until the total reaches the payment amount. - The refundable amount is
amount − amount_refunded − refunds still in flight. Asking for more fails with400 refund_exceeds_payment; refunding a payment that isn't paid fails with400 payment_not_refundable.
Refund statuses
| Status | Meaning |
|---|---|
requires_approval | Above the approval threshold; waiting for ePay operations to approve |
pending | Approved and queued for the acquirer |
processing | Sent to the acquirer |
succeeded | Refunded. The payer's bank usually shows it within 5–10 working days |
failed | The acquirer rejected it; see failure_message. The amount becomes refundable again |
canceled | The approval was rejected |
Most refunds complete synchronously, so the response is often already succeeded. Don't rely on that — listen for webhooks:
| Event | When |
|---|---|
refund.created | The refund was created (any initial status) |
refund.succeeded | The money is on its way back; the payment's amount_refunded/status are updated |
refund.failed | The acquirer rejected the refund |
Large refunds need approval
Refunds above LKR 100,000.00 (10000000 minor units — the default platform threshold) are created as requires_approval with an approval_request_id. A second person at ePay reviews them (four-eyes) before they're sent to the acquirer. You'll receive refund.succeeded or refund.failed once it's processed. The threshold applies per refund.
Retrieve and list refunds
List supports payment_id, limit (1–100, default 20) and cursor. See the Refund reference.
Testing refunds in the sandbox
In the sandbox every refund succeeds immediately, except amounts whose minor units end in 13 (e.g. 1013 = LKR 10.13), which fail with refund_rejected so you can test refund.failed. Amounts above the threshold go to requires_approval exactly as in production.

