API Test Keys

Fetch a Plan With ID

GET
/v1/plans/:id

Click to copy

Use this endpoint to retrieve the details of a plan using its unique identifier.

Is this page helpful?

Curl

change language

change language

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
2
-X GET https://api.razorpay.com/v1/plans/plan_00000000000001 \

Success

Failure

1
{
2
"id":"plan_00000000000001",
3
"entity":"plan",
4
"interval":1,
5
"period":"weekly",
6
"item":{
7
"id":"item_00000000000001",
8
"active":true,
9
"name":"Test plan - Weekly",
10
"description":"Description for the test plan - Weekly",
11
"amount":69900,
12
"unit_amount":69900,
13
"currency":"INR",
14
"type":"plan",
15
"unit":null,
16
"tax_inclusive":false,
17
"hsn_code":null,
18
"sac_code":null,
19
"tax_rate":null,
20
"tax_id":null,
21
"tax_group_id":null,
22
"created_at":1580220492,
23
"updated_at":1580220492
24
},
25
"notes":{
26
"notes_key_1":"Tea, Earl Grey, Hot",
27
"notes_key_2":"Tea, Earl Grey… decaf."
28
},
29
"created_at":1580220492
30
}
Path Parameters
id

*

string

The unique identifier of the plan. For example, plan_00000000000001.

Response Parameters
id
string

The unique identifier linked to a plan. For example, plan_00000000000001. This ID is used when creating a subscription for a customer.

entity
string

The entity being created. Here, it is plan.

interval
integer

Used together with period to define how often the customer should be charged.

period
string

Used together with interval to define how often the customer should be charged. Possible values:

  • daily
  • weekly
  • monthly
  • yearly

item
array

Details of the plan.

Show child parameters (5)

notes
object

Notes you can enter of the contact for future reference. This is a key-value pair. You can enter a maximum of 15 key-value pairs. For example, "note_key": "Monthly Gym".

created_at
integer

The Unix timestamp at which the plan was created.

Errors

an_id%7D is not a valid id

Error Status: 400

This error occurs when you are not passing the plan_id in the API endpoint to fetch a plan based on the ID.

Solution

Fetch a Plan With ID

GET
/v1/plans/:id

Click to copy

Use this endpoint to retrieve the details of a plan using its unique identifier.

Is this page helpful?

Path Parameters
id

*

string

The unique identifier of the plan. For example, plan_00000000000001.

Response Parameters
id
string

The unique identifier linked to a plan. For example, plan_00000000000001. This ID is used when creating a subscription for a customer.

entity
string

The entity being created. Here, it is plan.

interval
integer

Used together with period to define how often the customer should be charged.

period
string

Used together with interval to define how often the customer should be charged. Possible values:

  • daily
  • weekly
  • monthly
  • yearly

item
array

Details of the plan.

Show child parameters (5)

notes
object

Notes you can enter of the contact for future reference. This is a key-value pair. You can enter a maximum of 15 key-value pairs. For example, "note_key": "Monthly Gym".

created_at
integer

The Unix timestamp at which the plan was created.

Errors

an_id%7D is not a valid id

Error Status: 400

This error occurs when you are not passing the plan_id in the API endpoint to fetch a plan based on the ID.

Solution

Curl

change language

change language

1
curl -u [YOUR_KEY_ID]:[YOUR_KEY_SECRET] \
2
-X GET https://api.razorpay.com/v1/plans/plan_00000000000001 \

Success

Failure

1
{
2
"id":"plan_00000000000001",
3
"entity":"plan",
4
"interval":1,
5
"period":"weekly",
6
"item":{
7
"id":"item_00000000000001",
8
"active":true,
9
"name":"Test plan - Weekly",
10
"description":"Description for the test plan - Weekly",
11
"amount":69900,
12
"unit_amount":69900,
13
"currency":"INR",
14
"type":"plan",
15
"unit":null,
16
"tax_inclusive":false,
17
"hsn_code":null,
18
"sac_code":null,
19
"tax_rate":null,
20
"tax_id":null,
21
"tax_group_id":null,
22
"created_at":1580220492,
23
"updated_at":1580220492
24
},
25
"notes":{
26
"notes_key_1":"Tea, Earl Grey, Hot",
27
"notes_key_2":"Tea, Earl Grey… decaf."
28
},
29
"created_at":1580220492
30
}