Skip to main content
POST
Create a subscription recast

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Path Parameters

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

Body

Subscription recast input serializer; similar to SubscriptionInputUpgradeSerializer but with adjustment credits.

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 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
bricks
object[]
required

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.

adjustment_credit
integer | null

Credit that will be applied against future invoices. Send null to clear a manual override and re-enable auto-calculation.

adjustment_credit_label
string | null

The label for the adjustment credit. Defaults to 'Adjustment credit'

plan_id
string<uuid>

Optional plan id to switch plans, otherwise it will use the base order's latest plan version.

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.

payment_terms
integer

The number of days from an invoice being generated that the buyer is expected to pay in

Required range: 0 <= x <= 999
transaction_method
enum<string>

The medium by which the order is agreed.

  • ORDER_FORM - Order form
  • STRIPE - Stripe
Available options:
ORDER_FORM,
STRIPE
custom_order_form_html
string

The custom order form html to use with <html><body>...</body></html> formatting

metadata
any | null

Optional metadata to add to the subscription. Sending an empty map will delete all keys. Keys prefixed with _ are private and will be ignored.

Response

Serializer for individual subscription order

order_id
string<uuid>
required

Unique identifier for the order

contract_value
string
required
read-only

Total contract value with currency

pdf_url
string
required
read-only

URL to download signed order form PDF

starts_at
string<date>
ends_at
string<date>
order_type
enum<string>
  • TRIAL - Trial
  • STANDARD - New Business
  • RENEWAL - Renewal
  • UPGRADE - Upgrade
  • RECAST - Recast
Available options:
TRIAL,
STANDARD,
RENEWAL,
UPGRADE,
RECAST