API Test keys

API Test keys

Fetch All Plans

GET
/v1/plans

Click to copy

Use this endpoint to fetch details of all plans.

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 \

Success

1
{
2
"entity":"collection",
3
"count":2,
4
"items":[
5
{
6
"id":"plan_00000000000001",
7
"entity":"plan",
8
"interval":1,
9
"period":"weekly",
10
"item":{
11
"id":"item_00000000000001",
12
"active":true,
13
"name":"Test plan - Weekly",
14
"description":"Description for the test plan - Weekly",
15
"amount":69900,
16
"unit_amount":69900,
17
"currency":"INR",
18
"type":"plan",
19
"unit":null,
20
"tax_inclusive":false,
21
"hsn_code":null,
22
"sac_code":null,
23
"tax_rate":null,
24
"tax_id":null,
25
"tax_group_id":null,
26
"created_at":1580220492,
27
"updated_at":1580220492
28
},
29
"notes":{
30
"notes_key_1":"Tea, Earl Grey, Hot",
31
"notes_key_2":"Tea, Earl Grey… decaf."
32
},
33
"created_at":1580220492
34
},
35
{
36
"id":"plan_00000000000002",
37
"entity":"plan",
38
"interval":1,
39
"period":"monthly",
40
"item":{
41
"id":"item_00000000000002",
42
"active":true,
43
"name":"Test plan - Monthly",
44
"description":null,
45
"amount":79900,
46
"unit_amount":79900,
47
"currency":"INR",
48
"type":"plan",
49
"unit":null,
50
"tax_inclusive":false,
51
"hsn_code":null,
52
"sac_code":null,
53
"tax_rate":null,
54
"tax_id":null,
55
"tax_group_id":null,
56
"created_at":1580220483,
57
"updated_at":1580220483
58
},
59
"notes":[],
60
"created_at":1580220483
61
}
62
]
63
}
Query Parameters
from
integer

The Unix timestamp from when plans are to be fetched.

to
integer

The Unix timestamp till when plans are to be fetched.

count
integer

The number of plans to be fetched. Default value is 10. Maximum value is 100. This can be used for pagination in combination with skip.

skip
integer

The number of plans to be skipped. Default value is 0. This can be used for pagination in combination with count.

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.

Fetch All Plans

GET
/v1/plans

Click to copy

Use this endpoint to fetch details of all plans.

Is this page helpful?

Query Parameters
from
integer

The Unix timestamp from when plans are to be fetched.

to
integer

The Unix timestamp till when plans are to be fetched.

count
integer

The number of plans to be fetched. Default value is 10. Maximum value is 100. This can be used for pagination in combination with skip.

skip
integer

The number of plans to be skipped. Default value is 0. This can be used for pagination in combination with count.

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.

Curl

change language

change language

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

Success

1
{
2
"entity":"collection",
3
"count":2,
4
"items":[
5
{
6
"id":"plan_00000000000001",
7
"entity":"plan",
8
"interval":1,
9
"period":"weekly",
10
"item":{
11
"id":"item_00000000000001",
12
"active":true,
13
"name":"Test plan - Weekly",
14
"description":"Description for the test plan - Weekly",
15
"amount":69900,
16
"unit_amount":69900,
17
"currency":"INR",
18
"type":"plan",
19
"unit":null,
20
"tax_inclusive":false,
21
"hsn_code":null,
22
"sac_code":null,
23
"tax_rate":null,
24
"tax_id":null,
25
"tax_group_id":null,
26
"created_at":1580220492,
27
"updated_at":1580220492
28
},
29
"notes":{
30
"notes_key_1":"Tea, Earl Grey, Hot",
31
"notes_key_2":"Tea, Earl Grey… decaf."
32
},
33
"created_at":1580220492
34
},
35
{
36
"id":"plan_00000000000002",
37
"entity":"plan",
38
"interval":1,
39
"period":"monthly",
40
"item":{
41
"id":"item_00000000000002",
42
"active":true,
43
"name":"Test plan - Monthly",
44
"description":null,
45
"amount":79900,
46
"unit_amount":79900,
47
"currency":"INR",
48
"type":"plan",
49
"unit":null,
50
"tax_inclusive":false,
51
"hsn_code":null,
52
"sac_code":null,
53
"tax_rate":null,
54
"tax_id":null,
55
"tax_group_id":null,
56
"created_at":1580220483,
57
"updated_at":1580220483
58
},
59
"notes":[],
60
"created_at":1580220483
61
}
62
]
63
}