# Create Plan

**Method:** `POST`

**Path:** `/ps/api/v1/public/plans`

**Category:** Subscriptions - Plans

**Authentication:** Required

## Description

Creates a new subscription plan that serves as a reusable template
defining the pricing structure, billing frequency, and payment terms.
Plans must be created before subscriptions can be set up.


## Request Body

Content-Type: `application/json`

- `plan_name` (`string`) **required** — Subscription plan name.
- `plan_description` (`string`) — Corresponding description for a plan.
- `frequency` (`Day | Week | Month | Year | Bi-Monthly | Quarterly | Half-Yearly | AS | OT | Not Applicable`) **required** — Frequency of recurring transactions for this particular plan. 
- `amount` (`object`) **required** — Monetary amount with currency for subscription-related APIs.
  - `value` (`integer`) **required** — Amount in the smallest currency unit (paisa for INR). Minimum ₹1 (100), maximum ₹10 lakh (100000000).
  - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

- `max_limit_amount` (`object`) **required** — Monetary amount with currency for subscription-related APIs.
  - `value` (`integer`) **required** — Amount in the smallest currency unit (paisa for INR). Minimum ₹1 (100), maximum ₹10 lakh (100000000).
  - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

- `initial_debit_amount` (`object`) — Monetary amount with currency for subscription-related APIs.
  - `value` (`integer`) **required** — Amount in the smallest currency unit (paisa for INR). Minimum ₹1 (100), maximum ₹10 lakh (100000000).
  - `currency` (`string`) **required** — Three-letter ISO 4217 currency code.

- `trial_period_in_days` (`integer`) — Duration of the trial period in days.
- `start_date` (`string`) — The ISO 8601 UTC Timestamp when the subscription plan is active and available for use.
- `end_date` (`string`) **required** — The ISO 8601 UTC Timestamp when the subscription plan expires.
- `merchant_metadata` (`object`) — Key-value pairs for additional information. Max 10 pairs, 256 chars each.
- `merchant_plan_reference` (`string`) **required** — **Idempotency Key.** Unique identifier of the merchant plan reference. Duplicate requests with the same `merchant_plan_reference` will return the existing plan instead of creating a new one.
- `auto_debit_ot` (`string`) — Indicates whether auto-debit is enabled for one-time payments under the subscription plan.

### Example Request

```json
{
  "plan_name": "Monthly Plan",
  "plan_description": "Diwali dhammaka plan intended to attract customers on diwali time",
  "frequency": "Month",
  "amount": {
    "value": 1000,
    "currency": "INR"
  },
  "max_limit_amount": {
    "value": 1000,
    "currency": "INR"
  },
  "initial_debit_amount": {
    "value": 1000,
    "currency": "INR"
  },
  "trial_period_in_days": 0,
  "start_date": "2022-02-01T17:32:28Z",
  "end_date": "2026-10-21T12:02:28Z",
  "merchant_metadata": {
    "key1": "DD"
  },
  "merchant_plan_reference": "1234567890",
  "auto_debit_ot": "false"
}
```

## Responses

- `201` — Plan created successfully.
- `400` — 
- `422` — Unprocessable Entity — validation failed or duplicate request.
- `500` — 

---

Reference: https://localhost:3000/api/subscriptions-plans/create-plan
