The billing page in one call
const url = 'https://api.sloose.com/orgs/org_9f3c/billing/summary';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/summary \ --header 'Authorization: Bearer <token>'Subscription, plan, limits, balance, usage, open notices and the purchasable credit packs.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
Responses
Section titled “Responses”The org’s billing state.
Everything the billing page renders, in one call.
object
False on a deployment without Stripe keys; the UI hides purchase paths.
object
Until when a change of plan holds the org’s history (#330): for thirty days after the plan last changed, nothing past the plan’s history_days is retired — runs, AI conversations or imports — so a move down never takes what the org already had that night. Null when no change of plan holds anything now. A suspension’s own date is dataRetainedUntil.
Whether this org has had its trial — one per org, running or over. No trial is offered after one (#729).
The AI credits the trial running now granted, once, for its whole length; null when none is running. What Plan says beside the plan’s monthly credits (#1460): a trial of Business is not Business’s month.
object
object
CRM users allowed to use the widget; null = unlimited.
Connections the org 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).
Imports that may be running in the org 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.
object
The AI credits a paid month of this plan version grants, before any staff override: what an invoice grants (limits carries the org’s resolved allowance, overrides applied). What Usage & credits names beside a trial’s own grant (#1560).
A plan change that takes effect at the next renewal.
object
The interval it bills from the renewal; null when it is not known. A move from a year to a month on the same plan names that plan, and this says what changes (#1310).
Its list price on that interval, in the currency’s smallest unit, before tax: what Plan says it moves to (#330 PR 3b). Null when the interval is not known.
object
Whether the plan offers overage at all.
object
Whether the owner and administrators are told — a credits_low notice and its mail — when the credits the org holds (included and purchased) fall below threshold. Nothing is ever charged by it: the notice links to the pack, whose Checkout offers again a card a buyer chose to save with an earlier pack.
Tell them when the credits the org holds fall below this.
The most a threshold may be: what a page bounds its box by.
The pack the notice offers; null is the smallest on sale — and so is a pack chosen before that is no longer on sale, which reads as null.
AI credits. Included credits reset each period; purchased ones do not.
object
Included + purchased − reserved
object
Runs counted this period, through any of the org’s connections: each once, at the first row it sent to be written, whether or not the CRM took that row.
An annual subscription is metered in months of its term (#1369), and usage is this month: this is the term so far, every month of it summed. Null for a monthly one, whose month is its period.
object
What the org holds against its plan (#552): its connections as connections_max counts them — distinct tenants, active and the org’s — and the size of its largest connected CRM against crm_users_max, which is a warning (LIMIT_CRM_USERS), never a limit.
object
object
Null is unlimited.
object
Active users of the largest connected CRM; null when no connection has said.
Each enforced limit the org is past, connections then runs (#330): a move down, or a trial’s end, may leave an org holding more than its plan allows, and only what would grow it is refused. Empty when nothing is over. CRM users are never over: theirs is a warning.
object
The notices shown now, to whoever is asking: open, not dismissed by them (the three-day warning of a trial’s end comes back a day after it is), and still true of the org. Each names the settings page it is shown on — the page its email names — and whether it may be dismissed.
A notice as it is shown: these fields and no others. What the product keeps to act on a notice is not handed on — a failed payment’s invoice page included, which the org’s standing gives only to a person who may pay it.
object
When the person asking dismissed it, or null: dismissing is each person’s own (#729).
The settings page the notice is shown on, which is the page its email names (Plan, or Usage & credits).
Whether a person may dismiss it. The trial’s end is not dismissed but said on Plan for as long as it is true.
object
False until the pack has a Stripe price attached.
The zone the notices’ deadlines are named in, as their emails and the org’s banner name them: the org’s own (Settings → General), or UTC when it has none.
How many requests to pay by invoice the org has made, counted in the statement that found invoiceRequest (#1478). A page holding this summary compares it with the request’s own place, which the answer to POST …/billing/invoice-request carries (#1532), to know which of the two was read first: fewer, and this summary was read before that request was made; as many, after it, with invoiceRequest saying whether it still waits; more, after another was made since.
Example
{ "subscription": { "status": "free" }, "plan": { "key": "free" }, "scheduledPlan": { "key": "free", "interval": "month" }, "overPlan": [ { "limit": "connections" } ], "warnings": [ "LIMIT_ROWS" ], "notices": [ { "page": "plan" } ], "invoiceRequest": { "status": "open" }}No bearer, or one that is expired, revoked or no longer resolves to a member.
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, or it was issued for a different org.
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"}