API reference
Payment links
The PaymentLink object and the /v1/payment_links endpoints.
The PaymentLink object
| Field | Type | Description |
|---|---|---|
id | string | plink_… |
object | "payment_link" | |
code | string | Short code used in the URL |
url | string | Public URL, https://beta.pay.epay.lk/l/<code> |
title | string | |
description | string | null | |
amount | integer | null | Fixed amount, or null when the payer chooses |
min_amount / max_amount | integer | null | Bounds for payer-chosen amounts |
currency | LKR | USD | |
status | active | inactive | |
max_uses | integer | null | Usage limit |
use_count | integer | Times used so far |
collect_phone | boolean | Whether the payer is asked for a phone number |
redirect_url | string | null | Where payers return after paying |
expires_at | timestamp | null | |
created_at | timestamp |
Create a payment link
POST/v1/payment_linksscope payment_links:write
| Body parameter | Type | Description |
|---|---|---|
title | string 1–200, required | |
description | string ≤ 1000 | |
amount | integer | null | Omit/null for payer-chosen amount |
min_amount, max_amount | integer | |
currency | LKR | USD | Default LKR |
max_uses | integer ≤ 1,000,000 | |
collect_phone | boolean | |
redirect_url | URL | http(s) |
expires_at | ISO 8601 with offset | e.g. 2026-12-31T23:59:59+05:30 |
curl https://beta.api.epay.lk/v1/payment_links \
-H "Authorization: Bearer $EPAY_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{ "title": "Donation", "min_amount": 50000, "max_amount": 5000000 }'{
"id": "plink_2bV7cW9eR1",
"object": "payment_link",
"code": "k3Hq9TzP",
"url": "https://beta.pay.epay.lk/l/k3Hq9TzP",
"title": "Donation",
"description": null,
"amount": null,
"min_amount": 50000,
"max_amount": 5000000,
"currency": "LKR",
"status": "active",
"max_uses": null,
"use_count": 0,
"collect_phone": false,
"redirect_url": null,
"expires_at": null,
"created_at": "2026-11-22T10:00:00.000Z"
}This endpoint doesn't take an Idempotency-Key; if a create times out, check the dashboard before retrying to avoid a duplicate link.
Retrieve a payment link
GET/v1/payment_links/:idscope payment_links:read
curl https://beta.api.epay.lk/v1/payment_links/plink_2bV7cW9eR1 -H "Authorization: Bearer $EPAY_SECRET_KEY"Returns the PaymentLink object.

