Skip to main content
Creates a subscription recast
curl --request POST \
  --url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/recast \
  --header 'Content-Type: application/json' \
  --header 'X-SALESBRICKS-KEY: <api-key>' \
  --data '{
  "adjustment_credit": 123,
  "adjustment_credit_label": "<string>",
  "starts_at": "2023-12-25",
  "contract_length": 2,
  "billing_frequency": "MONTHLY",
  "plan_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "bricks": [
    {
      "brick_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "quantity": 123,
      "discount": {
        "rate": "<string>",
        "renews": true
      }
    }
  ],
  "discount_coupons": [
    "<string>"
  ],
  "payment_terms": 499,
  "transaction_method": "ORDER_FORM",
  "custom_order_form_html": "<string>",
  "metadata": "<any>"
}'
{
  "order_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Path Parameters

subscription_id
string
required

Body

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

starts_at
string<date>
required

The start date of the subscription

contract_length
integer
required

The length of the contract in months

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

The 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.)

adjustment_credit
integer

Credit that will be applied against future invoices

adjustment_credit_label
string

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.

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

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

Order serializer for the subscription endpoints.

order_id
string<uuid>
required