Accepting payments
Payment links
A payment link is a payment page you can use again and again. Create it once and share it on social media, by email or as a QR code at the counter; every visitor gets their own invoice.
Fixed and open links
| kind | Use it for | Fields |
|---|---|---|
fixed | Selling a product or service: everyone pays the same. | price_usd |
open | Donations, tips or top-ups: the customer enters the amount. | min_usd, max_usd, up to 6 suggested_amounts |
Creating a link
Links can be created in the dashboard without code. To create them through the API, the invoices scope is enough:
curl -X POST https://hisarpay.com/v1/payment-links \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Design consultation",
"kind": "fixed",
"price_usd": "29.00"
}'
curl -X POST https://hisarpay.com/v1/payment-links \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Support us",
"kind": "open",
"min_usd": "10.00",
"suggested_amounts": [
"10.00",
"25.00",
"50.00"
]
}'const fixed = await hisarpay.paymentLinks.create({
title: 'Design consultation',
kind: 'fixed',
price_usd: '29.00',
});
const open = await hisarpay.paymentLinks.create({
title: 'Support us',
kind: 'open',
min_usd: '10.00',
suggested_amounts: ['10.00', '25.00', '50.00'],
});
console.log(open.url, open.qr_svg_url);$fixed = $hisarpay->paymentLinks->create([
'title' => 'Design consultation',
'kind' => 'fixed',
'price_usd' => '29.00',
]);
$open = $hisarpay->paymentLinks->create([
'title' => 'Support us',
'kind' => 'open',
'min_usd' => '10.00',
'suggested_amounts' => ['10.00', '25.00', '50.00'],
]);fixed = client.payment_links.create({
"title": "Design consultation",
"kind": "fixed",
"price_usd": "29.00",
})
open_link = client.payment_links.create({
"title": "Support us",
"kind": "open",
"min_usd": "10.00",
"suggested_amounts": ["10.00", "25.00", "50.00"],
}){
"id": 42,
"object": "payment_link",
"livemode": true,
"slug": "pl_7kQm2xPaW4",
"url": "https://hisarpay.com/l/pl_7kQm2xPaW4",
"qr_svg_url": "https://hisarpay.com/l/pl_7kQm2xPaW4/qr.svg",
"qr_png_url": "https://hisarpay.com/l/pl_7kQm2xPaW4/qr.png",
"title": "Support us",
"kind": "open",
"min_usd": "10.00",
"max_usd": null,
"suggested_amounts": ["10.00", "25.00", "50.00"],
"tokens": null,
"fee_paid_by_customer": null,
"active": true,
"expires_at": null,
"max_uses": null,
"ask": { "name": "off", "email": "optional", "note": "off", "note_label": null },
"archived_at": null,
"stats": { "uses": 18, "paid_count": 11, "paid_usd": "412.50" },
"created_at": "2026-10-20T08:12:44.000Z"
}Use tokens to choose which coins the link offers and success_url for where the customer lands after paying. fee_paid_by_customer sets who pays the commission on this link; null follows your account setting.
End, number of uses and what to ask the payer
A link can have an end and a number of uses, and it can ask the payer for a name, an e-mail address or a note before paying. You choose what the note is called (“Player name”, “Size”).
curl -X POST https://hisarpay.com/v1/payment-links \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"title": "Workshop",
"kind": "fixed",
"price_usd": "40.00",
"expires_at": "2027-06-01T18:30:00+03:00",
"max_uses": 24,
"ask": {
"email": "required",
"note": "optional",
"note_label": "Size"
}
}'await hisarpay.paymentLinks.create({
title: 'Workshop',
kind: 'fixed',
price_usd: '40.00',
expires_at: '2027-06-01T18:30:00+03:00',
max_uses: 24,
ask: { email: 'required', note: 'optional', note_label: 'Size' },
});$hisarpay->paymentLinks->create([
'title' => 'Workshop',
'kind' => 'fixed',
'price_usd' => '40.00',
'expires_at' => '2027-06-01T18:30:00+03:00',
'max_uses' => 24,
'ask' => ['email' => 'required', 'note' => 'optional', 'note_label' => 'Size'],
]);client.payment_links.create({
"title": "Workshop",
"kind": "fixed",
"price_usd": "40.00",
"expires_at": "2027-06-01T18:30:00+03:00",
"max_uses": 24,
"ask": {"email": "required", "note": "optional", "note_label": "Size"},
})| Field | Meaning |
|---|---|
expires_at | No new payment is started after it; open invoices can be paid until they run out. |
max_uses | Paid invoices count, and open ones for half an hour. A payment that arrives late is still accepted, so sales can exceed the limit. |
ask | off, optional or required for name, email and note; note_label names the note. |
archived | An archived link is not listed and takes no payments; take it out whenever you like. |
What the payer enters is in customer_email and payer of the invoice, and in the same place in webhooks. The payment page shows it to nobody. When an invoice of a link has run out, the payer opens another one for the same amount with one click; what they entered is kept.
QR codes
Every link has a QR code in SVG and PNG (qr_svg_url, qr_png_url). Use the SVG for print and the PNG for social media and messaging apps. The code carries the link’s address, so it keeps working when you change the price.
Updating and pausing
PATCH /v1/payment-links/{id} updates the title, price, description, coins and return address. kind cannot change later. active: false pauses a link; a paused link opens no new invoices.
curl -X PATCH https://hisarpay.com/v1/payment-links/42 \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"active": false
}'await hisarpay.paymentLinks.update(42, { active: false }); // pause
await hisarpay.paymentLinks.update(42, { active: true }); // resume$hisarpay->paymentLinks->update(42, ['active' => false]);client.payment_links.update(42, {"active": False})Tracking payments
- Every invoice opened from a link carries the link’s id in
payment_link_idand its slug inmetadata.payment_link. Webhooks arrive just like for other invoices. statsshows how often the link was used (uses), how many payments completed (paid_count) and the total collected (paid_usd).