curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id} \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/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.salesbricks.com/api/v2/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 => [
"X-SALESBRICKS-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.salesbricks.com/api/v2/subscriptions/{subscription_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-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.salesbricks.com/api/v2/subscriptions/{subscription_id}")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ends_at": "2023-12-25",
"sub_total": 123,
"grand_total": 123,
"line_items": [
{
"quantity": 123,
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_unlimited": false,
"brick_name": "<string>",
"brick_code": "<string>",
"sub_total": 123,
"plan_id": "<string>",
"plan_name": "<string>",
"grand_total": "<string>",
"grand_total_details": "<string>",
"tiers_breakdown": [
{
"quantity": 0,
"unit_price": "<string>",
"sub_total": "<string>",
"duration_text": "<string>"
}
],
"pre_commitment_schedule": "<string>",
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"billing_schedule": [
{
"starts_at": "<string>",
"ends_at": "<string>",
"sub_total": 123,
"grand_total": "<string>",
"grand_total_details": "<string>"
}
],
"grand_total_details": "<unknown>",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"legal_name": "<string>",
"subscriptions": [
{
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ACTIVE",
"state": "ACTIVE",
"renewal_status": "AUTO_RENEWING",
"name": "<string>",
"starts_at": "2023-12-25",
"ends_at": "2023-12-25"
}
],
"external_id": "<string>",
"address": {
"line_1": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>",
"line_2": "<string>",
"region": "<string>"
},
"stripe_customer_id": "<string>",
"tax_id": "<string>"
},
"crm_account_id": "<string>",
"crm_opportunity_id": "<string>",
"renews_at": "2023-12-25",
"status": "ACTIVE",
"state": "ACTIVE",
"renewal_status": "AUTO_RENEWING",
"stage": "BUILDING",
"transaction_method": "ORDER_FORM",
"terminates_at": "2023-12-25",
"termination_reason": "POOR_PRODUCT_MARKET_FIT",
"time_zone": "<string>",
"starts_at": "2023-12-25",
"billing_frequency": "MONTHLY",
"point_of_contact": {
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"role": "<string>",
"preferred_name": "<string>"
},
"products": [
{
"name": "<string>",
"logo_image": "<string>"
}
],
"signatory_user": {
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"role": "<string>",
"preferred_name": "<string>"
},
"accounts_payable_emails": [
"jsmith@example.com"
],
"currency": "USD",
"payment_terms": 123,
"auto_renews": true,
"renewal_total": 123,
"renewal_contract_period": 123,
"pauses": [
{
"paused_at": "2023-11-07T05:31:56Z",
"resume_at": "2023-11-07T05:31:56Z"
}
],
"phases": [
{
"phase_position": 123,
"starts_at": "2023-12-25",
"ends_at": "2023-12-25",
"billing_frequency": "MONTHLY",
"payment_terms": 123,
"sub_total": 123,
"grand_total": 123,
"line_items": [
{
"quantity": 123,
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_unlimited": false,
"brick_name": "<string>",
"brick_code": "<string>",
"sub_total": 123,
"plan_id": "<string>",
"plan_name": "<string>",
"grand_total": "<string>",
"grand_total_details": "<string>",
"tiers_breakdown": [
{
"quantity": 0,
"unit_price": "<string>",
"sub_total": "<string>",
"duration_text": "<string>"
}
],
"pre_commitment_schedule": "<string>",
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"is_annual": true,
"billing_schedule": [
{
"starts_at": "<string>",
"ends_at": "<string>",
"sub_total": 123,
"grand_total": "<string>",
"grand_total_details": "<string>"
}
]
}
],
"metadata": "<unknown>",
"attributed_to": {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com"
},
"purchase_order": {
"code": "<string>"
}
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "<string>",
"error_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Retrieve a subscription
Returns the current subscription details for the specified ID, including plan name, lifecycle dates, billing information, point of contact, and line items. Use this endpoint to show subscription lifecycle info in user dashboards (e.g., start/end dates, contract renewal dates) and track active plan details.
curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id} \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}"
headers = {"X-SALESBRICKS-KEY": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-SALESBRICKS-KEY': '<api-key>'}};
fetch('https://api.salesbricks.com/api/v2/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.salesbricks.com/api/v2/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 => [
"X-SALESBRICKS-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.salesbricks.com/api/v2/subscriptions/{subscription_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-SALESBRICKS-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.salesbricks.com/api/v2/subscriptions/{subscription_id}")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"ends_at": "2023-12-25",
"sub_total": 123,
"grand_total": 123,
"line_items": [
{
"quantity": 123,
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_unlimited": false,
"brick_name": "<string>",
"brick_code": "<string>",
"sub_total": 123,
"plan_id": "<string>",
"plan_name": "<string>",
"grand_total": "<string>",
"grand_total_details": "<string>",
"tiers_breakdown": [
{
"quantity": 0,
"unit_price": "<string>",
"sub_total": "<string>",
"duration_text": "<string>"
}
],
"pre_commitment_schedule": "<string>",
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"billing_schedule": [
{
"starts_at": "<string>",
"ends_at": "<string>",
"sub_total": 123,
"grand_total": "<string>",
"grand_total_details": "<string>"
}
],
"grand_total_details": "<unknown>",
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customer": {
"customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"legal_name": "<string>",
"subscriptions": [
{
"subscription_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "ACTIVE",
"state": "ACTIVE",
"renewal_status": "AUTO_RENEWING",
"name": "<string>",
"starts_at": "2023-12-25",
"ends_at": "2023-12-25"
}
],
"external_id": "<string>",
"address": {
"line_1": "<string>",
"city": "<string>",
"zip": "<string>",
"country": "<string>",
"line_2": "<string>",
"region": "<string>"
},
"stripe_customer_id": "<string>",
"tax_id": "<string>"
},
"crm_account_id": "<string>",
"crm_opportunity_id": "<string>",
"renews_at": "2023-12-25",
"status": "ACTIVE",
"state": "ACTIVE",
"renewal_status": "AUTO_RENEWING",
"stage": "BUILDING",
"transaction_method": "ORDER_FORM",
"terminates_at": "2023-12-25",
"termination_reason": "POOR_PRODUCT_MARKET_FIT",
"time_zone": "<string>",
"starts_at": "2023-12-25",
"billing_frequency": "MONTHLY",
"point_of_contact": {
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"role": "<string>",
"preferred_name": "<string>"
},
"products": [
{
"name": "<string>",
"logo_image": "<string>"
}
],
"signatory_user": {
"person_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com",
"role": "<string>",
"preferred_name": "<string>"
},
"accounts_payable_emails": [
"jsmith@example.com"
],
"currency": "USD",
"payment_terms": 123,
"auto_renews": true,
"renewal_total": 123,
"renewal_contract_period": 123,
"pauses": [
{
"paused_at": "2023-11-07T05:31:56Z",
"resume_at": "2023-11-07T05:31:56Z"
}
],
"phases": [
{
"phase_position": 123,
"starts_at": "2023-12-25",
"ends_at": "2023-12-25",
"billing_frequency": "MONTHLY",
"payment_terms": 123,
"sub_total": 123,
"grand_total": 123,
"line_items": [
{
"quantity": 123,
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_unlimited": false,
"brick_name": "<string>",
"brick_code": "<string>",
"sub_total": 123,
"plan_id": "<string>",
"plan_name": "<string>",
"grand_total": "<string>",
"grand_total_details": "<string>",
"tiers_breakdown": [
{
"quantity": 0,
"unit_price": "<string>",
"sub_total": "<string>",
"duration_text": "<string>"
}
],
"pre_commitment_schedule": "<string>",
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"is_annual": true,
"billing_schedule": [
{
"starts_at": "<string>",
"ends_at": "<string>",
"sub_total": 123,
"grand_total": "<string>",
"grand_total_details": "<string>"
}
]
}
],
"metadata": "<unknown>",
"attributed_to": {
"user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"first_name": "<string>",
"last_name": "<string>",
"email": "jsmith@example.com"
},
"purchase_order": {
"code": "<string>"
}
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "<string>",
"error_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Response
Subscription detail serializer.
Deprecated: use state and renewal_status. Combines whether the subscription is being served with its renewal situation, and can lag behind a date-driven change such as a pause starting.
ACTIVE- ActiveORDER_NEEDED- Order neededOPEN_ORDER- Open orderSCHEDULED- ScheduledTERMINATED- TerminatedTERMINATING- TerminatingINACTIVE- InactivePAUSED- PausedSUPERSEDED- Superseded
ACTIVE, ORDER_NEEDED, OPEN_ORDER, SCHEDULED, TERMINATED, TERMINATING, INACTIVE, PAUSED, SUPERSEDED Whether the customer is being served today, in the subscription's time zone. A termination or pause that hasn't started yet doesn't change it; see terminates_at and pauses.
ACTIVE- ActivePAUSED- PausedTERMINATED- TerminatedINACTIVE- Inactive
ACTIVE, PAUSED, TERMINATED, INACTIVE What has to happen for the next contract, read from the subscription's orders and auto_renews whatever its state. OPEN_ORDER means an order is being built or awaits your signature. INACTIVE with AUTO_RENEWING is a lapsed auto-renewal. A subscription needs a renewal order now when state is ACTIVE, terminates_at is empty and this is ORDER_NEEDED or OPEN_ORDER, or when it is a lapsed auto-renewal.
AUTO_RENEWING- Auto-renewingORDER_NEEDED- Order neededOPEN_ORDER- Open orderWILL_NOT_RENEW- Won't renew
AUTO_RENEWING, ORDER_NEEDED, OPEN_ORDER, WILL_NOT_RENEW Reason code given when the subscription was terminated, if any
POOR_PRODUCT_MARKET_FIT- Poor Product-Market FitINSUFFICIENT_VALUE- Insufficient Perceived Value / ROIPOOR_ONBOARDING- Poor Onboarding ExperienceLOW_UTILIZATION- Low UtilizationPOOR_SUPPORT- Poor Customer Support and ServicePRICING_AND_CONTRACT- Pricing and Contract IssuesPRODUCT_RELIABILITY- Product Reliability, Performance, or Security ProblemsCOMPETITIVE_DISPLACEMENT- Competitive DisplacementORGANIZATIONAL_CHANGES- Customer Business or Organizational ChangesLACK_OF_INNOVATION- Lack of Product Innovation and EvolutionWENT_BANKRUPT- Went BankruptLOST_CHAMPION- Lost ChampionOTHER- Other
POOR_PRODUCT_MARKET_FIT, INSUFFICIENT_VALUE, POOR_ONBOARDING, LOW_UTILIZATION, POOR_SUPPORT, PRICING_AND_CONTRACT, PRODUCT_RELIABILITY, COMPETITIVE_DISPLACEMENT, ORGANIZATIONAL_CHANGES, LACK_OF_INNOVATION, WENT_BANKRUPT, LOST_CHAMPION, OTHER