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

# Upgrade Plan

Change a customer's current plan without checkout from a trusted backend.

**Auth:** secret key only. Publishable keys are rejected.

<ParamField body="customer_id" type="string" required>
  External customer ID.
</ParamField>

<ParamField body="plan_code" type="string" required>
  The plan code to upgrade the customer to.
</ParamField>

### Response

Returns the updated subscription details for an allowed no-payment change.

Paid upgrades return:

```json theme={null}
{
  "error": "payment_checkout_required",
  "code": "payment_checkout_required"
}
```

Browser plan changes must use `POST /checkout` for upgrades and downgrades. Checkout previews the exact prorated invoice, preserves the current paid plan until payment succeeds, and returns `type: "scheduled"` when a lower plan takes effect at the next billing boundary.

<Note>
  Also available to trusted backends as `POST /subscriptions/change` (alias). Do not expose either route to browser code.
</Note>
