Skip to Content
ePay.lkDocs

Payment links

Shareable links that collect payments without any checkout code — fixed or payer-chosen amounts, usage limits and expiry.

A payment link is a reusable URL like https://beta.pay.epay.lk/l/k3Hq9TzP. Share it by email, WhatsApp, SMS, a QR code or a button on your site. Each time someone opens it, enters their name and email (and phone, if you ask for it) and continues, ePay creates a new payment with source: "payment_link" and sends them to the hosted checkout.

Create links in the dashboard (Payment links → New link) or with the API.

POST/v1/payment_linksscope payment_links:write
curl https://beta.api.epay.lk/v1/payment_links \
  -H "Authorization: Bearer $EPAY_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Workshop ticket — Colombo Design Week",
    "description": "Includes lunch and materials.",
    "amount": 750000,
    "max_uses": 40,
    "collect_phone": true,
    "redirect_url": "https://example.lk/thanks",
    "expires_at": "2026-12-31T23:59:59+05:30"
  }'
ParameterTypeDescription
titlestring 1–200, requiredShown as the heading on the link page.
descriptionstring ≤ 1000Shown under the title.
amountinteger | nullFixed amount in minor units. Omit or null to let the payer enter the amount.
min_amount / max_amountintegerBounds for payer-entered amounts.
currencyLKR | USDDefault LKR.
max_usesintegerMaximum number of times the link can be used; use_count tracks usage.
collect_phonebooleanAsk the payer for a phone number.
redirect_urlhttp(s) URLWhere the payer returns after paying (the return_url of each payment).
expires_atISO 8601 with offsetThe link stops working after this time.
Response
{
  "id": "plink_2bV7cW9eR1",
  "object": "payment_link",
  "code": "k3Hq9TzP",
  "url": "https://beta.pay.epay.lk/l/k3Hq9TzP",
  "title": "Workshop ticket — Colombo Design Week",
  "description": "Includes lunch and materials.",
  "amount": 750000,
  "min_amount": null,
  "max_amount": null,
  "currency": "LKR",
  "status": "active",
  "max_uses": 40,
  "use_count": 0,
  "collect_phone": true,
  "redirect_url": "https://example.lk/thanks",
  "expires_at": "2026-12-31T18:29:59.000Z",
  "created_at": "2026-11-22T10:00:00.000Z"
}
GET/v1/payment_links/:idscope payment_links:read

Every payment created from a link has source: "payment_link" and payment_link_id set, carries the payer's name/email as customer, and produces the same payment.* webhooks as API payments. Fulfil from payment.succeeded, reading payment_link_id to know what was bought.

A link shows "no longer available" when it's been deactivated in the dashboard, has expired, or reached max_uses.

On this page