Subscriptions
Retrieve Subscription
Retrieves the details of a specific subscription by its ID.
GET
/
subscriptions
/
{subscription_id}
Retrieve Subscription
curl --request GET \
--url https://api-sandbox.y.uno/v1/subscriptions/{subscription_id} \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/subscriptions/{subscription_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/subscriptions/{subscription_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/{subscription_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/subscriptions/{subscription_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/subscriptions/{subscription_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/subscriptions/{subscription_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": "7304911d-5df9-429e-8488-ad41abea1a4c",
"name": "sub_001",
"description": "streaming service",
"account_id": "2404911d-5df9-429e-8488-ad41abea1a4b",
"merchant_reference": "001_marzo_23",
"soft_descriptor": "ACME SUBSCRIPTION",
"status": "ACTIVE",
"subscription_plan_id": "1904911d-5df9-429e-8488-ad41abea1a4d",
"amount": {
"currency": "USD",
"value": 12100
},
"frequency": {
"type": "MONTH",
"value": 1
},
"billing_cycles": {
"total": 10,
"current": 2,
"next_at": "2023-02-16T20:00:00.786342Z"
},
"customer_payer": {
"id": "3t04911d-5df9-429e-8488-ad41abea1a2c"
},
"payment_method": [
{
"type": "CARD",
"token": "9104911d-5df9-429e-8488-ad41abea1a4b",
"vaulted_token": "6104911d-5df9-429e-8488-ad41abea1a4b",
"card": {
"verify": false,
"card_data": {
"number": "4507990000000010",
"expiration_month": 10,
"expiration_year": 2025,
"security_code": 123,
"holder_name": "JOHN DOE"
}
}
}
],
"availability": {
"start_at": "2024-01-16T00:00:00.786342Z",
"finish_at": "2024-05-26T20:00:00.786342Z"
},
"trial_period": {
"billing_cycles": 1,
"amount": {
"value": 0,
"currency": ""
}
},
"metadata": {
"key": "sub_ext_id",
"value": "AA001"
},
"payments": [
"5104911d-5df9-229e-8468-bd41abea1a4s"
],
"subscription_agreement_id": null,
"created_at": "2023-12-16T20:46:54.786342Z",
"updated_at": "2023-12-16T21:00:54.786342Z"
}"{\n Refer to the HTTP Response Codes section for more details: 'https://docs.y.uno/reference/response-codes'\n}"Authorizations
Path Parameters
The unique identifier of the subscription.
Response
200
Example:
"7304911d-5df9-429e-8488-ad41abea1a4c"
Example:
"sub_001"
Example:
"streaming service"
Example:
"2404911d-5df9-429e-8488-ad41abea1a4b"
Example:
"001_marzo_23"
Example:
"ACME SUBSCRIPTION"
Example:
"ACTIVE"
Example:
"1904911d-5df9-429e-8488-ad41abea1a4d"
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Example:
"sa_6af2dfcd-44c0-4f16-a331-8bed3ed9c9fa"
Example:
"2023-12-16T20:46:54.786342Z"
Example:
"2023-12-16T21:00:54.786342Z"
Was this page helpful?
Previous
Update SubscriptionUpdates a subscription's fields, including retroactively adding stored credential usage data.
Next
⌘I
Retrieve Subscription
curl --request GET \
--url https://api-sandbox.y.uno/v1/subscriptions/{subscription_id} \
--header 'private-secret-key: <api-key>' \
--header 'public-api-key: <api-key>'import requests
url = "https://api-sandbox.y.uno/v1/subscriptions/{subscription_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/subscriptions/{subscription_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/{subscription_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/subscriptions/{subscription_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/subscriptions/{subscription_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/subscriptions/{subscription_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": "7304911d-5df9-429e-8488-ad41abea1a4c",
"name": "sub_001",
"description": "streaming service",
"account_id": "2404911d-5df9-429e-8488-ad41abea1a4b",
"merchant_reference": "001_marzo_23",
"soft_descriptor": "ACME SUBSCRIPTION",
"status": "ACTIVE",
"subscription_plan_id": "1904911d-5df9-429e-8488-ad41abea1a4d",
"amount": {
"currency": "USD",
"value": 12100
},
"frequency": {
"type": "MONTH",
"value": 1
},
"billing_cycles": {
"total": 10,
"current": 2,
"next_at": "2023-02-16T20:00:00.786342Z"
},
"customer_payer": {
"id": "3t04911d-5df9-429e-8488-ad41abea1a2c"
},
"payment_method": [
{
"type": "CARD",
"token": "9104911d-5df9-429e-8488-ad41abea1a4b",
"vaulted_token": "6104911d-5df9-429e-8488-ad41abea1a4b",
"card": {
"verify": false,
"card_data": {
"number": "4507990000000010",
"expiration_month": 10,
"expiration_year": 2025,
"security_code": 123,
"holder_name": "JOHN DOE"
}
}
}
],
"availability": {
"start_at": "2024-01-16T00:00:00.786342Z",
"finish_at": "2024-05-26T20:00:00.786342Z"
},
"trial_period": {
"billing_cycles": 1,
"amount": {
"value": 0,
"currency": ""
}
},
"metadata": {
"key": "sub_ext_id",
"value": "AA001"
},
"payments": [
"5104911d-5df9-229e-8468-bd41abea1a4s"
],
"subscription_agreement_id": null,
"created_at": "2023-12-16T20:46:54.786342Z",
"updated_at": "2023-12-16T21:00:54.786342Z"
}"{\n Refer to the HTTP Response Codes section for more details: 'https://docs.y.uno/reference/response-codes'\n}"