Payment Links
See the Payment Links guide for the concept and lifecycle.
Create a Payment Link
Section titled “Create a Payment Link”Overview
Section titled “Overview”Creates a hosted checkout page for a fixed amount.
POST
/v1/payment-linksAuthentication
Section titled “Authentication”Requires an API key — see Authentication.
Authorization: Bearer sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxRequest body
Section titled “Request body”| 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 |
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" }] }'const response = await fetch("https://api.baiyar.id/v1/payment-links", { method: "POST", headers: { Authorization: "Bearer sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ project_id: "018f1f29-7c00-73e4-a310-744d2167fc60", title: "Invoice August", amount: 125000, allowed_payment_methods: [{ type: "qris" }, { type: "virtual_account", bank: "bca" }], }),});import requests
response = requests.post( "https://api.baiyar.id/v1/payment-links", headers={"Authorization": "Bearer sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, json={ "project_id": "018f1f29-7c00-73e4-a310-744d2167fc60", "title": "Invoice August", "amount": 125000, "allowed_payment_methods": [{"type": "qris"}, {"type": "virtual_account", "bank": "bca"}], },)body := strings.NewReader(`{"project_id":"018f1f29-7c00-73e4-a310-744d2167fc60","title":"Invoice August","amount":125000,"allowed_payment_methods":[{"type":"qris"},{"type":"virtual_account","bank":"bca"}]}`)req, _ := http.NewRequest("POST", "https://api.baiyar.id/v1/payment-links", body)req.Header.Set("Authorization", "Bearer sk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")req.Header.Set("Content-Type", "application/json")resp, err := http.DefaultClient.Do(req)Response
Section titled “Response”{ "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"}Errors
Section titled “Errors”| 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 |
List Payment Links
Section titled “List Payment Links”GET
/v1/payment-linksPaginated, scoped to the API key’s project.
Query parameters
Section titled “Query parameters”| Parameter | Type | Description |
|---|---|---|
page |
integer | Defaults to 1 |
page_size |
integer | 1–100, defaults to 20 |
search |
string | Matches title/reference |
Response
Section titled “Response”{ "data": [ /* Payment Link objects, as above */ ], "pagination": { "page": 1, "page_size": 20, "total_items": 3, "total_pages": 1 }}Get a Payment Link
Section titled “Get a Payment Link”GET
/v1/payment-links/{paymentLinkID}Returns 404 if the link doesn’t exist or belongs to a different project
than the API key’s.
Cancel a Payment Link
Section titled “Cancel a Payment Link”POST
/v1/payment-links/{paymentLinkID}/cancelDeactivates the link immediately — no request body. Returns 409 if the
link isn’t currently active.