Introduction
ePay is a Sri Lankan internet payment gateway. Accept card and LankaQR payments through a hosted checkout, with refunds, payment links, invoices and signed webhooks.
The ePay API is a REST API with JSON request and response bodies. Your server talks to it with a secret key; your payers only ever see ePay's hosted checkout page. You never collect card numbers yourself.
How a payment works
Your server creates a payment. Call POST /v1/payments with the amount in minor units (125000 = LKR 1,250.00). ePay returns the payment with a one-time checkout_url.
Redirect the payer to checkout_url. On beta.pay.epay.lk they choose a payment method. Card details are entered on the acquiring bank's 3-D Secure page — never on your site and never on ePay's checkout page.
The payer comes back to your return_url with payment_id, status and order_id query parameters. Treat these as a hint to show the right page, not as proof of payment.
Confirm on your server. Fulfil the order when you receive the signed payment.succeeded webhook, or after checking GET /v1/payments/:id yourself.
Hostnames
| Surface | Production | Sandbox | Who uses it |
|---|---|---|---|
| REST API | https://beta.api.epay.lk | https://beta.sandbox-api.epay.lk | Your server (secret key) |
| Hosted checkout | https://beta.pay.epay.lk | https://beta.sandbox-pay.epay.lk | Your payers' browsers |
| Merchant dashboard | https://beta.merchant.epay.lk | https://beta.sandbox-merchant.epay.lk | Your team |
| Legacy form-POST gateway | https://beta.ipg.epay.lk | https://beta.sandbox-ipg.epay.lk | Existing form-POST integrations |
| Bank simulator | — | https://beta.sandbox-bank.epay.lk | Sandbox test payments only |
Production and sandbox are completely separate deployments with separate accounts, keys and data.
Conventions
- JSON, snake_case. Send
Content-Type: application/json. - Amounts are integers in minor units. LKR has two decimals, so
125000means LKR 1,250.00. Never send decimals or strings. - Currency is
LKRby default;USDis accepted where enabled for your account. - Timestamps are ISO 8601 strings in UTC, e.g.
2026-11-22T10:15:00.000Z. - IDs are prefixed by type:
pay_…(payment),re_…(refund),plink_…(payment link),evt_…(event). - Errors always use the same envelope and include a
request_id— quote it when you contact support.

