Skip to content

Payment links

Create a payment link in the dashboard or with the API, share its URL, and follow it with webhooks. No checkout page to build.


A payment link is a checkout page where the payer chooses an available method and pays. Share its URL; Baiyar displays the payment instructions and records the result.

  1. Choose Payment links in the menu and then Create a payment link. A link lives in a project, so create a project first if you have none.

    Payment links before the first one is created.

  2. Fill in the essentials: the title the payer sees (a product name or an invoice number), an optional description, and the amount: a fixed amount, or let the payer enter it between a minimum and a maximum. What the payer sees changes beside the form while you type.

    The payment link editor with the page the payer will see on the right.

  3. Open the advanced options if you need them: Allow multiple payments (a reusable link, optionally capped), Valid until (no time limit, tomorrow, 7 or 14 days, or a date), the payer details to ask for (name, email, phone, address), who bears the fee (use the project default, charge you, or charge the payer) and your own reference.

    The advanced options of a link.

  4. Create it. The next screen is Your link is ready to share: Copy link, Download QR, Share on WhatsApp, or Open as a payer to see what your customer sees.

    The link is ready to share: copy it, download its QR code, share it on WhatsApp or open it as a payer.

A link cannot be edited after creation. Choose Duplicate to make a new version. The fee rules are fixed when you create the link, so later Baiyar price changes do not affect it.

Choose Cancel link to stop new payments. A payment already opened from the link can still be completed. The link page and Transactions show those payments.

The payer opens the link, usually on a phone. They see the amount and the methods you offer, then the QR code or the virtual account number, then a receipt. In the sandbox a bar at the bottom lets you decide how the test payment ends.

What the payer sees first: the amount, their details and the methods to choose from. The QRIS code with the time left to pay. The receipt after the payment succeeds.

The list of links with their states.

To bill a customer with items, tax and a due date, use an invoice.

Create a link with POST, share the returned url, and use GET to check its state. You can also cancel it. See the API reference for create, get and cancel.

Terminal window
curl "https://api.baiyar.com/v1/payment-links" \
-H "Authorization: Bearer $BAIYAR_KEY" \
-H "Idempotency-Key: invoice-2041" \
-H "Content-Type: application/json" \
-d '{
"title": "Invoice 2041",
"amount": 25000000,
"usage": "single_use",
"fee_bearer": "merchant"
}'

This example assumes BAIYAR_KEY is a project key. With a merchant key, include the link’s project_id in the request. The response contains the url to share, the current state and usage stats.

Field Meaning
amount A fixed amount. Or use min_amount and max_amount and let the payer type an amount within that range. Amounts use IDR’s smallest unit: Rp25.000 is 25000000.
usage single_use: one payment, then the link is done. reusable: many payments, optionally capped by max_uses.
max_uses The cap on payments for a reusable link. Open and paid payments both count.
payment_methods Which methods the payer may choose. By default every method of the project.
fee_bearer merchant: you pay the fee. customer: the fee is added for the payer. If omitted, the project setting applies. The fee is fixed when the link is made, so a later price change does not change it.
customer_fields Whether to ask for name, email, phone and address: off, optional or required. Unspecified fields default to off.
expires_at When the link stops accepting payments, in ISO 8601.
after_payment, redirect_url, confirmation_message Choose Baiyar’s confirmation page (the default) or a redirect to your site. redirect_url sets the destination; confirmation_message sets the text on the confirmation page.
reference Your own reference. Make one up if you leave it out.
  • GET /v1/payment-links/{id} shows its state (payable, in_use, completed, expired or cancelled) and how many payments it has.
  • Each payment through the link is a normal payment with payment_link_id set, so payment.succeeded webhooks work as usual. The link itself sends payment_link.completed, payment_link.expired and payment_link.cancelled.
  • POST /v1/payment-links/{id}/cancel stops new payments; payments already made stay.

A single-use link accepts one open payment at a time, so two payers cannot pay the same link at once.