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

# Create Plan

> Create a new pricing plan in a project

Creates a new pricing plan in the specified project. You can optionally assign features to the plan at creation time.

## Endpoint

```
POST /api/v1/projects/{slug}/plans
```

## Authentication

<ParamField header="Authorization" type="string" required>
  Bearer token with your API key. Requires `read_write` permission.
</ParamField>

## Path Parameters

<ParamField path="slug" type="string" required>
  The project's URL-friendly slug identifier.
</ParamField>

## Body Parameters

<ParamField body="name" type="string" required>
  Plan display name.
</ParamField>

<ParamField body="description" type="string">
  Description of the plan.
</ParamField>

<ParamField body="isPopular" type="boolean">
  Mark this plan as "Popular" to highlight it.
</ParamField>

<ParamField body="isVisible" type="boolean">
  Whether this plan is visible on the pricing page.
</ParamField>

<ParamField body="basePrice" type="number">
  Monthly base price of the plan.
</ParamField>

<ParamField body="isFree" type="boolean">
  Whether this is a free plan (overrides `basePrice` to 0).
</ParamField>

<ParamField body="features" type="array">
  Array of features to assign to this plan at creation time.

  <Expandable title="Feature assignment object">
    <ParamField body="features[].featureId" type="number" required>
      The ID of the feature to assign.
    </ParamField>

    <ParamField body="features[].multiplier" type="number">
      Multiplier for the feature (e.g. `5` means 5x the base limit). Defaults to `1`.
    </ParamField>
  </Expandable>
</ParamField>

## Response

Returns the created plan object with status `201 Created`, including its assigned plan features.

## Example

```bash theme={null}
curl -X POST https://cuprice.io/api/v1/projects/my-saas-app/plans \
  -H "Authorization: Bearer cpk_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Pro",
    "description": "For growing teams",
    "isPopular": true,
    "isVisible": true,
    "basePrice": 29,
    "isFree": false,
    "features": [
      { "featureId": 101, "multiplier": 5 },
      { "featureId": 102, "multiplier": 1 },
      { "featureId": 104, "multiplier": 1 }
    ]
  }'
```

```json theme={null}
{
  "id": 201,
  "name": "Pro",
  "description": "For growing teams",
  "basePrice": 29,
  "isPopular": true,
  "isVisible": true,
  "isFree": false,
  "planFeatures": [
    {
      "id": 301,
      "multiplier": 5,
      "feature": {
        "id": 101,
        "name": "AI Prompts",
        "featureType": "Limits",
        "basePrice": 10
      }
    },
    {
      "id": 302,
      "multiplier": 1,
      "feature": {
        "id": 102,
        "name": "Team Members",
        "featureType": "Standart",
        "basePrice": 5
      }
    },
    {
      "id": 303,
      "multiplier": 1,
      "feature": {
        "id": 104,
        "name": "Priority Support",
        "featureType": "Standart",
        "basePrice": 20
      }
    }
  ],
  "createdAt": "2025-10-05T12:00:00.000Z",
  "updatedAt": "2025-10-05T12:00:00.000Z"
}
```

## Errors

| Status | Description                                   |
| ------ | --------------------------------------------- |
| `400`  | Missing `name` or invalid feature IDs         |
| `401`  | Invalid or missing API key                    |
| `403`  | API key does not have `read_write` permission |
| `404`  | Project with the given slug not found         |
