Skip to content

Payment links

Cancel a payment link

Cancels a payment link that hasn't been paid, so your customer can no longer pay it.

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

The checkout then shows “Link expired”. Canceling a link that is already canceled returns it unchanged, so a retry is safe. A link that is processing or paid can’t be canceled.

Authorization string header required

Your API key as a bearer token: Bearer cyan_test_.... See Authentication.

id string path required

The payment link’s ID. It starts with pl_.

Returns 200 with the payment link, now canceled. The request has no body. Any other status comes with an error: see Errors.

id string

The link’s ID.

status string

canceled.

The other fields are the same as on the payment link.

Cancel a payment link
const response = await fetch(
"https://api.cyan.cash/v1/payment-links/pl_019d0a1b2c3d4e5f60718293a4b5c6d7/cancel",
{
method: "POST",
headers: {
Authorization: "Bearer cyan_test_...",
},
},
);
const link = await response.json();
{
"id": "pl_019d0a1b2c3d4e5f60718293a4b5c6d7",
"amount": 4900,
"currency": "USD",
"description": "Logo design",
"customer_name": null,
"status": "canceled",
"url": "https://pay.cyan.cash/pl_019d0a1b2c3d4e5f60718293a4b5c6d7",
"created_at": "2026-12-05T17:40:12.000Z"
}