Get billing status
/organization/{id}/billing
Returns the organization's subscription and seat state. Requires the `billing:view` permission. For what the org may actually use, prefer `GET /organization/{id}/entitlements`.
Path Parameters
Organization id (org_…).
Response Body
What this org's next Gold purchase charges: the tier from its first purchase if it has one, otherwise the tier for the country the request comes from.
False only for a country Elaichi cannot sell to; a purchase from there is refused with region_unavailable.
ISO 3166-1 alpha-2 the price is based on, or null when unknown (which prices as list).
Lowercase ISO 4217 the gold amounts are in.
How far the monthly price is off the list monthly price in the same currency, to the nearest point (0 at list). Not always the tier’s own discount, since each currency’s amounts are rounded on their own.
Per-seat price for one cycle in currency minor units, exactly what is charged. year is the year total.
2 properties
1 property
1 property
List (t0) price to show the discount against: in currency when list price is set in it, else USD. Display only.
2 properties
2 properties
1 property
1 property
tier !== "t0".
Tier id: t0 (list) to t4 by GDP band, or a country tier such as in (India).
Which plans and billing intervals can be purchased.
False when billing is not enabled for the service.
What the org is actually entitled to right now, after trial and Stripe subscription status are taken into account. An org with no live subscription or trial is personal. null means on hold: gated features refuse with subscription_required.
personalgoldblacknull
Stored plan on the row: personal, gold, black, or none while on hold.
Billable memberships, with the paid-subscription minimum of one. This is the quantity billed.
The local trial before a subscription starts: Black for a new organization, Gold for a trial started before Black trials. A Stripe trialing subscription is not this flag.
Seat-change invoices not yet paid: how many, and the newest. An unpaid seat invoice never changes the plan or the members; it stays open and payable at pay_url. Read from what Elaichi recorded from Stripe's events, not from Stripe on each request.
The newest one the card holder can act on (failed, needs_approval, bank_approval), else the newest the bank is processing.
5 properties
Major units of currency.
Lowercase ISO code.
Stripe's hosted page for paying (or approving) the invoice. Null for bank_approval and awaiting_bank: paying there while the bank holds the charge could charge twice.
When it first went unpaid.
failed: the card was declined; pay it at pay_url. needs_approval: the card wants the charge approved at pay_url. bank_approval: the bank holds the charge and asked the card holder to approve it in the bank's app or the message the bank sent; there is nothing to pay. awaiting_bank: the bank is still processing it, which can take about a day.
failedneeds_approvalbank_approvalawaiting_bank
curl -X GET 'https://api.elaichi.ai/organization/<id>/billing' \
-H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
-H 'Content-Type: application/json'const response = await fetch('https://api.elaichi.ai/organization/<id>/billing', {
method: 'GET',
headers: {
'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
'Content-Type': 'application/json',
},
});
const data = await response.json();
console.log(data);import os
import requests
url = "https://api.elaichi.ai/organization/<id>/billing"
headers = {
"Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
"Content-Type": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())