Start the trial
const url = 'https://api.sloose.com/orgs/org_9f3c/billing/trial';const options = {method: 'POST', 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 POST \ --url https://api.sloose.com/orgs/org_9f3c/billing/trial \ --header 'Authorization: Bearer <token>'Starts the Business trial if the organisation is eligible: once per organisation, on Free, with no Stripe subscription — named by the organisation, or live at Stripe before its webhook has named it — and owing no invoice it left a suspension with (OWES_INVOICE, until that invoice is paid or voided). And once per person: the owner asking spends their one trial, and one who has had theirs in another organisation (one they made, or started a trial in; open, closed or erased) is answered reason: PERSON_ALREADY_TRIALED with nothing done. A trial staff start spends nobody’s. Any plan Checkout the organisation has open at Stripe is expired first: starting the trial is choosing it over them, and none can then be paid under it. Answers 200 with started: false when it was not eligible — not an error, just an answer.
Session only: billing is a person’s to manage, never an organisation’s API token’s (D5).
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”Not eligible. reason says which rule refused it; entitlements is unchanged.
object
For OWES_INVOICE: the page of the invoice the organisation left owing, which pays it with no sign-in (null where Stripe gave none). Handed to the owner through their own session only.
Everything the widget needs to know about what this organisation may do.
object
object
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
object
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.
AI credits. Included credits reset each period; purchased ones do not.
object
Included + purchased − reserved
Applies right now regardless of the action.
Example
{ "started": false, "reason": "ORG_ALREADY_TRIALED", "entitlements": { "plan": { "key": "free" }, "status": "free", "warnings": [ "LIMIT_ROWS" ] }}Trial started.
object
Everything the widget needs to know about what this organisation may do.
object
object
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
object
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.
AI credits. Included credits reset each period; purchased ones do not.
object
Included + purchased − reserved
Applies right now regardless of the action.
Example
{ "started": true, "entitlements": { "plan": { "key": "free" }, "status": "free", "warnings": [ "LIMIT_ROWS" ] }}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, it is an API token (SESSION_REQUIRED), or it is a staff member’s view of the organisation (IMPERSONATION_REFUSED; a read-only view is refused before this, IMPERSONATION_READ_ONLY): billing spends and changes the organisation’s money, and a view would do it in the member’s name. 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"}Stripe refused or was unavailable while the trial asked it whether the organisation pays already (PAYMENT_PROVIDER_REFUSED, PAYMENT_PROVIDER_UNAVAILABLE), and the trial did not start. Any open plan Checkout of the organisation closed before the failure stays closed: the trial closes them first, and a Checkout can be made again from Plan. Stripe’s own words are logged, not returned.
object
Example
{ "code": "PAYMENT_PROVIDER_REFUSED"}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).