curl --request POST \
--url https://api.salesbricks.com/api/v2/subscriptions/estimate \
--header 'Content-Type: application/json' \
--header 'X-SALESBRICKS-KEY: <api-key>' \
--data '
{
"starts_at": "2023-12-25",
"contract_length": 2,
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"currency": "USD",
"discount_coupons": [
"<string>"
],
"phases": [
{
"phase_position": 1,
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"starts_at": "2023-12-25",
"contract_length": 2,
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_terms": 499,
"discount_coupons": [
"<string>"
]
}
]
}
'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/estimate"
payload = {
"starts_at": "2023-12-25",
"contract_length": 2,
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": False
}
]
}
],
"currency": "USD",
"discount_coupons": ["<string>"],
"phases": [
{
"phase_position": 1,
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": False
}
]
}
],
"starts_at": "2023-12-25",
"contract_length": 2,
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_terms": 499,
"discount_coupons": ["<string>"]
}
]
}
headers = {
"X-SALESBRICKS-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-SALESBRICKS-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
starts_at: '2023-12-25',
contract_length: 2,
plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
bricks: [
{
brick_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
discount: [{rate: '<string>', amount: 123, renews: false}]
}
],
currency: 'USD',
discount_coupons: ['<string>'],
phases: [
{
phase_position: 1,
bricks: [
{
brick_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
discount: [{rate: '<string>', amount: 123, renews: false}]
}
],
starts_at: '2023-12-25',
contract_length: 2,
plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
payment_terms: 499,
discount_coupons: ['<string>']
}
]
})
};
fetch('https://api.salesbricks.com/api/v2/subscriptions/estimate', 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/estimate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'starts_at' => '2023-12-25',
'contract_length' => 2,
'plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'bricks' => [
[
'brick_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'discount' => [
[
'rate' => '<string>',
'amount' => 123,
'renews' => false
]
]
]
],
'currency' => 'USD',
'discount_coupons' => [
'<string>'
],
'phases' => [
[
'phase_position' => 1,
'bricks' => [
[
'brick_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'discount' => [
[
'rate' => '<string>',
'amount' => 123,
'renews' => false
]
]
]
],
'starts_at' => '2023-12-25',
'contract_length' => 2,
'plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'payment_terms' => 499,
'discount_coupons' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.salesbricks.com/api/v2/subscriptions/estimate"
payload := strings.NewReader("{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"currency\": \"USD\",\n \"discount_coupons\": [\n \"<string>\"\n ],\n \"phases\": [\n {\n \"phase_position\": 1,\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_terms\": 499,\n \"discount_coupons\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.salesbricks.com/api/v2/subscriptions/estimate")
.header("X-SALESBRICKS-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"currency\": \"USD\",\n \"discount_coupons\": [\n \"<string>\"\n ],\n \"phases\": [\n {\n \"phase_position\": 1,\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_terms\": 499,\n \"discount_coupons\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"currency\": \"USD\",\n \"discount_coupons\": [\n \"<string>\"\n ],\n \"phases\": [\n {\n \"phase_position\": 1,\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_terms\": 499,\n \"discount_coupons\": [\n \"<string>\"\n ]\n }\n ]\n}"
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",
"brick_name": "<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>",
"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",
"brick_name": "<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>"
}
]
}
]
}{
"error": {
"code": "ERR_BAD_REQUEST",
"message": "Bad request — the input payload is malformed, missing required fields, or contains invalid data."
}
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "Not found — the resource you are looking for does not exist."
}
}Estimate a subscription
Gets a pricing estimate for a subscription including the billing schedule and grand total.
curl --request POST \
--url https://api.salesbricks.com/api/v2/subscriptions/estimate \
--header 'Content-Type: application/json' \
--header 'X-SALESBRICKS-KEY: <api-key>' \
--data '
{
"starts_at": "2023-12-25",
"contract_length": 2,
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"currency": "USD",
"discount_coupons": [
"<string>"
],
"phases": [
{
"phase_position": 1,
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"starts_at": "2023-12-25",
"contract_length": 2,
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_terms": 499,
"discount_coupons": [
"<string>"
]
}
]
}
'import requests
url = "https://api.salesbricks.com/api/v2/subscriptions/estimate"
payload = {
"starts_at": "2023-12-25",
"contract_length": 2,
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": False
}
]
}
],
"currency": "USD",
"discount_coupons": ["<string>"],
"phases": [
{
"phase_position": 1,
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": False
}
]
}
],
"starts_at": "2023-12-25",
"contract_length": 2,
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"payment_terms": 499,
"discount_coupons": ["<string>"]
}
]
}
headers = {
"X-SALESBRICKS-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-SALESBRICKS-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
starts_at: '2023-12-25',
contract_length: 2,
plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
bricks: [
{
brick_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
discount: [{rate: '<string>', amount: 123, renews: false}]
}
],
currency: 'USD',
discount_coupons: ['<string>'],
phases: [
{
phase_position: 1,
bricks: [
{
brick_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
discount: [{rate: '<string>', amount: 123, renews: false}]
}
],
starts_at: '2023-12-25',
contract_length: 2,
plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
payment_terms: 499,
discount_coupons: ['<string>']
}
]
})
};
fetch('https://api.salesbricks.com/api/v2/subscriptions/estimate', 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/estimate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'starts_at' => '2023-12-25',
'contract_length' => 2,
'plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'bricks' => [
[
'brick_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'discount' => [
[
'rate' => '<string>',
'amount' => 123,
'renews' => false
]
]
]
],
'currency' => 'USD',
'discount_coupons' => [
'<string>'
],
'phases' => [
[
'phase_position' => 1,
'bricks' => [
[
'brick_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'discount' => [
[
'rate' => '<string>',
'amount' => 123,
'renews' => false
]
]
]
],
'starts_at' => '2023-12-25',
'contract_length' => 2,
'plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'payment_terms' => 499,
'discount_coupons' => [
'<string>'
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.salesbricks.com/api/v2/subscriptions/estimate"
payload := strings.NewReader("{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"currency\": \"USD\",\n \"discount_coupons\": [\n \"<string>\"\n ],\n \"phases\": [\n {\n \"phase_position\": 1,\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_terms\": 499,\n \"discount_coupons\": [\n \"<string>\"\n ]\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-SALESBRICKS-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.salesbricks.com/api/v2/subscriptions/estimate")
.header("X-SALESBRICKS-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"currency\": \"USD\",\n \"discount_coupons\": [\n \"<string>\"\n ],\n \"phases\": [\n {\n \"phase_position\": 1,\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_terms\": 499,\n \"discount_coupons\": [\n \"<string>\"\n ]\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.salesbricks.com/api/v2/subscriptions/estimate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-SALESBRICKS-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"currency\": \"USD\",\n \"discount_coupons\": [\n \"<string>\"\n ],\n \"phases\": [\n {\n \"phase_position\": 1,\n \"bricks\": [\n {\n \"brick_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"quantity\": 123,\n \"discount\": [\n {\n \"rate\": \"<string>\",\n \"amount\": 123,\n \"renews\": false\n }\n ]\n }\n ],\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"payment_terms\": 499,\n \"discount_coupons\": [\n \"<string>\"\n ]\n }\n ]\n}"
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",
"brick_name": "<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>",
"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",
"brick_name": "<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>"
}
]
}
]
}{
"error": {
"code": "ERR_BAD_REQUEST",
"message": "Bad request — the input payload is malformed, missing required fields, or contains invalid data."
}
}{
"error": {
"code": "ERR_NOT_FOUND",
"message": "Not found — the resource you are looking for does not exist."
}
}Authorizations
API key for authentication
Body
- SubscriptionInputEstimateSinglePhase
- SubscriptionInputEstimateMultiPhasePerPhasePlans
- SubscriptionInputEstimateMultiPhase
Subscription estimate input serializer for generating a pricing estimate.
This payload has two forms — see anyOf:
- Single-phase — omit
phases; the order-levelstarts_at,contract_length,billing_frequencyandbricksdefine the one phase and are required. - Multi-phase — send
phases; the phases own the timeline, billing frequency and bricks, and the order-level equivalents become optional (omitted, they are derived from the phases).
The fields are declared optional because OpenAPI 3.0 cannot make one field's required depend on another. Sending neither form is a 400.
Every phase needs a plan, so the multi-phase form splits in two: send an order-level plan_id (the plan for any phase that names none), or give every phase its own plan_id. A multi-phase payload naming no plan at all is a 400.
The start date of the subscription. Required unless phases is provided, in which case phase 0's start date is used.
The length of the contract in months. Required unless phases is provided, in which case it is the sum of the phase lengths.
x >= 1The billing frequency. Required unless phases is provided, in which case each phase declares its own billing_frequency.
MONTHLY- MonthlyQUARTERLY- QuarterlySEMI_ANNUALLY- Semi-annuallyANNUALLY- AnnuallyALL_UPFRONT- All upfront
MONTHLY, QUARTERLY, SEMI_ANNUALLY, ANNUALLY, ALL_UPFRONT The ID of the plan. Required unless every phase declares its own plan_id — it is the plan for any phase that does not.
The bricks included in the subscription. Required unless phases is provided, in which case every brick comes from the phases.
Show child attributes
Show child attributes
Optional currency to be used for the subscription. Defaults to USD.
USD- United States DollarEUR- EurosGBP- Great British PoundAUD- Australian DollarCAD- Canadian DollarINR- Indian Rupee
USD, EUR, GBP, AUD, CAD, INR Discount coupon codes to apply to the subscription. Currently only supports one discount coupon - only the first one in the list will be applied.
Optional list of phases for multi-phase orders. When provided, ALL phases come from this array (first element = phase 0, second = phase 1, etc.) and starts_at, contract_length, billing_frequency and bricks become optional — omit them and they are derived from the phases. plan_id is still required, and every brick in every phase must belong to it. When absent, the order-level fields define a single phase.
Show child attributes
Show child attributes
Response
Subscription /estimate output serializer from OrderPricing
SAL-6964: the commercial payload lives at exactly one altitude. A
multi-phase order carries it per phase and omits the order-level copies —
the same brick appears once per phase and may differ in each, so a single
flattened set can only misrepresent it. A single-phase order keeps the
order-level fields and omits phases entirely, since a lone phase
restates the order. See PHASE_OWNED_FIELDS.
The end date of the 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
Per-phase breakdown. Only present for multi-phase estimates.
Show child attributes
Show child attributes
Related topics
Estimate a subscription recastEstimate a subscription upgradeRetrieve next subscription invoice