---
url: "https://docs.portone.cloud/docs/creating-a-regular-plan"
title: "Creating a Regular Plan"
---
This document provides a comprehensive guide for creating a **Regular Plan** using the PortOne API. A Regular Plan allows merchants to set up fixed recurring payments for their customers at regular intervals.
🦉
Subscription: Creating a Regular Plan
Open Recipe
* * *
## **Prerequisites** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#prerequisites)
### **Signature Hash Generation** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#signature-hash-generation)
To ensure the authenticity of the request, generate the `signature_hash` by following the [Regular Plan Request Signature Documentation](https://docs.portone.cloud/docs/regular-plan).
* * *
## **API Endpoint** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#api-endpoint)
**POST** `https://api.portone.cloud/api/subscription/createPlan`
* * *
## **Headers** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#headers)
##### `Content-Type` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#content-type)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan)
Set to `application/json`.
* * *
##### `X-Portone-Client-Key` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#x-portone-client-key)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string-%C2%B7-span-stylecolorredrequiredspan)
The unique PortOne key for the merchant.
* * *
##### `Authorization` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#authorization)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-1)
JWT for authenticating API requests. Learn how to generate the token [here](https://docs.portone.cloud/docs/jwt-authentication).
* * *
## **Request Example** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#request-example)
#### Request Body: [Skip link to Request Body:](https://docs.portone.cloud/docs/creating-a-regular-plan\#request-body)
JSON
```rdmd-code lang-json theme-light
{
"portone_key": "PORTONE_KEY",
"merchant_order_ref": "Plan_1729672233765",
"source": "api",
"amount": 1000,
"currency": "USD",
"name": "1000 USD per month",
"description": "1000 USD per month",
"environment": "sandbox",
"frequency": 1,
"period": "M",
"plan_type": "REGULAR",
"notes": [\
{ "key": "key1", "value": "value1" },\
{ "key": "key2", "value": "value2" }\
]
}
```
## **Request Body Parameters** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#request-body-parameters)
Below are the required and optional parameters for creating a **Regular Plan**:
### **General Parameters** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#general-parameters)
##### `portone_key` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#portone_key)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-2)
The unique PortOne key for the merchant.
* * *
##### `signature_hash` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#signature_hash)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-3)
Signature hash generated as per [Regular Plan Request Signature Documentation](https://docs.portone.cloud/docs/regular-plan).
* * *
##### `merchant_order_ref` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#merchant_order_ref)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-4)
The unique merchant order reference generated by the merchant.
* * *
##### `source` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#source)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-5)
The source of plan creation: `default`, `api`, or `checkout`.
* * *
##### `description` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#description)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string-%C2%B7-span-stylecolorredrequiredspan-1)
A description of the plan.
* * *
##### `environment` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#environment)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-6)
Plan environment, either `live` or `sandbox`.
* * *
##### `name` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#name)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-7)
Name of the plan.
* * *
##### notes [Skip link to notes](https://docs.portone.cloud/docs/creating-a-regular-plan\#notes)
###### _array of objects_ [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#array-of-objects)
The JSON array for additional notes
> ##### key [Skip link to key](https://docs.portone.cloud/docs/creating-a-regular-plan\#key)
>
> ###### _string_ · The key describing the note. Example: `special_instructions` or `gift_wrap`. [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string-%C2%B7-the-key-describing-the-note-example-special_instructions-or-gift_wrap)
>
> ##### value [Skip link to value](https://docs.portone.cloud/docs/creating-a-regular-plan\#value)
>
> ###### _string_ · The value of the note. Example: `Deliver between 9-11 AM` or `Yes`. [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string-%C2%B7-the-value-of-the-note-example-deliver-between-9-11-am-or-yes)
* * *
### **Regular Plan-Specific Parameters** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#regular-plan-specific-parameters)
##### `currency` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#currency)
###### _string_ · requiredCurrency of the plan (e.g., `USD`). [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspancurrency-of-the-plan-eg-usd)
* * *
##### `plan_type` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#plan_type)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-8)
Type of plan. Set to `REGULAR`.
* * *
##### `amount` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#amount)
###### _double_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#double--%C2%B7-span-stylecolorredrequiredspan)
The fixed recurring amount.
* * *
##### `frequency` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#frequency)
###### _integer_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#integer--%C2%B7-span-stylecolorredrequiredspan)
Explaining the frequency and period fields with examples below:
W (Weeks): A period of W means each step is in weeks.
M (Months): A period of M means each step is in months.
Q (Quarters): A period of Q means each step is in quarters (3-month periods).
Y (Years): A period of Y means each step is in years.
The frequency number indicates how often the event will occur within the specified period.
For example:
If frequency is 2 and period is W, the event will happen every 2 weeks.
If frequency is 3 and period is M, the event will happen every 3 months.
* * *
##### `period` [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#period)
###### _string_ · required [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#string--%C2%B7-span-stylecolorredrequiredspan-9)
Period of the plan (e.g., `D` for daily, `M` for monthly).
Explaining the frequency and period fields with examples below:
W (Weeks): A period of W means each step is in weeks.
M (Months): A period of M means each step is in months.
Q (Quarters): A period of Q means each step is in quarters (3-month periods).
Y (Years): A period of Y means each step is in years.
The frequency number indicates how often the event will occur within the specified period.
For example:
If frequency is 2 and period is W, the event will happen every 2 weeks.
If frequency is 3 and period is M, the event will happen every 3 months.
* * *
## **Response** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#response)
#### **Success Response** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#success-response)
JSON
```rdmd-code lang-json theme-light
{
"merchant_order_ref": "MerchantOrder12345",
"order_ref": "PortOneOrder12345",
"status_code": "200"
}
```
#### **Error Response** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#error-response)
JSON
```rdmd-code lang-json theme-light
{
"is_success": false,
"message": "The API request failed due to invalid parameters.",
"status_code": "400",
"status_reason": "Bad Request"
}
```
* * *
## **Best Practices** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#best-practices)
- **Environment Selection**: Use `sandbox` for testing and `live` for production.
- **Validation**: Ensure all required fields are correctly validated before sending the request.
- **Testing**: Test your API integration in the sandbox environment before moving to production.
* * *
## **Key Notes** [Skip link to [object Object]](https://docs.portone.cloud/docs/creating-a-regular-plan\#key-notes)
- **Regular Plans**: Suitable for fixed recurring payments like subscriptions or memberships.
- **Frequency and Period**: Ensure the values align with the intended billing cycle.
- **Descriptive Details**: Use descriptive names and notes for easier plan management and tracking.
* * *
This document serves as a comprehensive guide to creating **Regular Plans** with the PortOne API.