Mint a single-use link that collects an obligation's live balance
const url = 'https://quikstik-core.fly.dev/obligations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/balance-links';const options = { method: 'POST', headers: { 'x-idempotency-key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"expires_in_hours":1,"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/obligations/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/balance-links \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'x-idempotency-key: example' \ --data '{ "expires_in_hours": 1, "reason": "example" }'Session bearer ONLY — writes are never operator-key. Requires x-idempotency-key.
Replaces the hand-cut processor-dashboard payment link: the returned url is a core-issued
/b/{token} page on which the guest, present with a card, pays exactly the obligation’s
LIVE balance (read at render and again at pay; the link stores no amount). The token is
stored only as its SHA-256; the plaintext is returned once, here, inside url.
Minting again for the same obligation cancels the previous open link in the same
transaction (a commerce.balance_link.cancelled event with superseded: true), so a
guest never holds two live links. Repeating the same x-idempotency-key is 200 with the
stored link and url: null — the plaintext is not recoverable.
Refuses 409 nothing_owed when the balance is zero and 409 obligation_not_open when
the booking behind the obligation is cancelled or refunded. No money moves at mint.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Body
Section titled “Request Body”object
Lifetime in hours; defaults to (and is capped at) 14 days.
Example generated
{ "expires_in_hours": 1, "reason": "example"}Responses
Section titled “Responses”Replay of an earlier mint with the same idempotency key; url is null.
object
The canonical /b/{token} page URL, carrying the one-time plaintext token. Null on a
replay of the same idempotency key — only the token’s hash is stored.
Present on a replay only.
Present (true) on a replay only.
Example
{ "status": "open"}Link minted. url carries the one-time token.
object
The canonical /b/{token} page URL, carrying the one-time plaintext token. Null on a
replay of the same idempotency key — only the token’s hash is stored.
Present on a replay only.
Present (true) on a replay only.
Example
{ "status": "open"}Idempotency_key_required.
Missing/invalid session, or an operator key (not accepted here).
No membership in the tenant.
Obligation_not_found (unknown, or another tenant’s).
Nothing_owed, obligation_not_open, or idempotency_key_reused.
object
Example
{ "reason": "nothing_owed"}Invalid_obligation_ref, expires_in_hours_invalid, expires_in_hours_too_long, or reason_too_long.
Backend unavailable; the transaction rolled back, safe to retry.