# Start checkout

`POST /v1/billing/checkout`

Answers with the address of a checkout page for a plan, paid by the month or by the year. The plan changes once it is paid.

Needs the scope: `workspace:write`

## Body parameters

- `planId` (string, required): The plan to buy: `pro` or `max`. One of: `free`, `pro`, `max`.
- `interval` (string): Pay by the `month` or by the `year`. By the month when left out. One of: `month`, `year`.

## Returns

- `object` ("checkout"): Always `checkout`.
- `url` (string): The address of the page to send the person to.

## Example

cURL:

```bash
curl -X POST "$OPENSEND_API_URL/v1/billing/checkout" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "planId": "pro"
}'
```

TypeScript:

```ts
await opensend.billing.checkout({
  planId: 'pro',
})
```

CLI:

```bash
opensend billing checkout --plan-id pro
```

MCP:

```json
{
  "name": "billing_checkout",
  "arguments": {
    "planId": "pro"
  }
}
```

Answer:

```json
{
  "object": "checkout",
  "url": "https://pay.example.com/checkout/pro"
}
```
