Skip to content
HisarPay

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

kindUse it forFields
fixedSelling a product or service: everyone pays the same.price_usd
openDonations, 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"
    ]
  }'
201 Created
{
  "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"
    }
  }'
FieldMeaning
expires_atNo new payment is started after it; open invoices can be paid until they run out.
max_usesPaid invoices count, and open ones for half an hour. A payment that arrives late is still accepted, so sales can exceed the limit.
askoff, optional or required for name, email and note; note_label names the note.
archivedAn 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
  }'

Tracking payments

  • Every invoice opened from a link carries the link’s id in payment_link_id and its slug in metadata.payment_link. Webhooks arrive just like for other invoices.
  • stats shows how often the link was used (uses), how many payments completed (paid_count) and the total collected (paid_usd).