action stripe_post_subscriptions { label: "PostSubscriptions" description: "

Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions.

\n\n

When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request.\nThe payment_behavior parameter determines the exact behavior of the initial payment.

\n\n

To start subscriptions where the first invoice always begins in a draft status, use subscription schedules instead.\nSchedules provide the flexibility to model more complex billing configurations that change over time.

" provider: stripe method: POST path: "/v1/subscriptions" encoding: form output: { type: "object" description: "Subscriptions allow you to charge a customer on a recurring basis.\n\nRelated guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating)." required: ["automatic_tax", "billing_cycle_anchor", "cancel_at_period_end", "collection_method", "created", "currency", "current_period_end", "current_period_start", "customer", "id", "items", "livemode", "metadata", "object", "start_date", "status"] properties: { application: { description: "ID of the Connect Application that created the subscription." type: "object" } application_fee_percent: { type: "number" description: "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." } automatic_tax: { type: "object" required: ["enabled"] properties: { enabled: { type: "boolean" description: "Whether Stripe automatically computes tax on this subscription." } } } billing_cycle_anchor: { type: "integer" format: "unix-time" description: "Determines the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. The timestamp is in UTC format." } billing_thresholds: { description: "Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period" type: "object" } cancel_at: { type: "integer" format: "unix-time" description: "A date in the future at which the subscription will automatically get canceled" } cancel_at_period_end: { type: "boolean" description: "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: { type: "integer" format: "unix-time" description: "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." } cancellation_details: { description: "Details about why this subscription was cancelled" type: "object" } collection_method: { type: "string" description: "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 and mark the subscription as `active`." enum: ["charge_automatically", "send_invoice"] } created: { type: "integer" format: "unix-time" description: "Time at which the object was created. Measured in seconds since the Unix epoch." } currency: { type: "string" description: "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies)." } current_period_end: { type: "integer" format: "unix-time" description: "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: { type: "integer" format: "unix-time" description: "Start of the current period that the subscription has been invoiced for." } customer: { description: "ID of the customer who owns the subscription." type: "object" } days_until_due: { type: "integer" description: "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: { description: "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)." type: "object" } default_source: { description: "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_object-default_source)." type: "object" } default_tax_rates: { type: "array" description: "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." items: { type: "object" description: "Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax.\n\nRelated guide: [Tax Rates](https://stripe.com/docs/billing/taxes/tax-rates)." required: ["active", "created", "display_name", "id", "inclusive", "livemode", "object", "percentage"] properties: { active: { type: "boolean" description: "Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set." } country: { type: "string" description: "Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2))." } created: { type: "integer" format: "unix-time" description: "Time at which the object was created. Measured in seconds since the Unix epoch." } description: { type: "string" description: "An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers." } display_name: { type: "string" description: "The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page." } id: { type: "string" description: "Unique identifier for the object." } inclusive: { type: "boolean" description: "This specifies if the tax rate is inclusive or exclusive." } jurisdiction: { type: "string" description: "The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice." } livemode: { type: "boolean" description: "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode." } metadata: { type: "object" description: "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." } object: { type: "string" description: "String representing the object's type. Objects of the same type share the same value." enum: ["tax_rate"] } percentage: { type: "number" description: "This represents the tax rate percent out of 100." } state: { type: "string" description: "[ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, \"NY\" for New York, United States." } tax_type: { type: "string" description: "The high-level tax type, such as `vat` or `sales_tax`." enum: ["gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat"] } } } } description: { type: "string" description: "The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces." } discount: { description: "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." type: "object" } ended_at: { type: "integer" format: "unix-time" description: "If the subscription has ended, the date the subscription ended." } id: { type: "string" description: "Unique identifier for the object." } items: { type: "object" description: "List of subscription items, each with an attached price." required: ["data", "has_more", "object", "url"] properties: { data: { type: "array" description: "Details about each object." items: { type: "object" description: "Subscription items allow you to create customer subscriptions with more than\none plan, making it easy to represent complex billing relationships." required: ["created", "id", "metadata", "object", "price", "subscription"] properties: { billing_thresholds: { description: "Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period" type: "object" } created: { type: "integer" description: "Time at which the object was created. Measured in seconds since the Unix epoch." } id: { type: "string" description: "Unique identifier for the object." } metadata: { type: "object" description: "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." } object: { type: "string" description: "String representing the object's type. Objects of the same type share the same value." enum: ["subscription_item"] } price: { type: "object" description: "Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products.\n[Products](https://stripe.com/docs/api#products) help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.\n\nFor example, you might have a single \"gold\" product that has prices for $10/month, $100/year, and €9 once.\n\nRelated guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview)." required: ["active", "billing_scheme", "created", "currency", "id", "livemode", "metadata", "object", "product", "type"] properties: { active: { type: "boolean" description: "Whether the price can be used for new purchases." } billing_scheme: { type: "string" description: "Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes." enum: ["per_unit", "tiered"] } created: { type: "integer" format: "unix-time" description: "Time at which the object was created. Measured in seconds since the Unix epoch." } currency: { type: "string" description: "Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies)." } currency_options: { type: "object" description: "Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies)." } custom_unit_amount: { description: "When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links." type: "object" } id: { type: "string" description: "Unique identifier for the object." } livemode: { type: "boolean" description: "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode." } lookup_key: { type: "string" description: "A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters." } metadata: { type: "object" description: "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." } nickname: { type: "string" description: "A brief description of the price, hidden from customers." } object: { type: "string" description: "String representing the object's type. Objects of the same type share the same value." enum: ["price"] } product: { description: "The ID of the product this price is associated with." type: "object" } recurring: { description: "The recurring components of a price such as `interval` and `usage_type`." type: "object" } tax_behavior: { type: "string" description: "Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed." enum: ["exclusive", "inclusive", "unspecified"] } tiers: { type: "array" description: "Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`." items: { type: "object" properties: { flat_amount: { type: "integer" description: "Price for the entire tier." } flat_amount_decimal: { type: "string" format: "decimal" description: "Same as `flat_amount`, but contains a decimal value with at most 12 decimal places." } unit_amount: { type: "integer" description: "Per unit price for units relevant to the tier." } unit_amount_decimal: { type: "string" format: "decimal" description: "Same as `unit_amount`, but contains a decimal value with at most 12 decimal places." } up_to: { type: "integer" description: "Up to and including to this quantity will be contained in the tier." } } } } tiers_mode: { type: "string" description: "Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows." enum: ["graduated", "volume"] } transform_quantity: { description: "Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`." type: "object" } type: { type: "string" description: "One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase." enum: ["one_time", "recurring"] } unit_amount: { type: "integer" description: "The unit amount in %s to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`." } unit_amount_decimal: { type: "string" format: "decimal" description: "The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`." } } } quantity: { type: "integer" description: "The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed." } subscription: { type: "string" description: "The `subscription` this `subscription_item` belongs to." } tax_rates: { type: "array" description: "The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`." items: { type: "object" additionalProperties: true } } } } } has_more: { type: "boolean" description: "True if this list has another page of items after this one that can be fetched." } object: { type: "string" description: "String representing the object's type. Objects of the same type share the same value. Always has the value `list`." enum: ["list"] } url: { type: "string" description: "The URL where this list can be accessed." } } } latest_invoice: { description: "The most recent invoice this subscription has generated." type: "object" } livemode: { type: "boolean" description: "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode." } metadata: { type: "object" description: "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: { type: "integer" format: "unix-time" description: "Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`." } object: { type: "string" description: "String representing the object's type. Objects of the same type share the same value." enum: ["subscription"] } on_behalf_of: { description: "The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details." type: "object" } pause_collection: { description: "If specified, payment collection for this subscription will be paused." type: "object" } payment_settings: { description: "Payment settings passed on to invoices created by the subscription." type: "object" } pending_invoice_item_interval: { description: "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." type: "object" } pending_setup_intent: { description: "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)." type: "object" } pending_update: { description: "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." type: "object" } schedule: { description: "The schedule attached to the subscription" type: "object" } start_date: { type: "integer" format: "unix-time" description: "Date when the subscription was first created. The date might differ from the `created` date due to backdating." } status: { type: "string" description: "Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, or `unpaid`. \n\nFor `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 terminal state, the open invoice will be voided and no further invoices will be generated. \n\nA subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. \n\nIf subscription `collection_method=charge_automatically` it becomes `past_due` when payment to renew it fails and `canceled` or `unpaid` (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts. \n\nIf subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices." enum: ["active", "canceled", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid"] } test_clock: { description: "ID of the test clock this subscription belongs to." type: "object" } transfer_data: { description: "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." type: "object" } trial_end: { type: "integer" format: "unix-time" description: "If the subscription has a trial, the end of that trial." } trial_settings: { description: "Settings related to subscription trials." type: "object" } trial_start: { type: "integer" format: "unix-time" description: "If the subscription has a trial, the beginning of that trial." } } } }