# Get billing

Read the workspace's plan, credit balance and available billing actions.

POST https://api.brigg.app/v1/operations/billing.GetBilling

## Access & visibility

Allow `billing.GetBilling` on your API key.

**Workspace access by default.** Private member data requires [approved member delegation](https://developer.brigg.app/authentication#member-delegation) through `Brigg-Act-As`; the key supplies permissions while private ownership and project boundaries remain enforced.

[Set up authentication](https://developer.brigg.app/authentication) · [Choose permissions](https://developer.brigg.app/permissions)

## Request

No parameters. Send an empty JSON object (`{}`).

## Balance, charges and underlying usage

[Get billing](https://developer.brigg.app/reference/billing/GetBilling) returns the current workspace balance. [List credit ledger](https://developer.brigg.app/reference/billing/ListCreditLedger) returns recent balance movements, newest first: a negative amount deducts credit; a positive amount adds it. The default is 50 rows and the maximum is 500, with no cursor for older pages.

For spending over a period, use [List usage](https://developer.brigg.app/reference/billing/ListUsage). Its from and to values are inclusive Unix millisecond timestamps. Use totals.spent_nok for charged credit: it comes from the credit ledger. The items describe individual credit charges and their activities. Use totals for period spending: item detail can be incomplete. Credit figures are in Norwegian kroner, not minor currency units.

Some plans hide credit information. An authorized member can still receive credit_info_hidden on those plans; changing the key's grants does not expose it. Storage usage is a separate byte quota, not a currency balance.

## Response

Returns **200 OK** with a JSON body.
| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `billing` | [Billing](#billing-response-billing) | Yes | Current plan, payment availability and credit balance. |
| `online_payments_available` | boolean | Yes | Whether this workspace can use Brigg's online payment flow. |

### Billing · response.billing

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `plan` | string | Yes | Current workspace subscription plan. Allowed: `"trial"`, `"free"`, `"start"`, `"team"`, `"enterprise"`, `"legacy"`, `"invoiced"`. |
| `balance_nok` | number | Yes | Available credit in Norwegian kroner, not øre. |
| `monthly_credit_nok` | number | Yes | Credit included each month, in Norwegian kroner. |
| `last_refill_at` | null or number | Yes | Time credits were most recently refilled, in Unix milliseconds. |
| `next_refill_at` | null or number | Yes | Next scheduled credit refill, in Unix milliseconds. |
| `trial_ends_at` | null or number | Yes | Trial expiry time, in Unix milliseconds. |
| `has_payment_method` | boolean | Yes | Whether a payment method is configured for the workspace. Allowed: `false`, `true`. |
| `created_at` | number | Yes | Creation time in Unix milliseconds. |
| `updated_at` | number | Yes | Last update time in Unix milliseconds. |

## Errors & retries

This operation reads data. It needs no idempotency key and can be retried after a transient failure.

For rate limits, follow the server’s retry guidance and back off. See [HTTP errors](https://developer.brigg.app/http#errors) and [safe retries and limits](https://developer.brigg.app/reliability).

| HTTP status | Code | What to do |
| --- | --- | --- |
| 400 | `invalid_json` | Send a JSON object with Content-Type: application/json. |
| 400 | `invalid_input` | Check the request fields and types. |
| 401 | `invalid_key` | The workspace API key is missing, invalid or revoked. |
| 403 | `forbidden` | Check the key’s operation and resource grants. If Brigg-Act-As is supplied, the key must be authorized to delegate to that member. |
| 404 | `not_found` | The requested operation or resource is not available to this credential. |
| 429 | `rate_limited` | Wait for Retry-After before retrying. |
| 403 | `credit_info_hidden` | This workspace plan does not expose credit and usage details. |

## Next steps

- [List usage](https://developer.brigg.app/reference/billing/ListUsage)
- [List credit ledger](https://developer.brigg.app/reference/billing/ListCreditLedger)
- [Get storage usage](https://developer.brigg.app/reference/billing/GetStorageUsage)

[Download OpenAPI](https://developer.brigg.app/openapi.json) · [Versioning & retirement](https://developer.brigg.app/versioning)

## Examples

### Example request

Fictional values. Replace IDs and business details with values from your workspace.
#### cURL


```sh
curl 'https://api.brigg.app/v1/operations/billing.GetBilling' \
  -H "Authorization: Bearer $BRIGG_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{}'
```

#### TypeScript


```typescript
const response = await fetch("https://api.brigg.app/v1/operations/billing.GetBilling", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.BRIGG_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
const result = await response.json();
if (!response.ok) throw new Error(`${response.status}: ${result.error} — ${result.message}`);
console.log(result);
```

#### Python


```python
import json
import os
from urllib.request import Request, urlopen
from urllib.error import HTTPError

payload = {}
request = Request(
    "https://api.brigg.app/v1/operations/billing.GetBilling",
    data=json.dumps(payload).encode("utf-8"),
    headers={
        "Authorization": f"Bearer {os.environ['BRIGG_API_KEY']}",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        print(json.load(response))
except HTTPError as error:
    print(error.code, json.load(error))
    raise
```

#### Response example


```json
{
  "billing": {
    "plan": "team",
    "balance_nok": 487.5,
    "monthly_credit_nok": 500,
    "last_refill_at": null,
    "next_refill_at": null,
    "trial_ends_at": null,
    "has_payment_method": false,
    "created_at": 1794301200000,
    "updated_at": 1794301200000
  },
  "online_payments_available": false
}
```

## JSON schemas


```json-schema-request
{
  "type": "object",
  "properties": {},
  "additionalProperties": false,
  "examples": [
    {}
  ]
}
```


```json-schema-response
{
  "type": "object",
  "properties": {
    "billing": {
      "description": "Current plan, payment availability and credit balance.",
      "title": "Billing",
      "type": "object",
      "properties": {
        "plan": {
          "type": "string",
          "enum": [
            "trial",
            "free",
            "start",
            "team",
            "enterprise",
            "legacy",
            "invoiced"
          ],
          "description": "Current workspace subscription plan."
        },
        "balance_nok": {
          "type": "number",
          "description": "Available credit in Norwegian kroner, not øre."
        },
        "monthly_credit_nok": {
          "type": "number",
          "description": "Credit included each month, in Norwegian kroner."
        },
        "last_refill_at": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number"
            }
          ],
          "description": "Time credits were most recently refilled, in Unix milliseconds."
        },
        "next_refill_at": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number"
            }
          ],
          "description": "Next scheduled credit refill, in Unix milliseconds."
        },
        "trial_ends_at": {
          "anyOf": [
            {
              "type": "null"
            },
            {
              "type": "number"
            }
          ],
          "description": "Trial expiry time, in Unix milliseconds."
        },
        "has_payment_method": {
          "type": "boolean",
          "enum": [
            false,
            true
          ],
          "description": "Whether a payment method is configured for the workspace."
        },
        "created_at": {
          "type": "number",
          "description": "Creation time in Unix milliseconds."
        },
        "updated_at": {
          "type": "number",
          "description": "Last update time in Unix milliseconds."
        }
      },
      "required": [
        "plan",
        "balance_nok",
        "monthly_credit_nok",
        "last_refill_at",
        "next_refill_at",
        "trial_ends_at",
        "has_payment_method",
        "created_at",
        "updated_at"
      ],
      "additionalProperties": false
    },
    "online_payments_available": {
      "type": "boolean",
      "description": "Whether this workspace can use Brigg's online payment flow."
    }
  },
  "required": [
    "billing",
    "online_payments_available"
  ],
  "additionalProperties": false,
  "examples": [
    {
      "billing": {
        "plan": "team",
        "balance_nok": 487.5,
        "monthly_credit_nok": 500,
        "last_refill_at": null,
        "next_refill_at": null,
        "trial_ends_at": null,
        "has_payment_method": false,
        "created_at": 1794301200000,
        "updated_at": 1794301200000
      },
      "online_payments_available": false
    }
  ]
}
```

