Skip to main content

Payment Links & QR Codes

Payment links let you create reusable or one-time payment pages without writing any checkout UI. QR codes are generated from payment links and can be printed, embedded in emails, or shown on POS screens.


POST /api/v1/links
curl -X POST https://4pay.online/api/v1/links \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"link": {
"amount": {
"default": 1000
},
"amount_type": "static",
"notify_url": "https://yoursite.com/webhooks/payment",
"description": "Payment for service"
}
}'

Parameters

FieldTypeDescription
amount.defaultintegerDefault amount in smallest currency unit
amount_typestringstatic (fixed amount) or dynamic (payer enters amount)
notify_urlstringWebhook URL for payment notifications
descriptionstringDescription shown on the payment page
currencystringISO 4217 currency code (default: terminal currency)
expires_atISO 8601Optional expiry datetime

Response

{
"id": "abc12345-...",
"url": "https://4pay.online/pay/link/abc12345-...",
"qr_url": "https://4pay.online/pay/link/abc12345-.../qr",
"amount": { "default": 1000 },
"amount_type": "static",
"created_at": "2026-03-01T10:00:00Z"
}

Share the url directly or display the qr_url image as a QR code.


GET /api/v1/links/:id
curl https://4pay.online/api/v1/links/abc12345-... \
-H "x-api-key: YOUR_API_KEY"

GET /api/v1/links
curl https://4pay.online/api/v1/links \
-H "x-api-key: YOUR_API_KEY"

PUT /api/v1/links/:id
curl -X PUT https://4pay.online/api/v1/links/abc12345-... \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"link": {
"amount": { "default": 2000 },
"description": "Updated description"
}
}'

DELETE /api/v1/links/:id
curl -X DELETE https://4pay.online/api/v1/links/abc12345-... \
-H "x-api-key: YOUR_API_KEY"

When someone pays via a link, you receive a webhook with type: "link":

{
"type": "link",
"link": "abc12345-...",
"txid": "generated-txid",
"id": "550e8400-...",
"status": "charged",
"amount": 1000,
"amount_dest": 950,
"amount_with_fee": 1050,
"error_description": ""
}

QR Code Products

For retail or POS use cases, you can create products with QR codes that trigger a fixed-price payment flow:

POST /api/v1/products
curl -X POST https://4pay.online/api/v1/products \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{
"product": {
"name": "Coffee",
"amount": 350,
"currency": "USD",
"notify_url": "https://yourpos.com/webhooks/payment"
}
}'

Each product generates a dedicated QR code that can be printed and used indefinitely.