Skip to Content
ePay.lkDocs

Refunds

Refund a payment in full or in part. Large refunds wait for approval; results arrive by webhook.

POST/v1/refundsscope refunds:write
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" }'
ParameterTypeDescription
payment_idstring, requiredThe payment to refund. It must be succeeded or partially_refunded.
amountintegerMinor units to refund. Defaults to everything still refundable.
reasonstring ≤ 500Internal note, shown in your dashboard.
Response
{
  "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 becomes refunded.
  • Partial refund: pass amount. The payment becomes partially_refunded and amount_refunded grows. 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 with 400 refund_exceeds_payment; refunding a payment that isn't paid fails with 400 payment_not_refundable.

Refund statuses

StatusMeaning
requires_approvalAbove the approval threshold; waiting for ePay operations to approve
pendingApproved and queued for the acquirer
processingSent to the acquirer
succeededRefunded. The payer's bank usually shows it within 5–10 working days
failedThe acquirer rejected it; see failure_message. The amount becomes refundable again
canceledThe approval was rejected

Most refunds complete synchronously, so the response is often already succeeded. Don't rely on that — listen for webhooks:

EventWhen
refund.createdThe refund was created (any initial status)
refund.succeededThe money is on its way back; the payment's amount_refunded/status are updated
refund.failedThe 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

GET/v1/refunds/:idscope refunds:read
GET/v1/refundsscope refunds:read

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.

On this page