POST
/
plans
curl --request POST \
  --url https://sandbox.cashfree.com/pg/plans \
  --header 'Content-Type: application/json' \
  --header 'x-api-version: <x-api-version>' \
  --header 'x-client-id: <api-key>' \
  --header 'x-client-secret: <api-key>' \
  --data '{
  "plan_id": "plan_12345",
  "plan_name": "Plan 12345",
  "plan_type": "PERIODIC",
  "plan_currency": "INR",
  "plan_recurring_amount": 10,
  "plan_max_amount": 100,
  "plan_max_cycles": 10,
  "plan_intervals": 2,
  "plan_interval_type": "WEEK",
  "plan_note": "Test Plan"
}'
{
  "plan_currency": "INR",
  "plan_id": "144436-03471-JD_TEST",
  "plan_interval_type": "WEEK",
  "plan_intervals": 1,
  "plan_max_amount": 1,
  "plan_max_cycles": 4,
  "plan_name": "abscede",
  "plan_note": "lsdkdn",
  "plan_recurring_amount": 1,
  "plan_status": "ACTIVE",
  "plan_type": "PERIODIC"
}

Authorizations

x-client-id
string
header
required

Client app ID. You can find your app id in the Merchant Dashboard.

x-client-secret
string
header
required

Client secret key. You can find your secret in the Merchant Dashboard.

Headers

x-api-version
string
default:2023-08-01
required

API version to be used. Format is in YYYY-MM-DD

x-request-id
string

Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to cashfree

x-idempotency-key
string

An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions.

Body

application/json
Request body to create a plan.
plan_id
string
required

Unique ID to identify the plan. Only alpha-numerics, dot, hyphen and underscore allowed.

Required string length: 1 - 40
plan_name
string
required

Name of the plan.

Required string length: 1 - 40
plan_type
string
required

Type of the plan. Possible values - PERIODIC, ON_DEMAND.

plan_max_amount
number
required

Maximum amount for the plan.

plan_currency
string

Currency of the plan.

plan_recurring_amount
number

Recurring amount for the plan. Required for PERIODIC plan_type.

plan_max_cycles
integer

Maximum number of payment cycles for the plan.

plan_intervals
integer

Number of billing cycles between charges. For instance, if set to 2 and the interval type is 'week', the service will be billed every 2 weeks. Similarly, if set to 3 and the interval type is 'month', the service will be billed every 3 months. Required for PERIODIC plan_type.

plan_interval_type
string

Interval type for the plan. Possible values - DAY, WEEK, MONTH, YEAR.

plan_note
string

Note for the plan.

Response

200
application/json
Plan Created

The response returned for Get, Create and Manage Plan APIs

plan_currency
string

Currency for the plan.

plan_id
string

Plan ID provided by merchant.

plan_interval_type
string

Interval type for the plan.

plan_intervals
integer

Number of intervals for the plan.

plan_max_amount
number

Maximum amount for the plan.

plan_max_cycles
integer

Maximum number of payment cycles for the plan.

plan_name
string

Name of the plan.

plan_note
string

Note for the plan.

plan_recurring_amount
number

Recurring amount for the plan.

plan_status
string

Status of the plan.

plan_type
string

Type of the plan.