Skip to content

What a Checkout came to

GET
/orgs/{org}/billing/checkout/{sessionId}
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.

org
required

The organisation id the session was issued for. A token for one organisation can never read another.

string
Example
org_9f3c

The organisation id the session was issued for. A token for one organisation can never read another.

sessionId
required

The Checkout session’s id, as Stripe returned it.

string
Example
cs_test_a1

The Checkout session’s id, as Stripe returned it.

What the Checkout came to.

Media typeapplication/json
object
kind
required
string
Allowed values: plan credit_pack
state
required

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.

string
Allowed values: paid card_saved open expired
plan

The plan, for kind: plan.

object
key
required
string
name
required
string
interval
required
string
Allowed values: month year
limits
required

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_max
required

CRM users allowed to use the widget; null = unlimited.

number | null
connections_max
required

Connections the organisation may hold — a sandbox is a connection like any other; null = unlimited. A file is not one.

number | null
runs_per_month
required

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.

number | null
runs_concurrent

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.

number | null
rows_per_run
required

The most rows one import set may declare. Checked before anything is written.

number
rows_per_month
required

Server-side runs only. Browser runs are never refused on it.

number
row_overage_per_1000
required

USD per 1,000 rows beyond rows_per_month, server-side runs only; null = not offered.

number | null
schedules_max
required
number
history_days
required
number
ai_credits_monthly
required
number
files_bytes

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.

number | null
files_keep_days

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.

number
pack

The credit pack, for kind: credit_pack.

object
key
required
string
credits
required

Every pack bought, together.

integer
chargedToday
required

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
amount
required

Minor units (cents) of currency.

integer
currency
required

ISO 4217, lower case, as Stripe writes it.

string
balanceApplied
required

The customer’s credit balance Stripe applied to today’s invoice, which chargedToday has already taken off. Null when none was.

object
amount
required

Minor units (cents) of currency.

integer
currency
required

ISO 4217, lower case, as Stripe writes it.

string
subtotal
required

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
amount
required

Minor units (cents) of currency.

integer
currency
required

ISO 4217, lower case, as Stripe writes it.

string
tax
required

The tax in today’s charge (total_details.amount_tax): paid only.

object
amount
required

Minor units (cents) of currency.

integer
currency
required

ISO 4217, lower case, as Stripe writes it.

string
discount
required

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
code
required

The words Checkout showed for it: the promotion code the customer typed, or the coupon’s name.

string
kind
required

code: a promotion code the customer typed. coupon: a coupon applied without one, said by its name, which nobody typed.

string
Allowed values: code coupon
amountOff
required

Minor units, of chargedToday’s currency.

integer
firstChargeOn
required

For card_saved: the day the plan is first charged, which is the trial’s end.

string | null
nextCharge
required

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
amount
required

Minor units (cents) of currency.

integer
currency
required

ISO 4217, lower case, as Stripe writes it.

string
on
required
string
card
required

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
brand
required
string
last4
required
string
receiptUrl
required

Stripe’s own page for what was paid: a plan’s hosted invoice, a pack’s receipt.

string | null
applied
required

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.

boolean
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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: PAYMENT_PROVIDER_REFUSED PAYMENT_PROVIDER_UNAVAILABLE
key
additional properties
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).

Media typeapplication/json
One of:
object
error
required
string
code
required
string
Allowed values: STRIPE_NOT_CONFIGURED
key
additional properties
Example
{
"code": "STRIPE_NOT_CONFIGURED"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com