Create a subscription
Creates a subscription for a customer with one or more recurring-price
items. All items must share one currency and one billing cadence. An
initial invoice is issued immediately unless the subscription opens
with a trial. A charge_automatically subscription that starts with
a trial requires a default_payment_method; the trial-end charge uses
it.
Authorizations
A merchant secret key (sk_…) sent as Authorization: Bearer <key>.
Headers
A unique key that makes retries safe: the same key with the same request body returns the original response instead of repeating the operation.
255Body
Customer id (cus_…).
charge_automatically, send_invoice Payment method id (pm_…). Required for charge_automatically subscriptions that start with a trial.
Unix epoch seconds. Start of the trial period. Defaults to the creation time when trial_end is set.
Unix epoch seconds. End of the trial period. No initial invoice is issued while the subscription is trialing.
Response
The created subscription.
subscription Customer id (cus_…).
incomplete — created; first invoice not yet paid.
trialing — in free trial; no invoice yet (or a zero-total one).
active — most recent invoice paid; in good standing.
past_due — most recent invoice payment failed; in dunning.
unpaid — dunning exhausted; service stopped. Terminal.
canceled — terminated (immediately or at period end). Terminal.
incomplete, trialing, active, past_due, unpaid, canceled charge_automatically, send_invoice Unix epoch seconds. Start of the current billing period.
Unix epoch seconds. End of the current billing period.
Unix epoch seconds. The reference point used to compute period boundaries.
True when the subscription is scheduled to cancel at the end of the current period.
Unix epoch seconds.
The payment method used for automatic renewal charges (pm_…). Null when not set.
Unix epoch seconds. Start of the trial period. Null when the subscription was not created with a trial.
Unix epoch seconds. End of the trial period. Null when no trial.
Unix epoch seconds. When the cancellation was requested. Null while not canceled.
Unix epoch seconds. When the subscription terminated. Null while active.
Most recent invoice id (inv_…). Null before the first invoice is issued.

