Skip to Content
ePay.lkDocs
API reference

Refunds

The Refund object and the /v1/refunds endpoints.

The Refund object

FieldTypeDescription
idstringre_…
object"refund"
payment_idstringThe refunded payment
amountintegerMinor units
currencyLKR | USDSame as the payment
statusenumrequires_approval, pending, processing, succeeded, failed, canceled
reasonstring | nullYour note
failure_messagestring | nullWhy the acquirer rejected it
approval_request_idstring | nullSet when the refund needed approval
created_attimestamp
succeeded_attimestamp | null

Create a refund

POST/v1/refundsscope refunds:write

Headers: Idempotency-Key (recommended).

Body parameterTypeDescription
payment_idstring, requiredA succeeded or partially_refunded payment
amountintegerMinor units; default = everything still refundable
reasonstring ≤ 500
Request
curl https://beta.api.epay.lk/v1/refunds \
  -H "Authorization: Bearer $EPAY_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: refund-1042-1" \
  -d '{ "payment_id": "pay_8Hq2LxV0cT4mZr7N", "amount": 25000 }'
Response 200
{
  "id": "re_5Tn0QeK8dW1pXy3B",
  "object": "refund",
  "payment_id": "pay_8Hq2LxV0cT4mZr7N",
  "amount": 25000,
  "currency": "LKR",
  "status": "succeeded",
  "reason": null,
  "failure_message": null,
  "approval_request_id": null,
  "created_at": "2026-11-23T08:02:11.000Z",
  "succeeded_at": "2026-11-23T08:02:12.000Z"
}

Refunds above the approval threshold (default LKR 100,000.00) return status: "requires_approval".

Errors: 400 parameter_missing (payment_id), 400 payment_not_refundable, 400 refund_exceeds_payment, 404 resource_missing, 422 idempotency_key_reused.

Retrieve a refund

GET/v1/refunds/:idscope refunds:read
Request
curl https://beta.api.epay.lk/v1/refunds/re_5Tn0QeK8dW1pXy3B -H "Authorization: Bearer $EPAY_SECRET_KEY"

List refunds

GET/v1/refundsscope refunds:read
Query parameterDescription
payment_idOnly refunds of this payment
limit1–100, default 20
cursorFrom next_cursor
Request
curl "https://beta.api.epay.lk/v1/refunds?payment_id=pay_8Hq2LxV0cT4mZr7N" -H "Authorization: Bearer $EPAY_SECRET_KEY"

Returns a list of Refund objects, newest first.

On this page