Skip to main content
Get pricing estimate for a subscription recast
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 '{
  "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>"
  ]
}'
{
  "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": 123,
          "unit_price": "<string>",
          "sub_total": "<string>",
          "duration_text": "<string>"
        }
      ],
      "pre_commitment_schedule": "<string>"
    }
  ],
  "billing_schedule": [
    {
      "starts_at": "<string>",
      "ends_at": "<string>",
      "sub_total": 123,
      "grand_total": "<string>",
      "grand_total_details": "<string>"
    }
  ],
  "grand_total_details": "<any>"
}

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Path Parameters

subscription_id
string
required

Body

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

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
plan_id
string<uuid>
required

The ID of the plan

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'

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.

Response

Subscription /estimate output serializer from OrderPricing

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