Skip to content

Cancel a payment link

Stops the link from accepting new payments. Payments already made remain unchanged.


POST/v1/payment-links/{id}/cancel
Requires payments:write permission.
Idempotency-Keystringrequired

Example: order-1001-attempt-1

Required. A unique string for this request. See Idempotency.

idstringrequired

The id of the payment link (lnk_…).

Example: lnk_01k7q3m8x2v5t9n4b6c1d0e7fa

Prefixed with lnk_.

dataobjectrequired

The returned object, or an array of objects for a list.

idstringrequired

The id of the payment link (lnk_…).

Example: lnk_01k7q3m8x2v5t9n4b6c1d0e7fa

Prefixed with lnk_.

livemodebooleanrequired

true means this object belongs to live and can involve real payments; false means it belongs to the sandbox.

project_idstringrequired

The project this object belongs to. Its settings determine which payment methods and limits apply.

Example: prj_01k7q3m8x2v5t9n4b6c1d0e7fa

Prefixed with prj_.

urlstringrequired

The checkout address for this link. Share it with the payer so they can choose a method and pay.

Example: https://pay.baiyar.com/p/lt_live_…

titlestringrequired

The name shown to the payer, such as a product name or invoice number.

Example: Paket Kopi Senja

descriptionstring | nullrequired

A longer note on the payment page; optional.

Example: Dua bungkus biji kopi 250 gram.

referencestringrequired

Your own reference for the link. Made for you when left out.

Example: INV-2041

statestringrequired

payable, in_use (a payment is under way), completed, cancelled or expired.

Example: payable

Possible values: payable, in_use, completed, cancelled, expired

amount_modestringrequired

fixed (you set the amount) or open (the payer enters it between the minimum and the maximum).

Example: fixed

Possible values: fixed, open

amountinteger | nullrequired

Base amount of each payment before fees, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 2500000

min_amountinteger | nullrequired

The minimum amount a payer can enter for an open-amount link, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 1000000

max_amountinteger | nullrequired

The maximum amount a payer can enter for an open-amount link, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 100000000

currencystringrequired

The currency, an ISO 4217 code. Only IDR today.

Example: IDR

Value: IDR

usagestringrequired

single_use accepts one payment; reusable accepts multiple payments. Defaults to single_use.

Example: single_use

Possible values: single_use, reusable

max_usesinteger | nullrequired

Maximum number of payments in progress or paid before the link stops accepting new payments. Null means there is no limit.

Example: 1

fee_bearerstringrequired

Who bears Baiyar's fee: merchant takes it out of what you receive, customer adds it to what the payer pays.

Example: merchant

Possible values: merchant, customer

customer_fieldsobjectrequired

Controls which details checkout asks the payer for. Unspecified fields default to off.

namestringrequired

Whether checkout asks for the payer's name: off, optional (the payer can skip it) or required.

Example: required

Possible values: off, optional, required

emailstringrequired

Whether checkout asks for the payer's email: off, optional (the payer can skip it) or required.

Example: required

Possible values: off, optional, required

phonestringrequired

Whether checkout asks for the payer's phone number: off, optional (the payer can skip it) or required.

Example: off

Possible values: off, optional, required

addressstringrequired

Whether checkout asks for the payer's address: off, optional (the payer can skip it) or required.

Example: off

Possible values: off, optional, required

expires_atstring | nullrequired

When the link stops taking payments; null for no end.

Example: 2026-10-26T03:04:05.000Z

Format: date-time

redirect_urlstring | nullrequired

Where the payer goes after paying, when after_payment is redirect. Must be HTTPS.

Example: https://toko.example.com/terima-kasih

after_paymentstringrequired

confirmation shows Baiyar's confirmation page; redirect sends the payer to redirect_url. Defaults to confirmation.

Example: confirmation

Possible values: confirmation, redirect

confirmation_messagestring | nullrequired

Your own words on the confirmation page; optional.

Example: Terima kasih! Pesananmu dikirim dalam 2 hari.

methodsarray of objectrequired

The methods of the link with the fee rule locked when it was made.

payment_methodstringrequired

Payment method offered by this link, for example QRIS or BCA virtual account.

Example: payment.qris

feeobjectrequired

The fee rule locked into the link; a price change later does not touch it.

flat_amountinteger | nullrequired

The fixed part of the fee, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 25000

percentnumber | nullrequired

Percentage added to the flat fee; 0.7 means 0.7%. Null means there is no percentage part.

Example: 0.7

tiersarray of objectrequired

Fee rules by amount. A tier applies only when the payment amount is strictly above its above_amount threshold.

above_amountintegerrequired

The step applies to amounts above this, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 10000000

flat_amountinteger | nullrequired

The fixed part of the fee in this step, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 0

percentnumber | nullrequired

Percentage added to this tier's flat fee; 0.7 means 0.7%.

Example: 0.7

settlement_daysinteger | nullrequired

Days after payment until the money is available.

Example: 1

previewobject | nullrequired

What the method would cost at the link's amount; null for a link where the payer enters the amount.

amountintegerrequired

Base amount used for this method's fee estimate, before fees, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 2500000

fee_amountintegerrequired

Estimated Baiyar fee for this method and amount, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 42500

charged_amountintegerrequired

Total the payer is expected to pay, including the fee when the payer bears it, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 2500000

net_amountintegerrequired

Estimated amount credited to your balance after the Baiyar fee, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 2457500

statsobjectrequired

Payment counts and net amount recorded for this link.

paid_countintegerrequired

Number of payments made through this link that reached paid status.

Example: 1

open_countintegerrequired

Number of payments made through this link that are still waiting for the payer.

Example: 0

paid_net_amountintegerrequired

What the paid ones net, in the smallest unit of currency (Rp125.000 is 12500000).

Example: 2457500

cancelled_atstring | nullrequired

When it was cancelled; null otherwise.

Example: 2026-10-26T03:04:05.000Z

Format: date-time

created_atstringrequired

When this object was created (RFC 3339, UTC). Use it to sort objects by creation time.

Example: 2026-10-26T03:04:05.000Z

Format: date-time

metaobjectrequired

Request details such as its id and pagination cursor.

request_idstringrequired

The id of this request. Quote it when you ask support about it.

Example: req_Hy3k9QzT2LmN8vXa

A failed request answers with the common error shape; see Errors.

curl -X POST "https://api.baiyar.com/v1/payment-links/{id}/cancel" \
-H "Authorization: Bearer $BAIYAR_KEY" \
-H "Idempotency-Key: order-1001-attempt-1"