Ask to pay by invoice
const url = 'https://api.sloose.com/orgs/org_9f3c/billing/invoice-request';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"billingEntity":"example","country":"example","taxId":"example","poNumber":"example","currency":"USD"}'};
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/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).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The org id the session was issued for. A token for one org can never read another.
Example
org_9f3cThe org id the session was issued for. A token for one org can never read another.
Request Bodyrequired
Section titled “Request Bodyrequired”object
USD when not given.
Responses
Section titled “Responses”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.
object
object
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.
Example
{ "request": { "status": "open" }}A request this cannot take.
object
Examplegenerated
{ "error": "example"}No bearer, or one that is expired, revoked or no longer resolves to a member.
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 org, it is an API token (SESSION_REQUIRED), or it is a staff member’s view of the org (IMPERSONATION_REFUSED).
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 request is open already (INVOICE_REQUEST_OPEN, that request), or the org is billed by invoice already (ALREADY_INVOICED). Nothing new was made.
object
Example
{ "code": "INVOICE_REQUEST_OPEN", "request": { "status": "open" }}