订阅计划
检索计划
获取计划的完整详细信息,包括其阶段、按国家/地区定价和附加的促销。
GET
/
subscriptions
/
plans
/
{plan_id}
检索计划
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": []
}
],
"promotions": [
{
"promotion_id": "8f2d6c1e-3b7a-4c55-9a1e-2f4d8b7c6a10",
"name": "Welcome 20% x3",
"type": "AUTOMATIC",
"status": "ENABLED",
"cycles": 3,
"on_pause": "KEEP",
"attached_at": "2026-11-02T14:00:00Z"
}
],
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-15T10:30:00.000000Z",
"account_ids": [
"a5b50509-2f47-444e-8056-feb736ad89ae"
],
"retries": null,
"retry_split": null,
"meters": []
}
授权
请求头
您的 Yuno Dashboard 中的 account_id(UUID)。必填:缺少该参数时返回 400 BAD_REQUEST("Invalid x-account-code header.")。
此页面对您有帮助吗?
⌘I
检索计划
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": []
}
],
"promotions": [
{
"promotion_id": "8f2d6c1e-3b7a-4c55-9a1e-2f4d8b7c6a10",
"name": "Welcome 20% x3",
"type": "AUTOMATIC",
"status": "ENABLED",
"cycles": 3,
"on_pause": "KEEP",
"attached_at": "2026-11-02T14:00:00Z"
}
],
"created_at": "2024-01-15T10:30:00.000000Z",
"updated_at": "2024-01-15T10:30:00.000000Z",
"account_ids": [
"a5b50509-2f47-444e-8056-feb736ad89ae"
],
"retries": null,
"retry_split": null,
"meters": []
}