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.
Create a payment link
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
| Field | Type | Description |
|---|---|---|
amount.default | integer | Default amount in smallest currency unit |
amount_type | string | static (fixed amount) or dynamic (payer enters amount) |
notify_url | string | Webhook URL for payment notifications |
description | string | Description shown on the payment page |
currency | string | ISO 4217 currency code (default: terminal currency) |
expires_at | ISO 8601 | Optional 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 a payment link
GET /api/v1/links/:id
curl https://4pay.online/api/v1/links/abc12345-... \
-H "x-api-key: YOUR_API_KEY"
List payment links
GET /api/v1/links
curl https://4pay.online/api/v1/links \
-H "x-api-key: YOUR_API_KEY"
Update a payment link
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 a payment link
DELETE /api/v1/links/:id
curl -X DELETE https://4pay.online/api/v1/links/abc12345-... \
-H "x-api-key: YOUR_API_KEY"
Webhook for link payments
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.