What a Checkout came to
const url = 'https://api.sloose.com/orgs/org_9f3c/billing/checkout/cs_test_a1';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.sloose.com/orgs/org_9f3c/billing/checkout/cs_test_a1 \ --header 'Authorization: Bearer <token>'For the page Stripe returns the customer to (/orgs/{org}/billing/done?session_id=…): what was bought, what was charged today and with what, what is charged next, and whether Sloose has taken it into the organisation yet (applied).
Read only. It asks Stripe and fulfils nothing: a plan is recorded and a pack’s credits granted by Stripe’s webhook alone, whatever this finds.
Session only, and an administrator’s, as a Checkout is.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation id the session was issued for. A token for one organisation can never read another.
Example
org_9f3cThe organisation id the session was issued for. A token for one organisation can never read another.
The Checkout session’s id, as Stripe returned it.
Example
cs_test_a1The Checkout session’s id, as Stripe returned it.
Responses
Section titled “Responses”What the Checkout came to.
object
paid: complete and paid, or complete with nothing to pay because a discount took the whole price. card_saved: a plan chosen during the organisation’s own trial — its subscription is on a trial that has not ended, the card was taken and is charged when the trial ends (firstChargeOn), whatever Stripe says of the trial’s own $0 invoice. open: not finished, or finished with a payment Stripe has not yet confirmed. expired: it ran out unfinished; nothing was charged.
The plan, for kind: plan.
object
The limits of the plan version the Checkout bought (the version it pinned), in the catalogue’s shape — not the plan’s current version, which may have changed while the Checkout was open. Null when the Checkout names no version Sloose holds.
object
CRM users allowed to use the widget; null = unlimited.
Connections the organisation may hold — a sandbox is a connection like any other; null = unlimited. A file is not one.
Import runs per period, each counted once at the first row it sends to be written, whether or not the CRM takes that row; null = unlimited (fair use). Dry runs never count, and neither does a free retry (Retry failed of a run with failed rows, at most three in a row, each spent at its first admitted row: one that ends having admitted none is given back) while the rows it writes are its chain’s: one that writes a row new to its chain past the rows the chain was counted for is counted at that row. This is judged by key only while the chain’s keys are kept: a day after the chain last ran, or for a chain begun before keys were kept, a link’s rows are judged by the count it declared instead, as they were before, and no run is counted at a later row.
Imports that may be running in the organisation at once, dry runs aside; null or absent = no limit. A run past it is refused at authorise with LIMIT_RUNS_CONCURRENT.
The most rows one import set may declare. Checked before anything is written.
Server-side runs only. Browser runs are never refused on it.
USD per 1,000 rows beyond rows_per_month, server-side runs only; null = not offered.
Bytes of uploaded files the organisation may hold at once; null = no limit, absent = the plan offers no files. Checked when an upload is reserved: past it, only NEW uploads are refused, with LIMIT_FILES_BYTES; nothing stored is deleted early.
Days a stored file is kept after its last use (a run that used it, naming it in a sheet, or its upload); absent = the longest any plan keeps one.
The credit pack, for kind: credit_pack.
object
Every pack bought, together.
What the card was charged, tax and any discount included, after any customer balance Stripe applied (the invoice’s amount_paid, a pack’s payment received): paid only.
object
Minor units (cents) of currency.
ISO 4217, lower case, as Stripe writes it.
The customer’s credit balance Stripe applied to today’s invoice, which chargedToday has already taken off. Null when none was.
object
Minor units (cents) of currency.
ISO 4217, lower case, as Stripe writes it.
Today’s charge before any discount or tax, as Stripe reckoned it (amount_subtotal): paid only. With tax added on top, chargedToday is this, less discount.amountOff, plus tax.
object
Minor units (cents) of currency.
ISO 4217, lower case, as Stripe writes it.
The tax in today’s charge (total_details.amount_tax): paid only.
object
Minor units (cents) of currency.
ISO 4217, lower case, as Stripe writes it.
What a promotion code or coupon took off today’s charge. Null when nothing was, or when what took it off has no words to show (a coupon nobody named): chargedToday has it taken off either way.
object
The words Checkout showed for it: the promotion code the customer typed, or the coupon’s name.
code: a promotion code the customer typed. coupon: a coupon applied without one, said by its name, which nobody typed.
Minor units, of chargedToday’s currency.
For card_saved: the day the plan is first charged, which is the trial’s end.
The plan’s next charge as Stripe previews it, tax included: the first after a trial, or the renewal. Null for a pack, for a subscription set to end, and when Stripe would not preview it.
object
Minor units (cents) of currency.
ISO 4217, lower case, as Stripe writes it.
The card the Checkout used: what paid it, or for card_saved the card it set up to be charged at the trial’s end (its SetupIntent’s) — not the subscription’s current default, which a later change of card moves, save where the Checkout set up none. Null for a wallet or bank that names none, and for a plan paid by nothing (nothing was due).
object
Stripe’s own page for what was paid: a plan’s hosted invoice, a pack’s receipt.
Whether Sloose has taken it into the organisation yet: the subscription linked and the organisation on it (off the trial a paid Checkout ends, or on its trial with the plan to follow), or the pack’s credits granted. Once true it stays true: a renewal that fails later does not take it back. Stripe sends the customer back at once and its events can land after them, so a page reads again until this is true.
Example
{ "kind": "plan", "state": "paid", "plan": { "interval": "month" }, "discount": { "kind": "code" }}No bearer, or one that no longer resolves: a session that is unknown or expired (code: AUTH_REQUIRED), or an API token that was revoked or expired (TOKEN_REVOKED, TOKEN_EXPIRED), whose organisation is gone (ORG_NOT_FOUND) or whose member or user row is (MEMBERSHIP_GONE).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}The bearer’s role is too low, it was issued for a different organisation, or it is an API token (SESSION_REQUIRED). Like every route behind a session: a session signed in but in no organisation is refused code: NO_ORG, a banned person code: BANNED, and a closed organisation code: ORG_CLOSED.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}No such Checkout of this organisation (CHECKOUT_NOT_FOUND): Stripe holds none by that id, or it was made for another organisation, which is answered the same way.
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}Stripe refused or was unavailable (PAYMENT_PROVIDER_REFUSED, PAYMENT_PROVIDER_UNAVAILABLE), so what the Checkout came to could not be read; nothing was changed. Stripe’s own words are logged, not returned.
object
Example
{ "code": "PAYMENT_PROVIDER_REFUSED"}Stripe is not configured on this deployment. Or the restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, with Retry-After (the operator’s ADMIN_TOKEN alone is let through to POST /staff/people/{id}/delete, and to nothing else).
Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).