Subscriptions Plans
Retrieve Plan
Get the full details of a plan, including its phases and per-country pricing.
GET
/
plans
/
{plan_id}
Retrieve Plan
curl --request GET \
--url https://api-sandbox.y.uno/v1/plans/{plan_id} \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/plans/{plan_id}"
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/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/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 => [
"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/plans/{plan_id}"
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/plans/{plan_id}")
.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/plans/{plan_id}")
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{
"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
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
Was this page helpful?
⌘I
Retrieve Plan
curl --request GET \
--url https://api-sandbox.y.uno/v1/plans/{plan_id} \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/plans/{plan_id}"
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/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/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 => [
"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/plans/{plan_id}"
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/plans/{plan_id}")
.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/plans/{plan_id}")
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{
"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."
]
}