PayLinks
Create and manage payment links. All endpoints require authentication.
GET /paylinks
List your payment links.
curl https://api.paylinks.ro/api/v1/paylinks \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Currency: RON"
Query Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
limit | integer | 50 | Max items returned (max 100) |
cursor | string | — | Optional cursor for server-side paging |
Response (200):
{
"items": [
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Premium Course",
"slug": "premium-course",
"priceType": "FIXED",
"serviceType": "DIGITAL_PRODUCT",
"paymentType": "ONE_TIME",
"amount": 49.99,
"currency": "RON",
"active": true,
"views": 128,
"sales": 30,
"createdAt": "2026-01-15T10:00:00.000Z"
}
]
}
POST /paylinks
Create a new payment link.
curl -X POST https://api.paylinks.ro/api/v1/paylinks \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-H "X-Currency: RON" \
-d '{
"name": "Premium Course",
"slug": "premium-course",
"description": "Full access to all modules",
"priceType": "FIXED",
"serviceType": "DIGITAL_PRODUCT",
"paymentType": "ONE_TIME",
"amount": 49.99,
"collectEmail": true,
"collectPhone": false
}'
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Payment link title |
slug | string | Yes | URL slug (a-z0-9-) |
description | string | No | Description shown to buyers |
priceType | string | Yes | FIXED, FLEXIBLE, or FREE |
serviceType | string | Yes | SERVICE or DIGITAL_PRODUCT |
paymentType | string | No | ONE_TIME or SUBSCRIPTION |
amount | number | Yes (FIXED) | Price in major units (e.g. 49.99) |
currency | string | No | RON, EUR, GBP |
minAmount | number | No | Minimum amount for FLEXIBLE |
collectEmail | boolean | No | Collect buyer email (default: true) |
collectPhone | boolean | No | Collect buyer phone |
collectBillingAddress | boolean | No | Collect buyer billing address |
addVat | boolean | No | Apply VAT to checkout amount |
subscriptionInterval | string | No | WEEKLY, MONTHLY, SIX_MONTHS, YEARLY |
stockLimit | integer | No | Stock cap for one-time links |
active | boolean | No | Whether link is live (default: true) |
Response (201):
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Premium Course",
"slug": "premium-course",
"priceType": "FIXED",
"paymentType": "ONE_TIME",
"serviceType": "DIGITAL_PRODUCT",
"amount": 49.99,
"currency": "RON",
"active": true,
"collectEmail": true,
"collectPhone": false,
"createdAt": "2026-02-17T10:00:00.000Z"
}
POST /paylinks/ai-draft
Generate a paylink using AI from a text prompt.
curl -X POST https://api.paylinks.ro/api/v1/paylinks/ai-draft \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"prompt": "A cooking course for beginners, 99 RON"}'
Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Natural language description |
Response (200): Returns { "suggestion": { ... } } with an AI-generated draft payload.
PATCH /paylinks/:id
Update an existing paylink.
curl -X PATCH https://api.paylinks.ro/api/v1/paylinks/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"name": "Updated Course Title", "amount": 59.99}'
Most create fields are accepted on update, including priceType and serviceType (validation rules still apply).
Response (200): Updated PayLink object.
POST /paylinks/:id/duplicate
Create a copy of an existing paylink.
curl -X POST https://api.paylinks.ro/api/v1/paylinks/a1b2c3d4-e5f6-7890-abcd-ef1234567890/duplicate \
-H "Authorization: Bearer YOUR_TOKEN"
Response (201): New PayLink object (copy of the original with a new slug).
DELETE /paylinks/:id
Delete a paylink.
curl -X DELETE https://api.paylinks.ro/api/v1/paylinks/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \
-H "Authorization: Bearer YOUR_TOKEN"
Response (200):
{"ok": true}