Retrieve
curl --request GET \
--url https://{defaultHost}/v1/subscriptions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/subscriptions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/subscriptions/{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://{defaultHost}/v1/subscriptions/{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 => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/subscriptions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/subscriptions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "de2a9898-a491-41a0-b3fc-b05f3facb24e",
"object": "subscription",
"ad_hoc_amount": null,
"affiliation_expires_at": null,
"cancel_at_period_end": false,
"currency": "usd",
"current_period_end_at": 1798655997,
"current_period_start_at": 1796063997,
"ended_at": null,
"finite": false,
"last_renewal_reminder_sent_at": null,
"live_mode": true,
"manual_payment": false,
"metadata": {},
"pending_update": {},
"price_readonly": false,
"portal_url": "http://app.example.com/portal_redirect/subscriptions/de2a9898-a491-41a0-b3fc-b05f3facb24e",
"quantity": 1,
"remaining_period_count": null,
"restart_on_completed": false,
"restore_at": null,
"subtotal_amount": 2900,
"status": "active",
"tax_enabled": false,
"trial_end_at": null,
"trial_start_at": null,
"variant_options": null,
"affiliation": null,
"current_cancellation_act": null,
"current_period": "39197414-6979-4c0c-a0cd-8b22e2047808",
"customer": "bb16b7cd-8422-419c-9c03-4e11e1a3b477",
"discount": null,
"manual_payment_method": null,
"payment_method": "2e056049-9ba1-4ba9-9d04-869d169c91a3",
"price": "290d05a6-2480-438a-8ec6-8f19776cb470",
"purchase": "571058e1-60a5-464a-8575-f4ee1916847f",
"shipping_method": null,
"variant": null,
"created_at": 1796063997,
"updated_at": 1796063997
}Subscriptions
Retrieve
Retrieves details of a specific subscription.
GET
/
v1
/
subscriptions
/
{id}
Retrieve
curl --request GET \
--url https://{defaultHost}/v1/subscriptions/{id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{defaultHost}/v1/subscriptions/{id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{defaultHost}/v1/subscriptions/{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://{defaultHost}/v1/subscriptions/{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 => [
"Authorization: Bearer <token>"
],
]);
$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://{defaultHost}/v1/subscriptions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{defaultHost}/v1/subscriptions/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{defaultHost}/v1/subscriptions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "de2a9898-a491-41a0-b3fc-b05f3facb24e",
"object": "subscription",
"ad_hoc_amount": null,
"affiliation_expires_at": null,
"cancel_at_period_end": false,
"currency": "usd",
"current_period_end_at": 1798655997,
"current_period_start_at": 1796063997,
"ended_at": null,
"finite": false,
"last_renewal_reminder_sent_at": null,
"live_mode": true,
"manual_payment": false,
"metadata": {},
"pending_update": {},
"price_readonly": false,
"portal_url": "http://app.example.com/portal_redirect/subscriptions/de2a9898-a491-41a0-b3fc-b05f3facb24e",
"quantity": 1,
"remaining_period_count": null,
"restart_on_completed": false,
"restore_at": null,
"subtotal_amount": 2900,
"status": "active",
"tax_enabled": false,
"trial_end_at": null,
"trial_start_at": null,
"variant_options": null,
"affiliation": null,
"current_cancellation_act": null,
"current_period": "39197414-6979-4c0c-a0cd-8b22e2047808",
"customer": "bb16b7cd-8422-419c-9c03-4e11e1a3b477",
"discount": null,
"manual_payment_method": null,
"payment_method": "2e056049-9ba1-4ba9-9d04-869d169c91a3",
"price": "290d05a6-2480-438a-8ec6-8f19776cb470",
"purchase": "571058e1-60a5-464a-8575-f4ee1916847f",
"shipping_method": null,
"variant": null,
"created_at": 1796063997,
"updated_at": 1796063997
}Authorizations
Response
200 - application/json
Success
Expandable – The associated cancellation act ID.
Expandable – The associated period ID.
Expandable – The associated customer ID.
Expandable – The associated discount ID.
Expandable – The associated manual payment method ID.
Expandable – The associated payment method ID.
Expandable – Property not returned unless expanded.
Expandable – The associated price ID.
Expandable – The associated purchase ID.
Expandable – The associated shipping method ID.
Expandable – The associated variant ID.
Was this page helpful?