Payment links
Cancel a payment link
Cancels a payment link that hasn't been paid, so your customer can no longer pay it.
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.
Headers
Section titled “Headers”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_.
Response
Section titled “Response”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"}{ "error": { "code": "payment_link_not_found", "message": "No payment link with this ID belongs to this business." }}{ "error": { "code": "payment_link_not_cancelable", "message": "This payment link is paid or being paid, so it can't be canceled." }}{ "error": { "code": "provider_unavailable", "message": "The payment provider couldn't handle the request. Try again." }}