Subscriptions
Create Subscription
Create a new subscription for a customer. Use when onboarding a customer to a plan or starting a new subscription. Supports draft subscriptions (activate later) or active from start.
POST
Create Subscription
Documentation Index
Fetch the complete documentation index at: https://mintlify.com/flexprice/flexprice/llms.txt
Use this file to discover all available pages before exploring further.
Request Body
FlexPrice customer ID. Required if
external_customer_id is not provided.Example: "cust_a1b2c3d4e5f6g7h8i9j0"Your internal customer ID (must match the external_id used when creating the customer). Required if
customer_id is not provided.Example: "customer-12345"ID of the plan to subscribe to.Example:
"plan_a1b2c3d4e5f6g7h8i9j0"Three-letter ISO currency code (lowercase).Example:
"usd"Billing frequency.Options:
"IN_ADVANCE", "IN_ARREARS"Billing period unit.Options:
"DAY", "WEEK", "MONTH", "QUARTER", "YEAR"Number of billing periods in each billing cycle.Example:
3 (for quarterly billing with monthly periods)Determines billing date calculation.Options:
"ANNIVERSARY" (uses start date), "CALENDAR" (uses calendar dates)ISO 8601 timestamp for when the subscription starts. Defaults to now.Example:
"2024-03-20T00:00:00Z"ISO 8601 timestamp for when the subscription ends (optional).Example:
"2025-03-20T00:00:00Z"ISO 8601 timestamp for trial period start.Example:
"2024-03-20T00:00:00Z"ISO 8601 timestamp for trial period end.Example:
"2024-04-20T00:00:00Z"Optional unique identifier for programmatic lookup.Example:
"customer-12345-pro-subscription"Arbitrary key-value pairs for storing additional information.Example:
{"source": "website", "campaign": "spring2024"}How invoices are collected.Options:
"CHARGE_AUTOMATICALLY", "SEND_INVOICE"Payment handling behavior.Options:
"DEFAULT_ACTIVE", "DEFAULT_INCOMPLETE", "ALLOW_INCOMPLETE", "ERROR_IF_INCOMPLETE"Initial status. Set to “DRAFT” to create without activating.Options:
"ACTIVE", "DRAFT", "INCOMPLETE"Minimum committed amount for the billing period (decimal as string).Example:
"1000.00"Time frame of the commitment.Options:
"MONTH", "QUARTER", "YEAR"Multiplier for usage beyond commitment (decimal as string).Example:
"1.5"Whether to apply true-up fee when usage is below commitment.
How proration is handled.Options:
"CREATE_PRORATIONS", "NONE"Customer’s timezone for billing calculations.Example:
"America/New_York"Parent subscription ID for hierarchy (e.g., child subscription under a parent).Example:
"sub_parent123"Payment terms for invoice due date.Options:
"15_NET", "30_NET", "45_NET", "60_NET", "75_NET", "90_NET"Determines which customer receives invoices.Options:
"INVOICE_TO_PARENT", "INVOICE_TO_SELF"Customize specific prices for this subscription.
Additional line items to add at creation (in addition to plan prices).
Subscription phases for phased pricing.
Response
Unique identifier for the subscription.
FlexPrice customer ID.
Plan ID.
Current subscription status.
Currency code.
Billing frequency.
Billing period unit.
Number of billing periods per cycle.
ISO 8601 timestamp of the billing anchor date.
ISO 8601 timestamp when subscription starts.
ISO 8601 timestamp when subscription ends (if set).
ISO 8601 timestamp of current billing period start.
ISO 8601 timestamp of current billing period end.
ISO 8601 timestamp of trial start (if applicable).
ISO 8601 timestamp of trial end (if applicable).
Custom metadata.
ISO 8601 timestamp when the subscription was created.
ISO 8601 timestamp when the subscription was last updated.
Plan details (if included).
Customer details (if included).
Example Request
cURL
Example Response
Create Subscription