Skip to main content
POST
Estimate a subscription

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Body

Subscription estimate input serializer for generating a pricing estimate.

This payload has two forms — see anyOf:

  • Single-phase — omit phases; the order-level starts_at, contract_length, billing_frequency and bricks define 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.

starts_at
string<date>
required

The start date of the subscription. Required unless phases is provided, in which case phase 0's start date is used.

contract_length
integer
required

The length of the contract in months. Required unless phases is provided, in which case it is the sum of the phase lengths.

Required range: x >= 1
billing_frequency
enum<string>
required

The billing frequency. Required unless phases is provided, in which case each phase declares its own billing_frequency.

  • MONTHLY - Monthly
  • QUARTERLY - Quarterly
  • SEMI_ANNUALLY - Semi-annually
  • ANNUALLY - Annually
  • ALL_UPFRONT - All upfront
Available options:
MONTHLY,
QUARTERLY,
SEMI_ANNUALLY,
ANNUALLY,
ALL_UPFRONT
plan_id
string<uuid>
required

The ID of the plan. Required unless every phase declares its own plan_id — it is the plan for any phase that does not.

bricks
object[]
required

The bricks included in the subscription. Required unless phases is provided, in which case every brick comes from the phases.

currency
enum<string>
default:USD

Optional currency to be used for the subscription. Defaults to USD.

  • USD - United States Dollar
  • EUR - Euros
  • GBP - Great British Pound
  • AUD - Australian Dollar
  • CAD - Canadian Dollar
  • INR - Indian Rupee
Available options:
USD,
EUR,
GBP,
AUD,
CAD,
INR
discount_coupons
string[]

Discount coupon codes to apply to the subscription. Currently only supports one discount coupon - only the first one in the list will be applied.

phases
object[] | null

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.

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.

ends_at
string<date>
required

The end date of the subscription

sub_total
integer
required

Subtotal before taxes and discounts

grand_total
integer
required

Final total after taxes and discounts

line_items
object[]
required

The line items of the subscription

billing_schedule
object[]
required

The billing schedule of the subscription

grand_total_details
any
required

Breakdown containing total discount and tax amounts

phases
object[]

Per-phase breakdown. Only present for multi-phase estimates.