# API: Plans and credits

| Method | Path | What it does | Scope |
|---|---|---|---|
| GET | `/v1/marketing/plan` | The plans (prices, allowances, modules, autonomy), credit prices and the organization's current plan | `billing:read` |
| PUT | `/v1/marketing/plan/current` | Choose the organization's plan (owners). Paid plans open when paid sign-ups do; until then only Free can be chosen and nothing is charged (web app only) | `billing:write` |
| GET | `/v1/marketing/plan/limits` | The plan's limits beyond credits (brands, connected accounts, people) and how many are in use; nothing is ever charged at a limit | `billing:read` |
| POST | `/v1/marketing/plan/trial` | Start the organization's one 14-day trial of Small center, Center or Group (owners on Free; no card; back to Free when it ends; nothing is charged) (web app only) | `billing:write` |
| GET | `/v1/marketing/usage` | This month's credits used by module against the monthly cap, the 50/80/100 percent alerts and what happens at the cap | `billing:read` |
| POST | `/v1/marketing/usage/top-ups` | Buy more credits (1000 for $30 a pack; owners on a paid plan): returns a Stripe checkout link. Never automatic; refused while paid sign-ups are off, and nothing is charged (web app only) | `billing:write` |

## Examples

### GET /v1/marketing/plan

The plans (prices, allowances, modules, autonomy), credit prices and the organization's current plan

```bash
curl -s "https://api.tendbrook.com/v1/marketing/plan" \
  -H "Authorization: Bearer $EC_API_KEY"
```

```js
const res = await fetch(`https://api.tendbrook.com/v1/marketing/plan`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.EC_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/marketing/plan/limits

The plan's limits beyond credits (brands, connected accounts, people) and how many are in use; nothing is ever charged at a limit

```bash
curl -s "https://api.tendbrook.com/v1/marketing/plan/limits" \
  -H "Authorization: Bearer $EC_API_KEY"
```

```js
const res = await fetch(`https://api.tendbrook.com/v1/marketing/plan/limits`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.EC_API_KEY}` },
});
const data = await res.json();
```

### GET /v1/marketing/usage

This month's credits used by module against the monthly cap, the 50/80/100 percent alerts and what happens at the cap

```bash
curl -s "https://api.tendbrook.com/v1/marketing/usage" \
  -H "Authorization: Bearer $EC_API_KEY"
```

```js
const res = await fetch(`https://api.tendbrook.com/v1/marketing/usage`, {
  method: "GET",
  headers: { authorization: `Bearer ${process.env.EC_API_KEY}` },
});
const data = await res.json();
```

Request and response schemas: [https://www.tendbrook.com/openapi.json](https://www.tendbrook.com/openapi.json). All resources: [API reference](https://www.tendbrook.com/docs/api).
