# Create Plan

<Note>
**Plans are immutable**

There's no update endpoint. A price change means creating a new plan — existing subscriptions stay on the plan (and price) they were created with until you move them or they cancel. To move them, use [Change Subscription Plan](/reference/subscriptions/change-subscription-plan) (immediate replacement) or the `plan_change` object on [Update Subscription](/reference/subscriptions/update-subscription) (scheduled, same `id`).
</Note>

Refer to the [HTTP Response Codes](/reference/response-codes) section for details on possible error outcomes.

**POST** `/subscriptions/plans`

Base URL: `https://api-sandbox.whitelabel.com/v1`

Creates a reusable pricing plan. Plans are immutable once created — a price change means creating a new plan; existing subscriptions on the old plan are unaffected.

## Authorization

- public-api-key (apiKey in header)
- private-secret-key (apiKey in header)

## Body

Content type: `application/json`

- `name` (string, required)
  The plan name (MAX 255; MIN 3).
- `description` (string)
  The plan description. No length limit is currently enforced.
- `merchant_reference` (string)
  Your own identifier for the plan. No length limit is currently enforced.
- `base_amount` (object, required)
  The default price used for any country without an explicit entry in `country_prices`.
  - `currency` (string, required)
    MAX 3; MIN 3; [ISO 4217](/reference/country-reference).
  - `value` (number<float>, required)
    Multiple of 0.0001.
- `frequency` (object, required)
  The billing frequency for the plan. Subscriptions created from this plan inherit it.
  - `type` ("DAY" | "WEEK" | "MONTH" | "QUARTER" | "HALF_YEAR" | "YEAR", required)
  - `value` (integer<int32>, required)
- `country_prices` (object[])
  Optional explicit per-country prices. A country not listed falls back to `base_amount`.
  - `country` (string)
    [ISO 3166-1](/reference/country-reference).
  - `amount` (object)
    - `currency` (string)
    - `value` (number<float>)
- `allowed_payment_methods` (string[])
  Payment method types accepted for subscriptions on this plan.
- `metadata` (object[])
  Key-value pairs attached to the plan. Independent of any `metadata` set on a subscription created from it.
  - `key` (string)
    MAX 48.
  - `value` (string)
    MAX 512.
- `phases` (object[])
  Optional leading ladder (for example, a trial) before the plan's regular price. Omit for a flat plan. The last entry must be the terminal REGULAR phase with no `duration`.
  - `order` (integer<int32>, required)
  - `name` (string, required)
    Required, non-empty — each phase must have a name.
  - `type` ("TRIAL" | "REGULAR", required)
  - `duration` (object)
    Required on every non-terminal phase, omitted on the terminal REGULAR phase.
    - `type` ("DAY" | "WEEK" | "MONTH" | "YEAR")
    - `value` (integer<int32>)
  - `frequency` (object)
    Optional. If omitted, the phase bills as a single lump-sum charge covering the whole `duration`. If set, the phase bills every `frequency` interval instead, and the server computes `total_payments = duration / frequency` (both in the same unit) — e.g. a 3-month duration with a 1-month frequency produces 3 charges. Not applicable to the terminal phase.
    - `type` ("DAY" | "WEEK" | "MONTH" | "QUARTER" | "HALF_YEAR" | "YEAR")
    - `value` (integer<int32>)
  - `amount` (object)
    Flat price for the phase. 0 is allowed (a free trial). On a **non-terminal** phase, this or `country_prices` is required (one of the two). On the **terminal** REGULAR phase, omit this entirely — sending it is rejected with `400 BAD_REQUEST` ("The terminal phase price comes from the plan base_amount/country_prices - remove the phase amount"); the terminal price always comes from the plan's own `base_amount`/`country_prices`.
    - `currency` (string)
    - `value` (number<float>)
  - `country_prices` (object[])
    Per-country prices for this phase. On a non-terminal phase, this or `amount` is required. Not applicable to the terminal phase — its pricing always comes from the plan's own `country_prices`.
    - `country` (string)
    - `amount` (object)
      - `currency` (string)
      - `value` (number<float>)
- `account_id` (string, required)
  The `account_id` found in your [WHITELABEL Dashboard](https://dashboard.whitelabel.com/developers) (UUID). Required — on this endpoint the account is sent in the request body, not the `X-Account-Code` header.

Example:

```json
{
  "name": "string",
  "description": "string",
  "merchant_reference": "string",
  "base_amount": {
    "currency": "string",
    "value": 0
  },
  "frequency": {
    "type": "DAY",
    "value": 0
  },
  "country_prices": [
    {
      "country": "string",
      "amount": {
        "currency": "string",
        "value": 0
      }
    }
  ],
  "allowed_payment_methods": [
    "string"
  ],
  "metadata": [
    {
      "key": "string",
      "value": "string"
    }
  ],
  "phases": [
    {
      "order": 0,
      "name": "string",
      "type": "TRIAL",
      "duration": {
        "type": "DAY",
        "value": 0
      },
      "frequency": {
        "type": "DAY",
        "value": 0
      },
      "amount": {
        "currency": "string",
        "value": 0
      },
      "country_prices": [
        {
          "country": "string",
          "amount": {
            "currency": "string",
            "value": 0
          }
        }
      ]
    }
  ],
  "account_id": "string"
}
```

## Responses

### 201

201

- `id` (string)
- `account_id` (string)
- `name` (string)
- `description` (string)
- `merchant_reference` (string)
- `status` (string)
- `base_amount` (object)
  - `currency` (string)
  - `value` (number)
- `frequency` (object)
  - `type` (string)
  - `value` (integer)
- `country_prices` (object[])
  - `country` (string)
  - `amount` (object)
    - `currency` (string)
    - `value` (number)
- `allowed_payment_methods` (string[])
- `metadata` (object[])
- `phases` (object[])
- `created_at` (string)
- `updated_at` (string)

Example:

```json
{
  "id": "string",
  "account_id": "string",
  "name": "string",
  "description": "string",
  "merchant_reference": "string",
  "status": "ACTIVE",
  "base_amount": {
    "currency": "string",
    "value": 0
  },
  "frequency": {
    "type": "string",
    "value": 0
  },
  "country_prices": [
    {
      "country": "string",
      "amount": {
        "currency": "string",
        "value": 0
      }
    }
  ],
  "allowed_payment_methods": [
    "string"
  ],
  "metadata": [
    {}
  ],
  "phases": [
    {}
  ],
  "created_at": "string",
  "updated_at": "string"
}
```

### 400

400