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 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.
Responses
Section titled “Responses”The organisation’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 organisation’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 organisation already had that night. Null when no change of plan holds anything now. A suspension’s own date is dataRetainedUntil.
Whether this organisation has had its trial — one per organisation, running or over. No trial is offered after one (#729).
Whether the person asking has had their one trial in ANOTHER organisation (#2381): one a person, so this owner’s Start trial would be refused PERSON_ALREADY_TRIALED, and Plan offers none. False for an API token, which is no person.
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 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.
object
The AI credits a paid month of this plan version grants, before any staff override: what an invoice grants (limits carries the organisation’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 organisation 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 organisation 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 organisation’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 organisation holds against its plan (#552): its connections as connections_max counts them — distinct tenants, active and the organisation’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.
Files stored (“Files in Sloose”, #2441), against the plan.
object
Bytes of uploaded files held now: each stored file’s real size and each reserved upload’s declared size.
What the plan stores at once; null = no limit, 0 = the plan offers no files. Past it only NEW uploads are refused (LIMIT_FILES_BYTES); nothing stored is deleted early. Never counted as over the plan.
Of usedBytes, the bytes of files that were removed (or whose import ended) and that the sweep has not yet deleted. They still count until they are deleted, up to keepDays after their last use.
When the last of the removed files frees its space: the later of its due date and the end of a hold; null when none is removed.
Until when a change of plan or a suspension’s promise holds every file, so that nothing is deleted before; null when no hold is in force.
The days after its last use the plan keeps a file: how long a removed one can take to free its space.
Each enforced limit the organisation is past, connections then runs (#330): a move down, or a trial’s end, may leave an organisation 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 organisation. 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 organisation’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.
On a closed dispute only: the payment had also been refunded, whole or in part, and the refund took the credits it asked for.
object
False until the pack has a Stripe price attached.
The zone the notices’ deadlines are named in, as their emails and the organisation’s banner name them: the organisation’s own (Settings → General), or UTC when it has none.
How many requests to pay by invoice the organisation 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", "refunded": "whole" } ], "invoiceRequest": { "status": "open" }}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 (code: ROLE_REQUIRED), or it was issued for a different organisation; the organisation has been closed (code: ORG_CLOSED, either kind of bearer); the person is banned (code: BANNED, a session); or it is a session that is signed in but in no organisation (code: NO_ORG): one that never joined one, or whose person was taken out of the one it was in, or left it. Signing in again changes nothing for NO_ORG; choosing or making an organisation does.
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 restore switch is on (code: MAINTENANCE): every route but /health and /robots.txt is refused before anything is read, except the operator’s own POST /staff/people/{id}/delete with the ADMIN_TOKEN. Sloose is down for maintenance. Please try again in a few minutes.
object
Example
{ "code": "MAINTENANCE"}Headers
Section titled “Headers”Seconds until asking again is worth it (300 while the switch is on).