Skip to content

Ask to pay by invoice

POST
/orgs/{org}/billing/invoice-request
curl --request POST \
--url https://api.sloose.com/orgs/org_9f3c/billing/invoice-request \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "billingEntity": "example", "country": "example", "taxId": "example", "poNumber": "example", "currency": "USD" }'

Every plan is sold by card. An organisation that has to pay by invoice asks here, with the details an invoice needs: the entity the invoices are made out to, its country (which decides the tax: GST on top in Australia, none elsewhere), its tax ID and purchase order if it has them, and the currency it would rather pay in (plans are priced in USD). Sloose’s billing team is mailed and sets it up with the organisation; until then the request is invoiceRequest on the billing summary. One open request at a time: asked again while one is open, the answer is 409 INVOICE_REQUEST_OPEN with that request, and from an organisation billed by invoice already, 409 ALREADY_INVOICED. Written down on Plan’s history as plan.invoiceRequested.

Session only: billing is a person’s to manage, never an organisation’s API token’s (D5).

org
required

The organisation id the session was issued for. A token for one organisation can never read another.

string
Example
org_9f3c

The organisation id the session was issued for. A token for one organisation can never read another.

Media typeapplication/json
object
billingEntity
string
country
string
taxId
string | null
poNumber
string | null
currency

USD when not given.

string
Allowed values: USD AUD EUR GBP NZD
key
additional properties

Asked: the billing team is told. The request as it stands once made — billed, mailing nobody, when the organisation was billed by invoice in that moment.

Media typeapplication/json
object
request
required
object
id
required
string
status
required
string
Allowed values: open billed declined
billingEntity
required
string
country
required
string
taxId
required
string | null
poNumber
required
string | null
currency
required
string
createdAt
required
string
decidedAt
required
string | null
invoiceRequestsMade
required

This request’s own place among the organisation’s requests (#1478, #1532): how many the organisation had made up to and including it, in the order they were made. It never moves, whatever is declined or made after it. A page compares it with the billing summary’s invoiceRequestsMade, the organisation’s total: fewer there, and the summary was read before this request was made; as many, after it; more, after another was made since.

integer
Example
{
"request": {
"status": "open"
}
}

A request this cannot take.

Media typeapplication/json
object
error
required
string
key
additional properties
Examplegenerated
{
"error": "example"
}

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).

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
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). 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.

Media typeapplication/json

The error envelope every non-2xx answer uses.

object
error
required

Human-readable explanation.

string
code

Machine-readable reason. Absent on a few legacy 400s.

string
key
additional properties
Examplegenerated
{
"error": "example",
"code": "example"
}

A request is open already (INVOICE_REQUEST_OPEN, that request), or the organisation is billed by invoice already (ALREADY_INVOICED). Nothing new was made.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed values: INVOICE_REQUEST_OPEN ALREADY_INVOICED
request
required
Any of:
object
id
required
string
status
required
string
Allowed values: open billed declined
billingEntity
required
string
country
required
string
taxId
required
string | null
poNumber
required
string | null
currency
required
string
createdAt
required
string
decidedAt
required
string | null
key
additional properties
Example
{
"code": "INVOICE_REQUEST_OPEN",
"request": {
"status": "open"
}
}

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.

Media typeapplication/json
object
error
required
string
code
required
string
Allowed value: MAINTENANCE
Example
{
"code": "MAINTENANCE"
}
Retry-After
integer

Seconds until asking again is worth it (300 while the switch is on).

Report a problem with this page

sloose.com