Get pricing for a subscription
curl --request POST \
  --url https://api.salesbricks.com/api/v2/subscriptions/estimate \
  --header 'Content-Type: application/json' \
  --header 'X-SALESBRICKS-KEY: <api-key>' \
  --data '{
  "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
      }
    }
  ],
  "currency": "USD",
  "discount_coupons": [
    "<string>"
  ]
}'
{
  "error": {
    "code": "ERR_BAD_REQUEST",
    "message": "Bad request — the input payload is malformed, missing required fields, or contains invalid data."
  }
}

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Body

Estimate input serializer

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

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
Available options:
USD,
EUR,
GBP,
AUD,
CAD
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 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