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

# Create Plan

***

## icon: calendar-plus

# Create Plan

Use the Create Plan API to create a subscription plan for your merchant account.

A plan defines the subscription amount, billing frequency, currency, billing interval, and total number of billing cycles. Once created successfully, KwikPaisa Neo Bank generates a unique `plan_id`, which is used when creating a customer subscription.

***

## Endpoint

```text theme={null}
POST /api/v3/pg/plan/create
```

***

#### To view all available base URLs and environments, refer to:

➡️ [API Resources](https://docs.kwikpaisa.com/guide/quick-start/api-resources.md)

#### This endpoint requires standard KwikPaisa Neo Bank authentication headers.

Refer to:

➡️ [Headers](https://docs.kwikpaisa.com/guide/authentication/headers.md)\
➡️ [Signature Generation](https://docs.kwikpaisa.com/guide/authentication/signature.md)\
➡️ [Timestamp Validation](https://docs.kwikpaisa.com/guide/authentication/timestamp.md)

***

## Request Parameters

| Parameter | Type | Required | Description |
| :- | :- | :- | :- |
| `name` | String | Yes | Name of the subscription plan |
| `description` | String | No | Description of the subscription plan |
| `amount_type` | String | Yes | Plan amount type, such as `fixed` or `variable` |
| `amount` | Decimal | Yes | Subscription amount |
| `currency` | String | Yes | Currency code (Example: INR) |
| `frequency` | String | Yes | Billing frequency (Example: daily, weekly, monthly, yearly) |
| `interval_count` | Integer | Yes | Number of frequency intervals between billing cycles |
| `total_cycles` | Integer | No | Total number of billing cycles |
| `metadata` | Object | No | Additional merchant-defined information associated with the plan |

***

## Example Request Body

```text theme={null}
{
  "name": "Monthly Gold Plan",
  "description": "Monthly subscription plan",
  "amount_type": "fixed",
  "amount": 699,
  "currency": "INR",
  "frequency": "monthly",
  "interval_count": 1,
  "total_cycles": 12,
  "metadata": {
    "package": "gold",
    "purpose": "subscription"
  }
}
```

***

## Example cURL Request

```text theme={null}
curl --request POST \
--url https://sandbox.kwikpaisa.com/api/v3/pg/plan/create \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "X-API-KEY: pk_test_xxxxxxxxx" \
--header "X-TIMESTAMP: GENERATED_TIMESTAMP" \
--header "X-SIGNATURE: GENERATED_SIGNATURE" \
--data '{
  "name": "Monthly Gold Plan",
  "description": "Monthly subscription plan",
  "amount_type": "fixed",
  "amount": 699,
  "currency": "INR",
  "frequency": "monthly",
  "interval_count": 1,
  "total_cycles": 12,
  "metadata": {
    "package": "gold",
    "purpose": "subscription"
  }
}'
```

***

## Signature Generation

Generate the request signature using the recursively sorted request payload.

```text theme={null}
$timestamp = time();

$sortPayload = function ($data) use (&$sortPayload) {
    if (!is_array($data)) {
        return $data;
    }

    ksort($data);

    foreach ($data as $key => $value) {
        $data[$key] = $sortPayload($value);
    }

    return $data;
};

$sortedPayload = $sortPayload($payload);
$jsonPayload = json_encode($sortedPayload, JSON_UNESCAPED_SLASHES);

$signature = hash_hmac(
    'sha256',
    $jsonPayload . $timestamp,
    $secretKey
);
```

***

## Example Success Response

```text theme={null}
{
  "success": true,
  "message": "Plan created successfully",
  "plan": {
    "plan_id": "plan_28731541-b987-43e3-9ae7-9a66bd097fd2",
    "name": "Monthly Gold Plan",
    "description": "Monthly subscription plan",
    "amount_type": "fixed",
    "amount": 699,
    "currency": "INR",
    "frequency": "monthly",
    "interval_count": 1,
    "total_cycles": 12,
    "status": "active",
    "metadata": {
      "package": "gold",
      "purpose": "subscription"
    },
    "updated_at": "2026-11-12T04:41:51.000000Z",
    "created_at": "2026-11-12T04:41:51.000000Z"
  }
}
```

***

## Response Parameters

| Parameter | Description |
| :- | :- |
| `success` | Indicates whether the plan was created successfully |
| `message` | API response message |
| `plan.plan_id` | Unique KwikPaisa Neo Bank generated plan ID |
| `plan.name` | Name of the subscription plan |
| `plan.description` | Plan description |
| `plan.amount_type` | Plan amount type (`fixed` or `variable`) |
| `plan.amount` | Subscription amount |
| `plan.currency` | Plan currency |
| `plan.frequency` | Billing frequency |
| `plan.interval_count` | Number of frequency intervals between billing cycles |
| `plan.total_cycles` | Total number of billing cycles |
| `plan.status` | Current plan status |
| `plan.metadata` | Merchant-defined additional plan information |
| `plan.created_at` | Plan creation timestamp |
| `plan.updated_at` | Plan last update timestamp |

***

## Important Notes

* A unique `plan_id` is generated by KwikPaisa Neo Bank after successful plan creation.
* Store the returned `plan_id` for future subscription operations.
* The `amount_type` determines whether the plan uses a fixed or variable amount.
* The `frequency` and `interval_count` define the billing interval.
* `total_cycles` defines the maximum number of billing cycles for the plan.
* `metadata` can be used to store additional merchant-defined information, such as package details and subscription purpose.
* Generate API signatures on your server only.
* Never expose your secret key in frontend applications.
* Use HTTPS for all API requests.

***

## Recommended Subscription Flow

1. Create a customer using the Create Customer API.
2. Create a subscription plan using the Create Plan API.
3. Store the generated `plan_id`.
4. Create a subscription using the customer ID and plan ID.
5. Redirect the customer to the subscription authorization flow.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.