Cancel an open balance link
const url = 'https://quikstik-core.fly.dev/balance-links/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancellation';const options = { method: 'POST', headers: { 'x-idempotency-key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"reason":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://quikstik-core.fly.dev/balance-links/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancellation \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-idempotency-key: example' \ --data '{ "reason": "example" }'Session bearer ONLY. Requires x-idempotency-key. One transaction: open → cancelled and
the commerce.balance_link.cancelled outbox event carrying the reason. A repeat on an
already-cancelled link is 200 with already_cancelled: true and writes no second event. A
paid or expired link is 409 not_open (the body names which) and is untouched. No money
moves and the guest is not emailed. Afterwards GET /b/{token} answers 410 link_cancelled.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
Example generated
{ "reason": "example"}Responses
Section titled “Responses”Cancelled now, or already cancelled (idempotent).
object
Example
{ "status": "cancelled"}Idempotency_key_required.
Missing/invalid session, or an operator key (not accepted here).
No membership in the tenant.
Balance_link_not_found (unknown, or another tenant’s).
Not_open — the link is paid or expired.
object
Example
{ "reason": "not_open", "status": "paid"}Invalid_link_id, reason_required, or reason_too_long.
Backend unavailable; the transaction rolled back, safe to retry.