The organisation’s standing: one banner, and the trial
const url = 'https://api.sloose.com/orgs/org_9f3c/billing/standing';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/standing \ --header 'Authorization: Bearer <token>'What the app bar says about the organisation, for whoever is asking: the one banner to show — suspended, a payment failed, over the plan, the trial ended, the trial ending in three days, AI credits running low, most serious first — or none; while a trial runs, when it ends; the AI credits available; and the zone its days are named in.
A suspension and being over the plan are said to every member, in the administrators’ words (with the way to settle it, or to see what is over) or everybody else’s. Over the plan is an enforced limit the organisation is past (over), where a move down or a trial’s end can leave it: connections past connections_max — adding one is refused, a reconnect never — or runs this period past runs_per_month, which refuses the next run. The other four are said to the owner and administrators only. The trial’s end is said for seven days after it. Two are dismissed, each by a person for themselves through POST …/billing/notices/{id}/ack: the three-day warning, for a day, and running low (credits_low, the one-click top-up, #298), for this shortfall.
Asking also checks the organisation’s credits against its one-click top-up number before answering (#1356): a shortfall reached by a path that tells nobody — a hold that lapsed, credits that expired — is raised then, and this answer carries its banner.
The owed invoice’s page (invoiceUrl) pays it with no sign-in, so it is handed only to the owner or an administrator through their own session — never to an organisation API token, whatever its role, nor to a staff member’s view, which are told the same banner without it.
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 standing.
object
object
The administrators’ version, with the way to settle the account; false for everybody else, who are told an admin settles it and that dry runs still work.
The owed invoice’s own page at Stripe, where it is paid: https on invoice.stripe.com. Handed only to a person who may pay it — the owner or an administrator, through their own session; never an organisation API token, whatever its role, nor a staff member’s view. Null otherwise, or when no invoice is owed: then the way to settle is the Customer Portal.
Whether an invoice is owed that settles this — “Pay the invoice” — whether or not this bearer is handed its page (invoiceUrl). So a staff member’s view of an administrator is told it with no page, and shows the member’s button disabled. Only ever true on the administrators’ banner.
object
The plan a settled payment keeps.
It is settled before then.
The owed invoice’s own page at Stripe, where it is paid: https on invoice.stripe.com. Handed only to a person who may pay it — the owner or an administrator, through their own session; never an organisation API token, whatever its role, nor a staff member’s view. Null otherwise, or when no invoice is owed: then the way to settle is the Customer Portal.
Whether an invoice is owed that settles this — “Pay the invoice” — whether or not this bearer is handed its page (invoiceUrl). So a staff member’s view of an administrator is told it with no page, and shows the member’s button disabled. Only ever true on the administrators’ banner.
object
The administrators’ version, with the way to see what is over; false for everybody else, who are told the organisation is over its plan and that an administrator can sort it out.
The plan the organisation is on, which it is over.
Each enforced limit the organisation is past, connections then runs, as the billing summary’s overPlan names them.
object
object
The plan the organisation is on now: Free.
Its runs a month; null is unlimited.
Until when the move to Free holds the organisation’s history (a change of plan keeps it thirty days): nothing past Free’s history_days is retired before it. Null when no hold applies now.
object
Dismissed through its notice, which quiets it for a day, for the one person.
The plan being trialled.
A trial Stripe runs, which becomes the plan by itself when it ends; false for the organisation’s own trial, which ends in Free unless a plan is chosen.
object
Dismissed through its notice, for the one person and this shortfall: the next time the balance falls below the threshold is a new notice.
The AI credits the organisation holds, included and purchased, whatever calls in flight have reserved: what is short is judged on these.
The number the organisation chose to be told below (one-click top-up).
The pack whose Checkout the banner’s button opens — the one chosen, else the smallest on sale. Null when none can be bought on this deployment: the banner then points at Usage & credits.
object
While a trial runs: when it ends. For every member.
object
object
The zone the banner’s days and times are named in, as its emails name them: the organisation’s own (Settings → General), or UTC when it has none.
Example
{ "banner": { "kind": "suspended" }}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).