---
title: "The organization's credit plan, and the plans on offer"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.ezghcloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Billing API › Billing

`GET /v1/organizations/{orgId}/plan`

## Authentication

Requires one of the following:

- `apiKey`, http, header `Authorization`
- `oauth`, http, header `Authorization`
- `sessionCookie`, apiKey, in cookie

## Path parameters

- `GetPlan.path.orgId` (string, required) — The organization's UUID or prefixed ID (org_…).

## Code samples

### cURL

```curl
curl --request GET \
  --url https://billing.ezghcloud.com/v1/organizations/string/plan \
  --header 'Authorization: Bearer <token>'
```

### TypeScript

```typescript
const url = 'https://billing.ezghcloud.com/v1/organizations/string/plan';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://billing.ezghcloud.com/v1/organizations/string/plan"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
```

## Responses

### 200

OK (ETag when there's a plan)

#### Example

```json
{
  "plan": {
    "tier": "p8",
    "mode": "cap",
    "status": "scheduled",
    "currentPeriod": "string",
    "startsPeriod": "string",
    "pendingTier": "p8",
    "cancelAtPeriodEnd": true,
    "capSince": "2019-08-24T14:15:22Z",
    "credit": {
      "amount": "string",
      "used": "string",
      "remaining": "string"
    },
    "controls": {
      "blocked": true,
      "stopped": true
    },
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "tiers": [
    {
      "tier": "p8",
      "price": "string",
      "credit": "string",
      "currency": "USD"
    }
  ]
}
```

- `GetPlan.response.200.plan` (one of, required) — Null when the organization never subscribed.
  - one of: [Plan](/billing-api/schemas/Plan/), `null`
- `GetPlan.response.200.tiers` (array<object>, required)
  - `GetPlan.response.200.tiers.tier` (string, required)
    - one of `"p8"`, `"p20"`, `"p100"`
  - `GetPlan.response.200.tiers.price` (string, required) — Price per month, in dollars.
    - pattern `^[0-9]+\.[0-9]{2}$`
  - `GetPlan.response.200.tiers.credit` (string, required) — Credit per month, in dollars.
    - pattern `^[0-9]+\.[0-9]{2}$`
  - `GetPlan.response.200.tiers.currency` (string, required)

### 401

unauthenticated: no valid credential.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetPlan.response.401.error` (object, required)
  - `GetPlan.response.401.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetPlan.response.401.error.message` (string, required) — What went wrong, for people.
  - `GetPlan.response.401.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetPlan.response.401.error.issues.path` (string, required)
    - `GetPlan.response.401.error.issues.message` (string, required)

### 403

access_denied: the caller isn't allowed to (the message names the action); forbidden_origin: a cookie-authenticated write from another site.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetPlan.response.403.error` (object, required)
  - `GetPlan.response.403.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetPlan.response.403.error.message` (string, required) — What went wrong, for people.
  - `GetPlan.response.403.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetPlan.response.403.error.issues.path` (string, required)
    - `GetPlan.response.403.error.issues.message` (string, required)

### 404

not_found: the organization (or one the caller doesn't belong to), or the resource, doesn't exist.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetPlan.response.404.error` (object, required)
  - `GetPlan.response.404.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetPlan.response.404.error.message` (string, required) — What went wrong, for people.
  - `GetPlan.response.404.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetPlan.response.404.error.issues.path` (string, required)
    - `GetPlan.response.404.error.issues.message` (string, required)

### 429

too_many_requests: slow down.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetPlan.response.429.error` (object, required)
  - `GetPlan.response.429.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetPlan.response.429.error.message` (string, required) — What went wrong, for people.
  - `GetPlan.response.429.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetPlan.response.429.error.issues.path` (string, required)
    - `GetPlan.response.429.error.issues.message` (string, required)

### 500

internal_error: a bug; the details are in the logs, under the request ID.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetPlan.response.500.error` (object, required)
  - `GetPlan.response.500.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetPlan.response.500.error.message` (string, required) — What went wrong, for people.
  - `GetPlan.response.500.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetPlan.response.500.error.issues.path` (string, required)
    - `GetPlan.response.500.error.issues.message` (string, required)

### 503

unavailable, ledger_unavailable or payments_unavailable: retry later.

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "issues": [
      {
        "path": "string",
        "message": "string"
      }
    ]
  }
}
```

- `GetPlan.response.503.error` (object, required)
  - `GetPlan.response.503.error.code` (string, required) — What went wrong, for programs: branch on this, never on message.
  - `GetPlan.response.503.error.message` (string, required) — What went wrong, for people.
  - `GetPlan.response.503.error.issues` (array<object>, optional) — With invalid_request: each invalid field.
    - `GetPlan.response.503.error.issues.path` (string, required)
    - `GetPlan.response.503.error.issues.message` (string, required)


Source: https://docs.ezghcloud.com/billing-api/Billing/GetPlan/index.md
