Skip to main content
POST
Estimate a subscription upgrade

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Path Parameters

subscription_id
string
required
Pattern: ^([a-zA-Z\d\-]+)$

Body

Subscription upgrade estimate input serializer for generating pricing estimate for subscription order upgrade.

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.

starts_at
string<date>
required

The effective date of the subscription upgrade. Required only when phases is omitted: when phases is provided the phases own the timeline, so the effective date is taken from the first phase's starts_at and this order-level value is ignored.

bricks
object[]
required

The bricks included in subscription upgrade. Quantity is use to upgrade 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.)

plan_id
string<uuid>

Optional plan ID for the upgrade. When provided, the upgrade switches to the latest published version of that plan; when omitted, it keeps the subscription's existing plan version and contracted pricing. Must be sent together with bricksplan_id alone is rejected with 400. See the endpoint description for full semantics including cross-plan upgrades and merged plan versions.

discount_coupons
string[]

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

phases
object[] | null

Optional list of phases for a multi-phase upgrade. Each phase's phase_position must match a phase on the base order; only the phases being changed need to be sent, and omitted positions are inherited from the base order unchanged. Order-level bricks and starts_at are ignored when phases are provided — the phases own the timeline and the first phase's starts_at is the upgrade's effective date.

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.