curl --request POST \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/recast/estimate \
--header 'Content-Type: application/json' \
--header 'X-SALESBRICKS-KEY: <api-key>' \
--data '
{
"starts_at": "2023-12-25",
"contract_length": 2,
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"adjustment_credit": 123,
"adjustment_credit_label": "<string>",
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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/{subscription_id}/recast/estimate"
payload = {
"starts_at": "2023-12-25",
"contract_length": 2,
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": False
}
]
}
],
"adjustment_credit": 123,
"adjustment_credit_label": "<string>",
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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,
bricks: [
{
brick_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
discount: [{rate: '<string>', amount: 123, renews: false}]
}
],
adjustment_credit: 123,
adjustment_credit_label: '<string>',
plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
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/{subscription_id}/recast/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/{subscription_id}/recast/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,
'bricks' => [
[
'brick_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'discount' => [
[
'rate' => '<string>',
'amount' => 123,
'renews' => false
]
]
]
],
'adjustment_credit' => 123,
'adjustment_credit_label' => '<string>',
'plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'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/{subscription_id}/recast/estimate"
payload := strings.NewReader("{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\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 \"adjustment_credit\": 123,\n \"adjustment_credit_label\": \"<string>\",\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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/{subscription_id}/recast/estimate")
.header("X-SALESBRICKS-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\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 \"adjustment_credit\": 123,\n \"adjustment_credit_label\": \"<string>\",\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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/{subscription_id}/recast/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 \"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 \"adjustment_credit\": 123,\n \"adjustment_credit_label\": \"<string>\",\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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 recast
Gets a pricing estimate for an open subscription recast including the billing schedule and grand total.
curl --request POST \
--url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/recast/estimate \
--header 'Content-Type: application/json' \
--header 'X-SALESBRICKS-KEY: <api-key>' \
--data '
{
"starts_at": "2023-12-25",
"contract_length": 2,
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": false
}
]
}
],
"adjustment_credit": 123,
"adjustment_credit_label": "<string>",
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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/{subscription_id}/recast/estimate"
payload = {
"starts_at": "2023-12-25",
"contract_length": 2,
"bricks": [
{
"brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"quantity": 123,
"discount": [
{
"rate": "<string>",
"amount": 123,
"renews": False
}
]
}
],
"adjustment_credit": 123,
"adjustment_credit_label": "<string>",
"plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"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,
bricks: [
{
brick_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
quantity: 123,
discount: [{rate: '<string>', amount: 123, renews: false}]
}
],
adjustment_credit: 123,
adjustment_credit_label: '<string>',
plan_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
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/{subscription_id}/recast/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/{subscription_id}/recast/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,
'bricks' => [
[
'brick_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'quantity' => 123,
'discount' => [
[
'rate' => '<string>',
'amount' => 123,
'renews' => false
]
]
]
],
'adjustment_credit' => 123,
'adjustment_credit_label' => '<string>',
'plan_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'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/{subscription_id}/recast/estimate"
payload := strings.NewReader("{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\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 \"adjustment_credit\": 123,\n \"adjustment_credit_label\": \"<string>\",\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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/{subscription_id}/recast/estimate")
.header("X-SALESBRICKS-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"starts_at\": \"2023-12-25\",\n \"contract_length\": 2,\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 \"adjustment_credit\": 123,\n \"adjustment_credit_label\": \"<string>\",\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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/{subscription_id}/recast/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 \"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 \"adjustment_credit\": 123,\n \"adjustment_credit_label\": \"<string>\",\n \"plan_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\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
Path Parameters
^([a-zA-Z\d\-]+)$Body
- SubscriptionInputRecastEstimateSinglePhase
- SubscriptionInputRecastEstimateMultiPhase
Subscription upgrade estimate input serializer for generating pricing estimate for subscription order recast.
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.
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 bricks included in subscription recast. Quantity is used to update the add-on quantity (ie. adding 2 more units should be quantity 2 -> quantity 4). For usage, quantity is used to set the pre-commitment (ie. previously having 5 pre-commitment quantity and updating it to 10 would update the pre-commitment quantity to 10.) Required unless phases is provided.
Show child attributes
Show child attributes
Credit that will be applied against future invoices. Send null to clear a manual override and re-enable auto-calculation.
The label for the adjustment credit. Defaults to 'Adjustment credit'
The ID of the plan. Required unless every phase declares its own plan_id — it is the plan for any phase that does not.
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