Skip to main content
Updates a subscription upgrade
curl --request PATCH \
  --url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id}/upgrade/{order_id} \
  --header 'Content-Type: application/json' \
  --header 'X-SALESBRICKS-KEY: <api-key>' \
  --data '{
  "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>"
  ],
  "point_of_contact_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "signatory_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "auto_renews": true,
  "accounts_payable_emails": [
    "jsmith@example.com"
  ],
  "customer_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "payment_terms": 499,
  "transaction_method": "ORDER_FORM",
  "metadata": "<any>",
  "custom_order_form_html": "<string>",
  "accepted_payment_methods_config": {
    "paywall_credit_card": true,
    "paywall_check": true,
    "paywall_ach": true,
    "paywall_wire": true,
    "checkout_credit_card": true,
    "checkout_ach": true,
    "checkout_order_form": true,
    "minimum_order_form_tcv": 0,
    "paywall_force_autopay": false
  },
  "first_charge_date": "CONTRACT_START_DATE"
}'
{
  "subscription_id": "<string>"
}

Authorizations

X-SALESBRICKS-KEY
string
header
required

API key for authentication

Path Parameters

order_id
string
required
subscription_id
string
required

Body

Subscription input serializer for upgrade PATCH operations. Excludes immutable fields: starts_at, contract_length, billing_frequency, currency.

These fields are inherited from the base order and cannot be changed during an upgrade.

plan_id
string<uuid>

The ID of the plan

bricks
object[]

The bricks included in the subscription

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.

point_of_contact_id
string<uuid>

The ID of the point of contact (Person) object

signatory_user_id
string<uuid>

The ID of the signatory user (Person) object

auto_renews
boolean

Whether the subscription auto-renews. Defaults to true.

accounts_payable_emails
string<email>[]

List of email addresses for accounts payable contacts

customer_id
string<uuid>

The ID of the customer

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

custom_order_form_html
string

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

accepted_payment_methods_config
object

Configuration for accepted payment methods during checkout and paywall Serializer for accepted payment methods configuration. Modelled after spearhead/seller/models.py:AcceptedPaymentMethodsConfig.

first_charge_date
enum<string>

When the first invoice should be charged. If not provided, defaults to seller's first_charge_date setting, or CHECKOUT_DATE if seller has no setting.

  • CONTRACT_START_DATE - Contract Start Date
  • CHECKOUT_DATE - Checkout Date
Available options:
CONTRACT_START_DATE,
CHECKOUT_DATE

Response

subscription_id
string