List all plans
Returns a paginated list of all plans created for your account.
GET
/
plans
List all plans
curl --request GET \
--url https://api.razorpay.com/v1/plans \
--header 'Authorization: Basic <encoded-value>'const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.razorpay.com/v1/plans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.razorpay.com/v1/plans"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.razorpay.com/v1/plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.razorpay.com/v1/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.razorpay.com/v1/plans"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.razorpay.com/v1/plans")
.header("Authorization", "Basic <encoded-value>")
.asString();{
"entity": "collection",
"count": 1,
"items": [
{
"id": "plan_00000000000001",
"entity": "plan",
"interval": 1,
"period": "weekly",
"item": {
"id": "item_00000000000001",
"active": true,
"amount": 500,
"unit_amount": 500,
"currency": "INR",
"name": "Test Weekly 1",
"description": "Description for the weekly plan"
},
"created_at": 1580453311
}
]
}{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The amount must be greater than 0.",
"field": "amount"
}
}Authorizations
Use your Razorpay Key ID as the username and Key Secret as the password.
Query Parameters
Number of plans to return. Default is 10, maximum is 100.
Required range:
x <= 100Example:
10
Number of plans to skip before returning results. Used for pagination.
Example:
0
Was this page helpful?
⌘I
List all plans
curl --request GET \
--url https://api.razorpay.com/v1/plans \
--header 'Authorization: Basic <encoded-value>'const options = {method: 'GET', headers: {Authorization: 'Basic <encoded-value>'}};
fetch('https://api.razorpay.com/v1/plans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.razorpay.com/v1/plans"
headers = {"Authorization": "Basic <encoded-value>"}
response = requests.get(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.razorpay.com/v1/plans",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Basic <encoded-value>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}require 'uri'
require 'net/http'
url = URI("https://api.razorpay.com/v1/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Basic <encoded-value>'
response = http.request(request)
puts response.read_bodypackage main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.razorpay.com/v1/plans"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Basic <encoded-value>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.razorpay.com/v1/plans")
.header("Authorization", "Basic <encoded-value>")
.asString();{
"entity": "collection",
"count": 1,
"items": [
{
"id": "plan_00000000000001",
"entity": "plan",
"interval": 1,
"period": "weekly",
"item": {
"id": "item_00000000000001",
"active": true,
"amount": 500,
"unit_amount": 500,
"currency": "INR",
"name": "Test Weekly 1",
"description": "Description for the weekly plan"
},
"created_at": 1580453311
}
]
}{
"error": {
"code": "BAD_REQUEST_ERROR",
"description": "The amount must be greater than 0.",
"field": "amount"
}
}