curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/current \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/current"
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}/current', 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}/current",
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}/current"
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}/current")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/current")
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",
"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",
"stage": "BUILDING",
"transaction_method": "ORDER_FORM",
"terminates_at": "2023-12-25",
"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>"
}
}{}Retrieve current subscription state
Returns the current state of a subscription, including its active status, current billing period, and real-time subscription information. This endpoint is optimized for displaying current subscription state in dashboards and real-time status updates.
curl --request GET \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/current \
--header 'X-SALESBRICKS-KEY: <api-key>'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/current"
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}/current', 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}/current",
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}/current"
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}/current")
.header("X-SALESBRICKS-KEY", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/current")
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",
"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",
"stage": "BUILDING",
"transaction_method": "ORDER_FORM",
"terminates_at": "2023-12-25",
"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>"
}
}{}Authorizations
API key for authentication
Path Parameters
^([a-zA-Z\d\-]+)$Response
Subscription detail serializer.
End date of subscription
Subtotal before taxes and discounts
Final total after taxes and discounts
The line items of the subscription
Show child attributes
Show child attributes
The billing schedule of the subscription
Show child attributes
Show child attributes
Breakdown containing total discount and tax amounts
Unique identifier for the subscription
Customer details
Show child attributes
Show child attributes
ID of the account linked in your connected CRM, if any.
ID of the opportunity linked in your connected CRM, if any.
Date of renewal
Current status of the subscription
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 Current stage of the subscription
BUILDING- OpenCLOSED- Closed WonCLOSED_LOST- Closed LostCLOSED_DELETE- Closed DeleteSELLER_SIGNING- SigningMIGRATING- Migrating
BUILDING, CLOSED, CLOSED_LOST, CLOSED_DELETE, SELLER_SIGNING, MIGRATING The medium by which the order is agreed.
ORDER_FORM- Order formSTRIPE- Stripe
ORDER_FORM, STRIPE Date of termination
Subscription time zone
Start date of subscription
Billing frequency of the subscription
MONTHLY- MonthlyQUARTERLY- QuarterlySEMI_ANNUALLY- Semi-annuallyANNUALLY- AnnuallyALL_UPFRONT- All upfrontCUSTOM- Custom
MONTHLY, QUARTERLY, SEMI_ANNUALLY, ANNUALLY, ALL_UPFRONT, CUSTOM Primary contact person for the subscription
Show child attributes
Show child attributes
Product details
Show child attributes
Show child attributes
User who signed the subscription agreement
Show child attributes
Show child attributes
List of email addresses for accounts payable contacts
The currency used
USD- United States DollarEUR- EurosGBP- Great British PoundAUD- Australian DollarCAD- Canadian DollarINR- Indian Rupee
USD, EUR, GBP, AUD, CAD, INR The payment terms for this susbcription
If the subscription will auto renew at the end of the current contract period
The grand total, in cents of currency, the subscription is estimated to renew at, for the same order and term as renewal_contract_period. Null while a renewal, upgrade or recast is open.
The length, in months, of the term the subscription renews for. When no renewal term was set, the term the renewal inherits: the current term, or for an upgrade, the term of the agreement it upgrades.
Every pause of the subscription, past, current and upcoming, oldest first. A pause is current when paused_at is in the past and resume_at is null or in the future. Empty when the subscription has never been paused.
Show child attributes
Show child attributes
Order phases with per-phase dates, billing config, and bricks. Omitted — not empty — unless the seller has multi-phase orders enabled and the order has phase rows, so treat its absence as 'single phase, read the order-level fields' rather than 'no phases'.
Show child attributes
Show child attributes
Optional metadata to add to the subscription.
The user that owns the subscription (account representative)
Show child attributes
Show child attributes
Purchase order for the subscription. Reported on every invoice generated for it, unless an invoice carries its own override. Null when the subscription has no purchase order.
Show child attributes
Show child attributes