Skip to main content
Schema2020-08-27object

subscription

Subscriptions allow you to charge a customer on a recurring basis. Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating).

Source
openapi/spec3.json
Commit
d70de345383d
Active snapshot
da69df7e6e11

Subscription

object

Subscriptions allow you to charge a customer on a recurring basis. Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating).

application_fee_percent number
optionalnullable

A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account.

billing_cycle_anchor integer (unix-time)
required

Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices.

billing_thresholds
optionalnullable

Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period

cancel_at integer (unix-time)
optionalnullable

A date in the future at which the subscription will automatically get canceled

cancel_at_period_end boolean
required

If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period.

canceled_at integer (unix-time)
optionalnullable

If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state.

collection_method string
required

Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions.

created integer (unix-time)
required

Time at which the object was created. Measured in seconds since the Unix epoch.

current_period_end integer (unix-time)
required

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_start integer (unix-time)
required

Start of the current period that the subscription has been invoiced for.

customer
required

ID of the customer who owns the subscription.

days_until_due integer
optionalnullable

Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`.

default_payment_method
optionalnullable

ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source).

default_source
optionalnullable

ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_obje…

default_tax_rates array
optionalnullable

The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription.

discount
optionalnullable

Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis.

ended_at integer (unix-time)
optionalnullable

If the subscription has ended, the date the subscription ended.

id string
required

Unique identifier for the object.

latest_invoice
optionalnullable

The most recent invoice this subscription has generated.

livemode boolean
required

Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.

metadata object
required

Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

next_pending_invoice_item_invoice integer (unix-time)
optionalnullable

Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.

object string
required

String representing the object's type. Objects of the same type share the same value.

pause_collection
optionalnullable

If specified, payment collection for this subscription will be paused.

payment_settings
optionalnullable

Payment settings passed on to invoices created by the subscription.

pending_invoice_item_interval
optionalnullable

Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval.

pending_setup_intent
optionalnullable

You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2).

pending_update
optionalnullable

If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid.

schedule
optionalnullable

The schedule attached to the subscription

start_date integer (unix-time)
required

Date when the subscription was first created. The date might differ from the `created` date due to backdating.

status string
required

Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` state. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a …

transfer_data
optionalnullable

The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices.

trial_end integer (unix-time)
optionalnullable

If the subscription has a trial, the end of that trial.

trial_start integer (unix-time)
optionalnullable

If the subscription has a trial, the beginning of that trial.