v12

latestOpenAPI 3.0.1AGPL-3.0raw.githubusercontent.com2026-07-0971442569.2 KB
Subscriptions

Create subscription

Use when onboarding a customer to a plan or starting a new subscription. Ideal for draft subscriptions (activate later) or active from start.

post/subscriptions

Request body

auto_invoice_thresholdstring

AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers an intermediate invoice mid-period. Set once at creation; cannot be changed later. Allowed only when the subscription resolves to type standalone (no parent hierarchy rows). Plan line items must be usage-based only (no fixed or other non-usage plan prices). Nil means auto invoice threshold billing is disabled for this subscription.

billing_anchorstring date-time

BillingAnchor overrides the derived billing anchor when billing_cycle is anniversary. For monthly billing, the day-of-month (and time-of-day) define cycle boundaries: if start_date is before that day in the month, the first billing period ends on the next occurrence of that day in the same month (a shorter first period); subsequent periods follow the usual interval.

billing_cycle'anniversary' | 'calendar'
billing_period'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME' required
billing_period_countinteger
collection_method'charge_automatically' | 'send_invoice'
commitment_amountstring

CommitmentAmount is the minimum amount a customer commits to paying for a billing period

commitment_duration'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME'
couponsstring[]

Deprecated: use SubscriptionCoupons instead.

currencystring required
customer_idstring

customer_id is the flexprice customer id and it is prioritized over external_customer_id in case both are provided.

enable_true_upboolean

Enable Commitment True Up Fee

end_datestring date-time
external_customer_idstring

external_customer_id is the customer id in your DB and must be same as what you provided as external_id while creating the customer in flexprice.

gateway_payment_method_idstring
line_item_commitmentsobject

LineItemCommitments allows setting commitment configuration per line item (keyed by price_id)

line_item_couponsobject

Deprecated: use SubscriptionCoupons instead.

lookup_keystring
metadataobject
overage_factorstring

OverageFactor is a multiplier applied to usage beyond the commitment amount

payment_behavior'allow_incomplete' | 'default_incomplete' | 'error_if_incomplete' | 'default_active'
payment_terms'15 NET' | '30 NET' | '45 NET' | '60 NET' | '75 NET' | '90 NET'
plan_idstring required
proration_behavior'create_prorations' | 'none'
start_datestring date-time
subscription_status'active' | 'paused' | 'cancelled' | 'incomplete' | 'trialing' | 'draft'
timezonestring

Timezone of the customer. If not set, the default value is UTC.

trial_period_daysinteger

TrialPeriodDays: nil = inherit trial length from plan recurring-fixed prices (must be uniform). 0 = explicitly no trial (overrides catalog). >0 = override duration in days.

Response

Created

active_pause_idstring

ActivePauseID references the current active pause configuration This will be null if no pause is active or scheduled

auto_invoice_thresholdstring

AutoInvoiceThreshold is the usage amount (in subscription currency) that triggers an intermediate invoice. Overrides the plan-level threshold when set. Nil means: inherit from the plan's threshold (which may also be nil = disabled).

billing_anchorstring date-time

BillingAnchor is the reference point that aligns future billing cycle dates. It sets the day of week for week intervals, the day of month for month and year intervals, and the month of year for year intervals. The timestamp is in UTC format.

billing_cadence'RECURRING'
billing_cycle'anniversary' | 'calendar'
billing_period'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME'
billing_period_countinteger

BillingPeriodCount is the total number units of the billing period.

cancel_atstring date-time

CancelAt is the date the subscription will be canceled

cancel_at_period_endboolean

CancelAtPeriodEnd is whether the subscription was canceled at the end of the current period

cancelled_atstring date-time

CanceledAt is the date the subscription was canceled

collection_methodstring

CollectionMethod determines how invoices are collected

commitment_amountstring

CommitmentAmount is the minimum amount a customer commits to paying for a billing period

commitment_duration'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME'
created_atstring date-time
created_bystring
currencystring

Currency is the currency of the subscription in lowercase 3 digit ISO codes

current_period_endstring date-time

CurrentPeriodEnd is the end of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.

current_period_startstring date-time

CurrentPeriodStart is the end of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created.

customer_idstring

CustomerID is the identifier for the customer in our system

enable_true_upboolean
end_datestring date-time

EndDate is the end date of the subscription

environment_idstring

EnvironmentID is the environment identifier for the subscription

gateway_payment_method_idstring

GatewayPaymentMethodID is the gateway payment method ID for this subscription

idstring

ID is the unique identifier for the subscription

invoicing_customer_idstring

InvoicingCustomerID is the customer ID to use for invoicing This can differ from the subscription customer (e.g., parent company invoicing for child company)

lookup_keystring

LookupKey is the key used to lookup the subscription in our system

metadataTypesMetadata
overage_factorstring

OverageFactor is a multiplier applied to usage beyond the commitment amount

parent_subscription_idstring

ParentSubscriptionID is the parent subscription ID for hierarchy (e.g. child subscription under a parent)

pause_status'none' | 'active' | 'scheduled' | 'completed' | 'cancelled'
payment_behaviorstring

PaymentBehavior determines how subscription payments are handled

payment_terms'15 NET' | '30 NET' | '45 NET' | '60 NET' | '75 NET' | '90 NET'
plan_idstring

PlanID is the identifier for the plan in our system

proration_behavior'create_prorations' | 'none'
start_datestring date-time

StartDate is the start date of the subscription

status'published' | 'deleted' | 'archived'
subscription_status'active' | 'paused' | 'cancelled' | 'incomplete' | 'trialing' | 'draft'
subscription_type'standalone' | 'delegated_invoicing' | 'parent' | 'inherited' | 'grouped_invoicing'
synced_price_sequenceinteger

SyncedPriceSequence is the plan-price sequence up to which this subscription's line items have been reconciled. Bumped by the plan-price sync after a successful pass.

tenant_idstring
timezonestring
trial_endstring date-time

TrialEnd is the end date of the trial period

trial_startstring date-time

TrialStart is the start date of the trial period

updated_atstring date-time
updated_bystring
versioninteger

Version is used for optimistic locking