Update billing account
Changes an organization's billing account: whether it reloads credits automatically, and when and how much; its usage limit; and whether its Pro subscription ends as the paid month ends.
Changes an organization's billing account: whether it reloads credits automatically, and when and how much; its usage limit; and whether its Pro subscription ends as the paid month ends.
bearerAuthorizationBearer <token>An access token, or an API key.
organization*stringThe organization's ID.
^org_[0-7][0-9a-hjkmnp-tv-z]{25}$application/json- body
autoReload?Changes to auto-reload.
subscription?Changes to the organization's subscription.
usageLimit?Changes to the usage limit.
OK
application/json- response
allowances*array<>This calendar month's (UTC) free allowances on the plan, and how much of each is used.
autoReload*Buying credits automatically, with the card a purchase saved, when the balance runs low.
balance*The most it buys in a calendar month (UTC).
billedBy*stringWho bills the plan: NONE on Hobby; KOSEM, kosem's team, outside kosem, on a plan its staff set; or STRIPE, a subscription the organization started.
"NONE""KOSEM""STRIPE"enforced*booleanWhether billed requests without credits are refused. Until billing enforces them, it only counts them.
freeViewers*integerActive members and guests holding only read-only, billing, audit or member-admin roles (or no role), who are free on Team.
int64monthCharges*The most it buys in a calendar month (UTC).
monthlyCredits*booleanWhether kosem gives the organization committed credits each month, on the 1st (UTC), on Enterprise.
name*stringResource name, organizations/{organization_id}/billingAccount.
plan*stringThe plan the organization is on: HOBBY, $0 a month plus usage; PRO, $15 a month flat for one engineer plus usage; TEAM, $30 a builder a month plus usage; or ENTERPRISE, on terms agreed with kosem.
"HOBBY""PRO""TEAM""ENTERPRISE"purchasesEnabled*booleanWhether this organization can buy credits through Stripe.
seats*integerBillable builder seats on Team (members or guests holding a builder role), at least one.
int64subscription?The Stripe subscription that pays for Pro or Team, if the organization started one.
subscriptionsEnabled*booleanWhether the organization can start a subscription itself, by card, through Stripe.
suspended*booleanWhether the account is suspended, as when one of its payments was disputed, until kosem's staff unsuspend it. Suspended, it buys no credits, by purchase or auto-reload, and once billing is enforced, its billed requests are refused.
terms?On Enterprise, the terms agreed with kosem that it is on.
updateTime?stringWhen the plan last changed; unset if it never did.
date-timeusageLimit?The most the organization lets its usage cost in a calendar month (UTC), which its owners set; unset without one.
curl -X PATCH 'https://api.kosem.ai/v1/organizations/string/billingAccount' \
-H 'Content-Type: application/json' \
-d '{}'{
"allowances": [
{
"displayName": "string",
"limit": 0,
"price": {
"currencyCode": "string",
"nanos": -999999999,
"units": 0
},
"sku": "string",
"unit": "string",
"usage": 0
}
],
"autoReload": {
"amount": {
"currencyCode": "string",
"nanos": -999999999,
"units": 0
},
"below": {
"currencyCode": "string",
"nanos": -999999999,
"units": 0
},
"card": "string",
"enabled": true,
"failure": "string",
"monthlyMax": {
"currencyCode": "string",
"nanos": -999999999,
"units": 0
}
},
"balance": {
"currencyCode": "string",
"nanos": -999999999,
"units": 0
},
"billedBy": "NONE",
"enforced": true,
"freeViewers": 0,
"monthCharges": {
"currencyCode": "string",
"nanos": -999999999,
"units": 0
},
"monthlyCredits": true,
"name": "string",
"plan": "HOBBY",
"purchasesEnabled": true,
"seats": 0,
"subscription": {
"cancelAtPeriodEnd": true,
"card": "string",
"currentPeriodEnd": "2019-08-24T14:15:22Z",
"currentPeriodStart": "2019-08-24T14:15:22Z",
"plan": "PRO",
"seats": 0,
"state": "STARTING"
},
"subscriptionsEnabled": true,
"suspended": true,
"terms": {
"discountPercent": 0,
"endTime": "2019-08-24T14:15:22Z",
"monthlyCredits": {
"currencyCode": "string",
"nanos": -999999999,
"units": 0
},
"version": 0
},
"updateTime": "2019-08-24T14:15:22Z",
"usageLimit": {
"amount": {
"currencyCode": "string",
"nanos": -999999999,
"units": 0
},
"stop": true
}
}