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

Failure

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":"",
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":"",
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.

Errors

The API key/secret provided is invalid.

Error Status: 4xx

This error occurs due to a mismatch between the API credentials passed in the API call and those generated on the Dashboard.

Solution

count must be an integer between 1 and 100.

Error Status: 400

An invalid value was passed for the count query parameter. The API returns The count must be at least 1. (for count=0 or negative), The count may not be greater than 100. (for values above 100), or The count must be an integer. (for non-integer values).

Solution

skip must be a non-negative integer.

Error Status: 400

A negative value was passed for the skip query parameter.

Solution

from and to must be UNIX-epoch integers.

Error Status: 400

A non-integer value (for example a human-readable date like 2024-01-01) was passed for from or to. The API returns from must be an integer. or to must be an integer. respectively.

Solution

from and to must be between 946684800 and 5080579200.

Error Status: 400

The from or to value is outside the accepted UNIX-timestamp range (corresponds to roughly 2000-01-01 to 2131-01-01). The API returns from must be between 946684800 and 5080579200 or to must be between 946684800 and 5080579200 respectively. The bounds are inclusive.

Solution

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.

Errors

The API key/secret provided is invalid.

Error Status: 4xx

This error occurs due to a mismatch between the API credentials passed in the API call and those generated on the Dashboard.

Solution

count must be an integer between 1 and 100.

Error Status: 400

An invalid value was passed for the count query parameter. The API returns The count must be at least 1. (for count=0 or negative), The count may not be greater than 100. (for values above 100), or The count must be an integer. (for non-integer values).

Solution

skip must be a non-negative integer.

Error Status: 400

A negative value was passed for the skip query parameter.

Solution

from and to must be UNIX-epoch integers.

Error Status: 400

A non-integer value (for example a human-readable date like 2024-01-01) was passed for from or to. The API returns from must be an integer. or to must be an integer. respectively.

Solution

from and to must be between 946684800 and 5080579200.

Error Status: 400

The from or to value is outside the accepted UNIX-timestamp range (corresponds to roughly 2000-01-01 to 2131-01-01). The API returns from must be between 946684800 and 5080579200 or to must be between 946684800 and 5080579200 respectively. The bounds are inclusive.

Solution

Curl

change language

change language

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

Success

Failure

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":"",
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":"",
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
}