An organisation’s invoices waiting for a transfer
const url = 'https://api.sloose.com/billing/admin/orgs/org_9f3c/invoices';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/billing/admin/orgs/org_9f3c/invoices \ --header 'Authorization: Bearer <token>'Backoffice route: a staff session, or ADMIN_TOKEN; never a customer’s session. The organisation’s open invoices billed by invoice, newest first, as Stripe has them: what each still owes, and when it is due. Empty for an organisation Stripe does not know.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The organisation id.
Example
org_9f3cThe organisation id.
Responses
Section titled “Responses”The open invoices.
object
object
What is still owed, in cents.
The invoice’s total, tax included, in cents.
Examplegenerated
{ "invoices": [ { "id": "example", "number": "example", "amountRemaining": 1, "total": 1, "currency": "example", "dueDate": "example", "created": "example", "hostedInvoiceUrl": "example" } ]}A bearer that is neither the token nor a live session (code: AUTH_REQUIRED).
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"}A customer’s session, an API token, or no bearer at all — not staff, and not the ADMIN_TOKEN (code: ADMIN_REQUIRED).
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 the request (PAYMENT_PROVIDER_REFUSED) — nothing was charged, though a step taken before the refusal stands: the organisation’s first Stripe customer, or an existing customer’s billing email brought up to date — or was unavailable (PAYMENT_PROVIDER_UNAVAILABLE: unreachable, failing or rate-limiting), which may or may not have gone through — check before retrying. 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).