v43

latestOpenAPI 3.1.0raw.githubusercontent.com2026-01-1876137389.5 KB
Subscriptions

Create Subscription

post/api/v1/subscriptions

Request body

customerIdstring

The internal ID of the customer. If not provided, customerExternalId is required.

customerExternalIdstring

The external ID of the customer. If not provided, customerId is required.

priceIdstring

The id of the price to subscribe to. If not provided, priceSlug is required. Used to determine whether the subscription is usage-based or not, and set other defaults such as trial period and billing intervals.

priceSlugstring

The slug of the price to subscribe to. If not provided, priceId is required. Price slugs are scoped to the customer's pricing model. Used to determine whether the subscription is usage-based or not, and set other defaults such as trial period and billing intervals.

quantitynumber

The quantity of the price purchased. If not provided, defaults to 1.

startDatestring

The time when the subscription starts. If not provided, defaults to current time.

interval'day' | 'week' | 'month' | 'year'

The interval of the subscription. If not provided, defaults to the interval of the price provided by priceId or priceSlug.

intervalCountnumber

The number of intervals that each billing period will last. If not provided, defaults to 1

trialEndnumber

Epoch time in milliseconds of when the trial ends. If not provided, defaults to startDate + the associated price's trialPeriodDays

metadataMetadata

JSON object

namestring

The name of the subscription. If not provided, defaults to the name of the product associated with the price provided by 'priceId' or 'priceSlug'.

defaultPaymentMethodIdstring

The default payment method to use when attempting to run charges for the subscription.If not provided, the customer's default payment method will be used. If no default payment method is present, charges will not run. If no default payment method is provided and there is a trial period for the subscription, the subscription will enter 'trial_ended' status at the end of the trial period.

backupPaymentMethodIdstring

The payment method to try if charges for the subscription fail with the default payment method.

doNotChargeboolean

If true, the subscription item's unitPrice will be set to 0, resulting in no charges. The original price.unitPrice value in the price record remains unchanged.

Response

Successful response