Subscriptions Plans
List Plans
Returns a paginated list of your plans. Use Retrieve Plan to get metadata and phases for a single plan.
GET
/
subscriptions
/
plans
List Plans
curl --request GET \
--url https://api-sandbox.y.uno/v1/subscriptions/plans \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/subscriptions/plans"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'public-api-key': '<api-key>', 'private-secret-key': '<api-key>'}
};
fetch('https://api-sandbox.y.uno/v1/subscriptions/plans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.y.uno/v1/subscriptions/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 => [
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/subscriptions/plans"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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-sandbox.y.uno/v1/subscriptions/plans")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/subscriptions/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "00000000-0000-4000-8000-000000000001",
"account_id": "00000000-0000-4000-8000-000000000002",
"name": "Streaming Pro",
"merchant_reference": "streaming-pro-monthly",
"status": "ACTIVE",
"base_amount": {
"currency": "USD",
"value": 20
},
"frequency": {
"type": "MONTH",
"value": 1
},
"subscribers_count": 3,
"countries": [
"BR",
"US"
],
"created_at": "2024-01-15T10:30:00.000000Z"
}
],
"pagination": {
"total": 1,
"limit": 20,
"offset": 0,
"has_more": false
}
}{
"code": "INVALID_PARAMETERS",
"messages": [
"The limit must be greater than or equal to 1"
]
}List items are a summary, not the full plan
metadata and phases are only returned by Retrieve Plan, not by this list endpoint. If you need either one for every plan in a grid, call Retrieve Plan per item.Authorizations
Headers
The account_id found in your Yuno Dashboard (UUID). Required unless account_id is supplied as a query parameter — with neither, the call returns 400 BAD_REQUEST ("Invalid x-account-code header.").
Query Parameters
Scope the list to one account. An alternative to the X-Account-Code header; one of the two must be present.
Maximum number of plans to return. Defaults to 20.
Number of plans to skip. Defaults to 0.
Was this page helpful?
⌘I
List Plans
curl --request GET \
--url https://api-sandbox.y.uno/v1/subscriptions/plans \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/subscriptions/plans"
headers = {
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'public-api-key': '<api-key>', 'private-secret-key': '<api-key>'}
};
fetch('https://api-sandbox.y.uno/v1/subscriptions/plans', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api-sandbox.y.uno/v1/subscriptions/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 => [
"private-secret-key: <api-key>",
"public-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api-sandbox.y.uno/v1/subscriptions/plans"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("public-api-key", "<api-key>")
req.Header.Add("private-secret-key", "<api-key>")
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-sandbox.y.uno/v1/subscriptions/plans")
.header("public-api-key", "<api-key>")
.header("private-secret-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-sandbox.y.uno/v1/subscriptions/plans")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "00000000-0000-4000-8000-000000000001",
"account_id": "00000000-0000-4000-8000-000000000002",
"name": "Streaming Pro",
"merchant_reference": "streaming-pro-monthly",
"status": "ACTIVE",
"base_amount": {
"currency": "USD",
"value": 20
},
"frequency": {
"type": "MONTH",
"value": 1
},
"subscribers_count": 3,
"countries": [
"BR",
"US"
],
"created_at": "2024-01-15T10:30:00.000000Z"
}
],
"pagination": {
"total": 1,
"limit": 20,
"offset": 0,
"has_more": false
}
}{
"code": "INVALID_PARAMETERS",
"messages": [
"The limit must be greater than or equal to 1"
]
}