Skip to content

Payment Links

See the Payment Links guide for the concept and lifecycle.

Creates a hosted checkout page for a fixed amount.

POST/v1/payment-links

Requires an API key — see Authentication.

Authorization: Bearer sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Field Type Required Description
project_id string Yes Must match the API key’s own project
title string Yes Shown to the customer on the checkout page
amount integer Yes IDR, whole rupiah. Minimum 100 for qris, 10,000 for virtual_account (the higher floor applies if both are allowed)
reference string No Your own order/invoice ID. Auto-generated when omitted
description string No Shown below the title
expires_at date-time No Must be in the future
allowed_payment_methods array No Restricts the link to a subset of methods. Omit to use the project defaults
allow_multiple_payments boolean No Default false. If true, the link stays reusable instead of deactivating after the first payment
customer_fields object No Which of name/email/phone/address the checkout page collects
Terminal window
curl https://api.baiyar.id/v1/payment-links \
-H "Authorization: Bearer sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"project_id": "018f1f29-7c00-73e4-a310-744d2167fc60",
"title": "Invoice August",
"amount": 125000,
"allowed_payment_methods": [{ "type": "qris" }, { "type": "virtual_account", "bank": "bca" }]
}'
{
"id": "018f1f29-8a10-73e4-a310-744d2167fc90",
"project_id": "018f1f29-7c00-73e4-a310-744d2167fc60",
"merchant_name": "Zara Store",
"reference": "001/P/IX/26",
"title": "Invoice August",
"description": "",
"amount": 125000,
"currency": "IDR",
"fee_bearer": "merchant",
"fee_previews": [
{ "payment_method": { "type": "qris" }, "fee_amount": 875, "customer_amount": 125000, "merchant_net": 124125 },
{ "payment_method": { "type": "virtual_account", "bank": "bca" }, "fee_amount": 6000, "customer_amount": 125000, "merchant_net": 119000 }
],
"allowed_payment_methods": [{ "type": "qris" }, { "type": "virtual_account", "bank": "bca" }],
"allow_multiple_payments": false,
"customer_fields": { "name": false, "email": false, "phone": false, "address": false },
"status": "active",
"created_at": "2026-09-02T08:00:00Z",
"url": "https://checkout.baiyar.id/p/018f1f29-8a10-73e4-a310-744d2167fc90"
}
Status Code Meaning
400 VALIDATION_ERROR A field failed validation (see error.message)
401 UNAUTHORIZED Missing or invalid API key
403 FORBIDDEN The project isn’t usable right now
404 PROJECT_NOT_FOUND No such project, or it belongs to a different API key
GET/v1/payment-links

Paginated, scoped to the API key’s project.

Parameter Type Description
page integer Defaults to 1
page_size integer 1–100, defaults to 20
search string Matches title/reference
{
"data": [ /* Payment Link objects, as above */ ],
"pagination": { "page": 1, "page_size": 20, "total_items": 3, "total_pages": 1 }
}
GET/v1/payment-links/{paymentLinkID}

Returns 404 if the link doesn’t exist or belongs to a different project than the API key’s.

POST/v1/payment-links/{paymentLinkID}/cancel

Deactivates the link immediately — no request body. Returns 409 if the link isn’t currently active.