Updates a subscription
curl --request PATCH \
  --url https://api.salesbricks.com/api/v2/subscriptions/{subscription_id} \
  --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>"
  ],
  "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,
  "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
  }
}'
{
  "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

Path Parameters

subscription_id
string
required

Body

Subscription update input serializer that comes from previously posted subscription estimate.

starts_at
string<date>

The start date of the subscription

contract_length
integer

The length of the contract in months

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

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>

The ID of the plan

bricks
object[]

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.

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

Response

subscription_id
string