Payment Links
Overview
Section titled “Overview”A payment link is a checkout page Baiyar hosts for you. You create it with
one API call and get back a url — send that to the customer (chat, email,
invoice, QR poster) and they complete payment there. You don’t render any
payment UI yourself.
This is different from a direct payment, where you render the QRIS code or virtual account number in your own app.
How it works
Section titled “How it works”- You call
POST /v1/payment-linkswith anamountand, optionally, which payment methods to allow. - The customer opens the returned
url, picks a payment method, and pays. - Baiyar reports the outcome via a webhook (
payment.paidorpayment.failed) if you’ve configured one — or you can pollGET /v1/payments/{paymentID}.
Creating a payment link
Section titled “Creating a payment link”POST /v1/payment-links{ "project_id": "018f1f29-7c00-73e4-a310-744d2167fc60", "reference": "ORDER-2026-0001", "title": "Invoice August", "description": "Monthly subscription payment", "amount": 125000, "allowed_payment_methods": [ { "type": "qris" }, { "type": "virtual_account", "bank": "bca" } ], "allow_multiple_payments": true, "customer_fields": { "name": true, "email": true, "phone": false, "address": false }}amountis in IDR (whole rupiah — there’s no smaller unit to divide into). The minimum is 100 forqrisand 10,000 forvirtual_account; when a link allows both, the higher floor applies.allowed_payment_methodsis optional — omit it to use the project’s default payment methods.allow_multiple_payments: truekeeps the link reusable (e.g. a donation link) instead of deactivating it after the first payment.
See the Payment Links API reference for every field.
Link lifecycle
Section titled “Link lifecycle”A payment link’s status is one of:
| Status | Meaning |
|---|---|
active |
Payable now — a single-use link stays active even after its one payment succeeds; claim-ability is enforced by the payment session, not by this field flipping |
cancelled |
Cancelled via POST /v1/payment-links/{id}/cancel |
inactive |
Past its expires_at |
See Payment Statuses for how to tell whether a single-use link has actually been paid.
When to use payment links
Section titled “When to use payment links”- Selling one-off items or sending an invoice without building a checkout flow.
- You don’t want to handle QR rendering, virtual account display, or polling/webhook wiring for payment status in your own UI.
For more control over the payment UI itself, see Direct Payments.
Handling payment completion
Section titled “Handling payment completion”Set a webhook URL on the project (dashboard → Project → Notifications tab) to get notified the moment a payment is paid or fails, instead of polling — see Webhooks.