# Paddle plans

Bookingmood subscription plans, billed through Paddle

Endpoint: `https://api.bookingmood.com/v1/paddle_plans`, supporting `GET`. Authenticate with the header `Authorization: Bearer YOUR_API_KEY` (see [authentication](https://www.bookingmood.com/en-US/api-reference/authentication.md)).

## The paddle plan object

| Attribute | Type | Description |
| --- | --- | --- |
| `id` | `text` | Unique identifier. |
| `period` | `SubscriptionPeriod` | Billing period of the plan. |
| `tier` | `Tier` | Subscription tier of the plan. |
| `version` | `PaddleVersion` | Version of Paddle the plan is active on. |

```json
{
  "id": "",
  "period": "monthly",
  "tier": "free",
  "version": "billing"
}
```

### Types

```typescript
type PaddleVersion = "classic" | "billing";

type SubscriptionPeriod = "yearly" | "monthly";

type Tier = "free" | "basic" | "plus" | "premium";
```

### Related resources

Embed related resources with the [`select` parameter](https://www.bookingmood.com/en-US/api-reference/selecting.md), e.g. `select=*,paddle_subscriptions(*)`. Resources related through more than one column need the column as a hint, like `table!column(*)`.

| Embed | Type | Description |
| --- | --- | --- |
| `paddle_subscriptions(*)` | `array` | The [paddle subscriptions](https://www.bookingmood.com/en-US/api-reference/paddle_subscriptions.md) referencing this paddle plan through `paddle_subscriptions.plan_id`. |

## List paddle plans

`GET /v1/paddle_plans`

Filter on any attribute with `column=operator.value` (see [filtering](https://www.bookingmood.com/en-US/api-reference/filtering.md)). Choose columns and embed related resources with `select` (see [selecting](https://www.bookingmood.com/en-US/api-reference/selecting.md)), and sort and paginate with `order`, `limit` and `offset` (see [sorting and pagination](https://www.bookingmood.com/en-US/api-reference/sorting-pagination.md)).

```bash
curl -X GET "https://api.bookingmood.com/v1/paddle_plans?select=*&limit=10" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Responses:

- `200`: A list of paddle plans with the selected columns. `206` when the list is a partial range.
- `400`: The request is malformed, for example an unknown column or an invalid filter.
- `401`: The API key is missing or invalid.

Errors have a JSON body with a `code`, `message`, `details` and `hint`. See the [introduction](https://www.bookingmood.com/en-US/api-reference.md) for more on errors. The full API is described by the OpenAPI spec at https://api.bookingmood.com/v1/openapi.json.
