Retrieve Plan
Get the full details of a plan, including its phases and per-country pricing.
curl --request GET \
--url https://api-sandbox.y.uno/v1/subscriptions/plans/{plan_id} \
--header 'X-Account-Code: <x-account-code>' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/subscriptions/plans/{plan_id}"
headers = {
"X-Account-Code": "<x-account-code>",
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-Account-Code': '<x-account-code>',
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/subscriptions/plans/{plan_id}', 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/{plan_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Account-Code: <x-account-code>",
"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/{plan_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Account-Code", "<x-account-code>")
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/{plan_id}")
.header("X-Account-Code", "<x-account-code>")
.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/{plan_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Account-Code"] = '<x-account-code>'
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000001",
"account_id": "00000000-0000-4000-8000-000000000002",
"name": "Streaming Pro",
"description": "Access to Pro features, billed monthly",
"merchant_reference": "streaming-pro-monthly",
"status": "ACTIVE",
"base_amount": {
"currency": "USD",
"value": 20
},
"frequency": {
"type": "MONTH",
"value": 1
},
"country_prices": [
{
"country": "US",
"amount": {
"currency": "USD",
"value": 20
}
},
{
"country": "BR",
"amount": {
"currency": "BRL",
"value": 99.9
}
}
],
"allowed_payment_methods": [
"CARD",
"PIX"
],
"metadata": [
{
"key": "campaign",
"value": "app_store"
}
],
"phases": [
{
"order": 1,
"name": "Intro",
"type": "TRIAL",
"duration": {
"type": "MONTH",
"value": 3
},
"frequency": {
"type": "MONTH",
"value": 1
},
"amount": {
"currency": "USD",
"value": 9.99
},
"total_payments": 3,
"country_prices": []
},
{
"order": 2,
"name": "Regular",
"type": "REGULAR",
"duration": null,
"frequency": null,
"amount": null,
"total_payments": null,
"country_prices": []
}
],
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-15T10:30:00.000000Z"
}{
"code": "PLAN_NOT_FOUND",
"messages": [
"Plan not found."
]
}Authorizations
Headers
The account_id found in your Yuno Dashboard (UUID). Required — omitting it returns 400 BAD_REQUEST ("Invalid x-account-code header.").
Path Parameters
The unique identifier of the plan.
Response
200
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Every account the plan is available on. Always returned; contains account_id when the plan is scoped to a single account.
The retry configuration subscriptions created from this plan inherit. null when the plan sets none.
The Smart Retries A/B split configuration attached to this plan. null when none is set.
The metered prices attached to this plan. Empty when the plan has no usage-based pricing; see Attach Meter to Plan.
Was this page helpful?
curl --request GET \
--url https://api-sandbox.y.uno/v1/subscriptions/plans/{plan_id} \
--header 'X-Account-Code: <x-account-code>' \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/subscriptions/plans/{plan_id}"
headers = {
"X-Account-Code": "<x-account-code>",
"public-api-key": "<api-key>",
"private-secret-key": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {
'X-Account-Code': '<x-account-code>',
'public-api-key': '<api-key>',
'private-secret-key': '<api-key>'
}
};
fetch('https://api-sandbox.y.uno/v1/subscriptions/plans/{plan_id}', 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/{plan_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-Account-Code: <x-account-code>",
"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/{plan_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-Account-Code", "<x-account-code>")
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/{plan_id}")
.header("X-Account-Code", "<x-account-code>")
.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/{plan_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-Account-Code"] = '<x-account-code>'
request["public-api-key"] = '<api-key>'
request["private-secret-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "00000000-0000-4000-8000-000000000001",
"account_id": "00000000-0000-4000-8000-000000000002",
"name": "Streaming Pro",
"description": "Access to Pro features, billed monthly",
"merchant_reference": "streaming-pro-monthly",
"status": "ACTIVE",
"base_amount": {
"currency": "USD",
"value": 20
},
"frequency": {
"type": "MONTH",
"value": 1
},
"country_prices": [
{
"country": "US",
"amount": {
"currency": "USD",
"value": 20
}
},
{
"country": "BR",
"amount": {
"currency": "BRL",
"value": 99.9
}
}
],
"allowed_payment_methods": [
"CARD",
"PIX"
],
"metadata": [
{
"key": "campaign",
"value": "app_store"
}
],
"phases": [
{
"order": 1,
"name": "Intro",
"type": "TRIAL",
"duration": {
"type": "MONTH",
"value": 3
},
"frequency": {
"type": "MONTH",
"value": 1
},
"amount": {
"currency": "USD",
"value": 9.99
},
"total_payments": 3,
"country_prices": []
},
{
"order": 2,
"name": "Regular",
"type": "REGULAR",
"duration": null,
"frequency": null,
"amount": null,
"total_payments": null,
"country_prices": []
}
],
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-15T10:30:00.000000Z"
}{
"code": "PLAN_NOT_FOUND",
"messages": [
"Plan not found."
]
}