Skip to Content
kosemdocs
ReferenceAPIBilling accounts

Get billing account

Gets an organization's billing account: the plan it is on, which sets its quotas, its credits, and its free allowances.

GET
/v1/organizations/{organization}/billingAccount

Gets an organization's billing account: the plan it is on, which sets its quotas, its credits, and its free allowances.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

organization*string

The organization's ID.

Match^org_[0-7][0-9a-hjkmnp-tv-z]{25}$

Response Body

OK

application/json
  1. 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*string

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

Value in"NONE""KOSEM""STRIPE"
enforced*boolean

Whether billed requests without credits are refused. Until billing enforces them, it only counts them.

freeViewers*integer

Active members and guests holding only read-only, billing, audit or member-admin roles (or no role), who are free on Team.

Formatint64
monthCharges*

The most it buys in a calendar month (UTC).

monthlyCredits*boolean

Whether kosem gives the organization committed credits each month, on the 1st (UTC), on Enterprise.

name*string

Resource name, organizations/{organization_id}/billingAccount.

plan*string

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

Value in"HOBBY""PRO""TEAM""ENTERPRISE"
purchasesEnabled*boolean

Whether this organization can buy credits through Stripe.

seats*integer

Billable builder seats on Team (members or guests holding a builder role), at least one.

Formatint64
subscription?

The Stripe subscription that pays for Pro or Team, if the organization started one.

subscriptionsEnabled*boolean

Whether the organization can start a subscription itself, by card, through Stripe.

suspended*boolean

Whether 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?string

When the plan last changed; unset if it never did.

Formatdate-time
usageLimit?

The most the organization lets its usage cost in a calendar month (UTC), which its owners set; unset without one.

Example Request
curl -X GET 'https://api.kosem.ai/v1/organizations/string/billingAccount'
Example Response
{
  "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
  }
}