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.
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"
}'| Parameter | Type | Description |
|---|---|---|
title | string 1–200, required | Shown as the heading on the link page. |
description | string ≤ 1000 | Shown under the title. |
amount | integer | null | Fixed amount in minor units. Omit or null to let the payer enter the amount. |
min_amount / max_amount | integer | Bounds for payer-entered amounts. |
currency | LKR | USD | Default LKR. |
max_uses | integer | Maximum number of times the link can be used; use_count tracks usage. |
collect_phone | boolean | Ask the payer for a phone number. |
redirect_url | http(s) URL | Where the payer returns after paying (the return_url of each payment). |
expires_at | ISO 8601 with offset | The link stops working after this time. |
{
"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"
}How link payments reach you
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.

