Skip to main content

PayLinks

Create and manage payment links. All endpoints require authentication.

List your payment links.

curl https://api.paylinks.ro/api/v1/paylinks \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "X-Currency: RON"

Query Parameters:

ParameterTypeDefaultDescription
limitinteger50Max items returned (max 100)
cursorstringOptional 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:

FieldTypeRequiredDescription
namestringYesPayment link title
slugstringYesURL slug (a-z0-9-)
descriptionstringNoDescription shown to buyers
priceTypestringYesFIXED, FLEXIBLE, or FREE
serviceTypestringYesSERVICE or DIGITAL_PRODUCT
paymentTypestringNoONE_TIME or SUBSCRIPTION
amountnumberYes (FIXED)Price in major units (e.g. 49.99)
currencystringNoRON, EUR, GBP
minAmountnumberNoMinimum amount for FLEXIBLE
collectEmailbooleanNoCollect buyer email (default: true)
collectPhonebooleanNoCollect buyer phone
collectBillingAddressbooleanNoCollect buyer billing address
addVatbooleanNoApply VAT to checkout amount
subscriptionIntervalstringNoWEEKLY, MONTHLY, SIX_MONTHS, YEARLY
stockLimitintegerNoStock cap for one-time links
activebooleanNoWhether 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:

FieldTypeRequiredDescription
promptstringYesNatural language description

Response (200): Returns { "suggestion": { ... } } with an AI-generated draft payload.


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 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}