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 org 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 org; 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 org 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 org’s API token’s (D5).

org
required

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

string
Example
org_9f3c

The org id the session was issued for. A token for one org 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 org 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 org’s requests (#1478, #1532): how many the org 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 org’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 is expired, revoked or no longer resolves to a member.

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 org, it is an API token (SESSION_REQUIRED), or it is a staff member’s view of the org (IMPERSONATION_REFUSED).

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 org 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"
}
}

Report a problem with this page