# Get billing info

`GET https://api.endless.app/organizations/{organization_id}/billing`

Source: https://endless.app/docs/api/billing/info

Get billing info. Scoped to the organization named by `organization_id`.

## Authentication

- `bearerAuth`: HTTP bearer (JWT)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `organization_id` | path | string | yes |  |
| `Endless-Api-Version` | header | string | no | Pin the caller to an API major (`1`). Omit to accept the current version. A major this deployment cannot serve is refused with 400 `unsupported_api_version`. |

## Responses

### 200 OK

Content type: `application/json` — object

- `organization_id` (string, required)
- `organization_name` (string, required)
- `has_customer` (boolean, required)
- `has_subscription` (boolean, required)
- `customer` (object | null, required)
  - `id` (string, required)
  - `name` (string | null)
  - `email` (string | null, required)
  - `billing_emails` (array<string>, required)
  - `balance` (number | null, required)
  - `delinquent` (boolean | null, required)
  - `has_payment_method` (boolean | null)
  - `payment_method` (object | null)
    - `type` (string | null, required)
    - `brand` (string | null, required)
    - `last4` (string | null, required)
    - `exp_month` (number | null, required)
    - `exp_year` (number | null, required)
    - `funding` (string | null, required)
    - `is_default` (boolean, required)
- `subscription` (object | null, required)
  - `id` (string, required)
  - `status` ("active" | "canceled" | "incomplete" | "incomplete_expired" | "past_due" | "paused" | "trialing" | "unpaid", required)
  - `is_active` (boolean, required)
  - `current_period_start` (string | null, required)
  - `current_period_end` (string | null, required)
  - `next_period_start` (string | null)
  - `next_period_end` (string | null)
  - `next_invoice` (object | null)
    - `amount_due` (number, required)
    - `currency` (string, required)
    - `billed_at` (string, required)
  - `cancel_at` (string | null, required)
  - `canceled_at` (string | null, required)
  - `cancel_at_period_end` (boolean)
  - `trial_start` (string | null)
  - `trial_end` (string | null, required)
  - `collection_method` (string | null)
  - `cancels_at_trial_end` (boolean)
  - `is_linked` (boolean)
  - `latest_invoice` (object | null)
    - `status` (string | null, required)
    - `amount_due` (number, required)
    - `amount_paid` (number, required)
    - `currency` (string, required)
    - `hosted_invoice_url` (string | null, required)
    - `due_date` (string | null, required)
    - `created` (string, required)
  - `discounts` (array<object>)
    - `id` (string, required)
    - `coupon_name` (string | null, required)
    - `percent_off` (number | null, required)
    - `amount_off` (number | null, required)
    - `currency` (string | null, required)
    - `duration` (string | null, required)
    - `duration_in_months` (number | null, required)
    - `end` (string | null, required)
  - `collection_state` (object)
    - `collects` ("card" | "card_missing" | "card_unknown" | "emailed_invoice" | "outside_stripe" | "nothing_free", required)
    - `has_payment_method` (boolean | null, required)
    - `card` (object | null, required)
    - `card_expired` (boolean, required)
    - `billing_email` (string | null, required)
    - `trial_outcome` ("bills" | "cancels" | "pauses" | "unknown" | null, required)
    - `trial_ends_at` (string | null, required)
    - `trial_end_behavior` (string | null, required)
    - `self_renews` (boolean, required)
    - `ends_at` (string | null, required)
    - `ends_reason` ("scheduled_date" | "period_end" | "trial_end" | "canceled" | null, required)
    - `next_bill` ("scheduled" | "none" | "passed" | "unknown", required)
    - `next_bill_at` (string | null, required)
    - `last_payment` (object | null, required)
    - `open_drafts` (number, required)
  - `plan` (object | null, required)
    - `plan_id` ("hobby" | "basic" | "pro" | "business" | "trial" | "internal" | null, required)
    - `name` (string | null, required)
    - `description` (string | null)
    - `credits` (number | null, required)
    - `price` (number | null, required)
    - `currency` (string | null, required)
    - `interval` ("month" | "year" | null, required)
  - `scheduled_change` (object | null, required)
    - `effective_date` (string | null, required)
    - `managed_by_staff` (boolean)
    - `new_plan` (object, required)
- `available_plans` (array<object>, required)
  - `id` (string, required)
  - `plan_id` ("hobby" | "basic" | "pro" | "business" | "trial" | "internal" | null, required)
  - `name` (string, required)
  - `description` (string | null, required)
  - `prices` (array<object>, required)
    - `id` (string, required)
    - `amount` (number | null, required)
    - `currency` (string | null, required)
    - `interval` ("month" | "year" | null, required)
    - `credits` (number | null, required)
    - `usage_interval` (string | null, required)
    - `usage_interval_count` (number | null, required)
- `credit_purchase` (object, required)
  - `blocked_reason` ("no_subscription" | "plan_too_low" | "zero_plan" | "contract_unpriced" | "rate_underivable" | null, required)
  - `rate` (object | null, required)
    - `unit_amount_cents` (integer, required)
    - `credits_per_billing_period` (integer, required)
    - `credits_per_cycle` (integer, required)
    - `currency` (string, required)

### Errors

- `400` (Error): The request is malformed, or failed input validation. `message` names the field and the rule it broke; `data.issues` carries them individually.
- `401` (Error): No bearer token, or a token that failed verification.
- `402` (Error): The workspace has no credits left, or the caller is over a spending limit.
- `403` (Error): Authenticated, but the caller's role in this workspace does not carry the permission this operation needs.
- `404` (Error): No resource with that id, or the caller cannot read it. The two are deliberately one answer, so an id cannot be probed for existence.
- `409` (Error): The request is well-formed, but the resource's current state forbids it — a taken name, a last admin, a limit already reached.
- `429` (Error): The caller has spent its rate-limit window. `Retry-After` says when to come back.
- `500` (Error): The request failed on our side. Safe to retry an idempotent operation with backoff.
