# PostCustomersCustomerSubscriptions

From **Stripe API**.

`POST /v1/customers/{customer}/subscriptions`

<p>Creates a new subscription on an existing customer.</p>

## Parameters

### `customer`

- Location: path
- Required: true
- Type: `string`
- maxLength: `5000`

## Request body

- Required: false
### `application/x-www-form-urlencoded`

- Type: `object`

```json
{"additionalProperties":false,"properties":{"add_invoice_items":{"description":"A list of prices and quantities that will generate invoice items appended to the first invoice for this subscription. You may pass up to 20 items.","items":{"properties":{"price":{"maxLength":5000,"type":"string"},"price_data":{"properties":{"currency":{"type":"string"},"product":{"maxLength":5000,"type":"string"},"tax_behavior":{"enum":["exclusive","inclusive","unspecified"],"type":"string"},"unit_amount":{"type":"integer"},"unit_amount_decimal":{"format":"decimal","type":"string"}},"required":["currency","product"],"title":"one_time_price_data","type":"object"},"quantity":{"type":"integer"},"tax_rates":{"anyOf":[{"items":{"maxLength":5000,"type":"string"},"type":"array"},{"enum":[""],"type":"string"}]}},"title":"add_invoice_item_entry","type":"object"},"type":"array"},"application_fee_percent":{"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. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions).","type":"number"},"automatic_tax":{"description":"Automatic tax settings for this subscription.","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"title":"automatic_tax_config","type":"object"},"backdate_start_date":{"description":"For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor.","format":"unix-time","type":"integer"},"billing_cycle_anchor":{"description":"A future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices.","format":"unix-time","type":"integer","x-stripeBypassValidation":true},"billing_thresholds":{"anyOf":[{"properties":{"amount_gte":{"type":"integer"},"reset_billing_cycle_anchor":{"type":"boolean"}},"title":"billing_thresholds_param","type":"object"},{"enum":[""],"type":"string"}],"description":"Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds."},"cancel_at":{"description":"A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period.","format":"unix-time","type":"integer"},"cancel_at_period_end":{"description":"Boolean indicating whether this subscription should cancel at the end of the current period.","type":"boolean"},"collection_method":{"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. Defaults to `charge_automatically`.","enum":["charge_automatically","send_invoice"],"type":"string"},"coupon":{"description":"The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription.","maxLength":5000,"type":"string"},"days_until_due":{"description":"Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`.","type":"integer"},"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).","maxLength":5000,"type":"string"},"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).","maxLength":5000,"type":"string"},"default_tax_rates":{"anyOf":[{"items":{"maxLength":5000,"type":"string"},"type":"array"},{"enum":[""],"type":"string"}],"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."},"expand":{"description":"Specifies which fields in the response should be expanded.","items":{"maxLength":5000,"type":"string"},"type":"array"},"items":{"description":"A list of up to 20 subscription items, each with an attached price.","items":{"properties":{"billing_thresholds":{"anyOf":[{"properties":{"usage_gte":{"type":"integer"}},"required":["usage_gte"],"title":"item_billing_thresholds_param","type":"object"},{"enum":[""],"type":"string"}]},"metadata":{"additionalProperties":{"type":"string"},"type":"object"},"price":{"maxLength":5000,"type":"string"},"price_data":{"properties":{"currency":{"type":"string"},"product":{"maxLength":5000,"type":"string"},"recurring":{"properties":{"interval":{"enum":["day","month","week","year"],"type":"string"},"interval_count":{"type":"integer"}},"required":["interval"],"title":"recurring_adhoc","type":"object"},"tax_behavior":{"enum":["exclusive","inclusive","unspecified"],"type":"string"},"unit_amount":{"type":"integer"},"unit_amount_decimal":{"format":"decimal","type":"string"}},"required":["currency","product","recurring"],"title":"recurring_price_data","type":"object"},"quantity":{"type":"integer"},"tax_rates":{"anyOf":[{"items":{"maxLength":5000,"type":"string"},"type":"array"},{"enum":[""],"type":"string"}]}},"title":"subscription_item_create_params","type":"object"},"type":"array"},"metadata":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"enum":[""],"type":"string"}],"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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`."},"off_session":{"description":"Indicates if a customer is on or off-session while an invoice payment is attempted.","type":"boolean"},"payment_behavior":{"description":"Use `allow_incomplete` to create subscriptions with `status=incomplete` if the first invoice cannot be paid. Creating subscriptions with this status allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior.\n\nUse `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the payment intent on the first invoice. This allows simpler management of scenarios where additional user actions are needed to pay a subscription’s invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the payment intent is not confirmed within 23 hours subscriptions transition to `status=incomplete_expired`, which is a terminal state.\n\nUse `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not create a subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more.\n\n`pending_if_incomplete` is only used with updates and cannot be passed when creating a subscription.","enum":["allow_incomplete","default_incomplete","error_if_incomplete","pending_if_incomplete"],"type":"string"},"payment_settings":{"description":"Payment settings to pass to invoices created by the subscription.","properties":{"payment_method_options":{"properties":{"acss_debit":{"anyOf":[{"properties":{"mandate_options":{"properties":{"transaction_type":{"enum":["business","personal"],"type":"string"}},"title":"mandate_options_param","type":"object"},"verification_method":{"enum":["automatic","instant","microdeposits"],"type":"string","x-stripeBypassValidation":true}},"title":"invoice_payment_method_options_param","type":"object"},{"enum":[""],"type":"string"}]},"bancontact":{"anyOf":[{"properties":{"preferred_language":{"enum":["de","en","fr","nl"],"type":"string"}},"title":"invoice_payment_method_options_param","type":"object"},{"enum":[""],"type":"string"}]},"card":{"anyOf":[{"properties":{"mandate_options":{"properties":{"amount":{"type":"integer"},"amount_type":{"enum":["fixed","maximum"],"type":"string"},"description":{"maxLength":200,"type":"string"}},"title":"mandate_options_param","type":"object"},"request_three_d_secure":{"enum":["any","automatic"],"type":"string"}},"title":"subscription_payment_method_options_param","type":"object"},{"enum":[""],"type":"string"}]}},"title":"payment_method_options","type":"object"},"payment_method_types":{"anyOf":[{"items":{"enum":["ach_credit_transfer","ach_debit","acss_debit","au_becs_debit","bacs_debit","bancontact","boleto","card","fpx","giropay","ideal","sepa_debit","sofort","wechat_pay"],"type":"string","x-stripeBypassValidation":true},"type":"array"},{"enum":[""],"type":"string"}]}},"title":"payment_settings","type":"object"},"pending_invoice_item_interval":{"anyOf":[{"properties":{"interval":{"enum":["day","month","week","year"],"type":"string"},"interval_count":{"type":"integer"}},"required":["interval"],"title":"pending_invoice_item_interval_params","type":"object"},{"enum":[""],"type":"string"}],"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."},"promotion_code":{"description":"The API ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription.","maxLength":5000,"type":"string"},"proration_behavior":{"description":"Determines how to handle [prorations](https://stripe.com/docs/subscriptions/billing-cycle#prorations) resulting from the `billing_cycle_anchor`. Valid values are `create_prorations` or `none`.\n\nPassing `create_prorations` will cause proration invoice items to be created when applicable. Prorations can be disabled by passing `none`. If no value is passed, the default is `create_prorations`.","enum":["always_invoice","create_prorations","none"],"type":"string"},"transfer_data":{"description":"If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges.","properties":{"amount_percent":{"type":"number"},"destination":{"type":"string"}},"required":["destination"],"title":"transfer_data_specs","type":"object"},"trial_end":{"anyOf":[{"enum":["now"],"maxLength":5000,"type":"string"},{"format":"unix-time","type":"integer"}],"description":"Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more."},"trial_from_plan":{"description":"Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.","type":"boolean"},"trial_period_days":{"description":"Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more.","type":"integer"}},"type":"object"}
```

## Security

### `basicAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `basic`
Send credentials in the `Authorization` request header using the `Basic` scheme.

Basic HTTP authentication. Allowed headers-- Authorization: Basic <api_key> | Authorization: Basic <base64 hash of `api_key:`>

### `bearerAuth`

- Type: `http`
- Request header: `Authorization`
- Scheme: `bearer`
- Bearer format: `auth-scheme`
Send the token in the `Authorization` request header using the `Bearer` scheme.

Bearer HTTP authentication. Allowed headers-- Authorization: Bearer <api_key>

## Responses

### `200`

Successful response.

### `application/json`

- Type: `object`

Subscriptions allow you to charge a customer on a recurring basis.

Related guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating).

```json
{"description":"Subscriptions allow you to charge a customer on a recurring basis.\n\nRelated guide: [Creating Subscriptions](https://stripe.com/docs/billing/subscriptions/creating).","properties":{"application_fee_percent":{"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.","nullable":true,"type":"number"},"automatic_tax":{"$ref":"#/components/schemas/subscription_automatic_tax"},"billing_cycle_anchor":{"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.","format":"unix-time","type":"integer"},"billing_thresholds":{"anyOf":[{"$ref":"#/components/schemas/subscription_billing_thresholds"}],"description":"Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period","nullable":true},"cancel_at":{"description":"A date in the future at which the subscription will automatically get canceled","format":"unix-time","nullable":true,"type":"integer"},"cancel_at_period_end":{"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.","type":"boolean"},"canceled_at":{"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.","format":"unix-time","nullable":true,"type":"integer"},"collection_method":{"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.","enum":["charge_automatically","send_invoice"],"type":"string"},"created":{"description":"Time at which the object was created. Measured in seconds since the Unix epoch.","format":"unix-time","type":"integer"},"current_period_end":{"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.","format":"unix-time","type":"integer"},"current_period_start":{"description":"Start of the current period that the subscription has been invoiced for.","format":"unix-time","type":"integer"},"customer":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}],"description":"ID of the customer who owns the subscription.","x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/customer"},{"$ref":"#/components/schemas/deleted_customer"}]}},"days_until_due":{"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`.","nullable":true,"type":"integer"},"default_payment_method":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/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).","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/payment_method"}]}},"default_source":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/alipay_account"},{"$ref":"#/components/schemas/bank_account"},{"$ref":"#/components/schemas/bitcoin_receiver"},{"$ref":"#/components/schemas/card"},{"$ref":"#/components/schemas/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).","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/alipay_account"},{"$ref":"#/components/schemas/bank_account"},{"$ref":"#/components/schemas/bitcoin_receiver"},{"$ref":"#/components/schemas/card"},{"$ref":"#/components/schemas/source"}]}},"default_tax_rates":{"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":{"$ref":"#/components/schemas/tax_rate"},"nullable":true,"type":"array"},"discount":{"anyOf":[{"$ref":"#/components/schemas/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.","nullable":true},"ended_at":{"description":"If the subscription has ended, the date the subscription ended.","format":"unix-time","nullable":true,"type":"integer"},"id":{"description":"Unique identifier for the object.","maxLength":5000,"type":"string"},"items":{"description":"List of subscription items, each with an attached price.","properties":{"data":{"description":"Details about each object.","items":{"$ref":"#/components/schemas/subscription_item"},"type":"array"},"has_more":{"description":"True if this list has another page of items after this one that can be fetched.","type":"boolean"},"object":{"description":"String representing the object's type. Objects of the same type share the same value. Always has the value `list`.","enum":["list"],"type":"string"},"url":{"description":"The URL where this list can be accessed.","maxLength":5000,"type":"string"}},"required":["data","has_more","object","url"],"title":"SubscriptionItemList","type":"object","x-expandableFields":["data"]},"latest_invoice":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/invoice"}],"description":"The most recent invoice this subscription has generated.","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/invoice"}]}},"livemode":{"description":"Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.","type":"boolean"},"metadata":{"additionalProperties":{"maxLength":500,"type":"string"},"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.","type":"object"},"next_pending_invoice_item_invoice":{"description":"Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`.","format":"unix-time","nullable":true,"type":"integer"},"object":{"description":"String representing the object's type. Objects of the same type share the same value.","enum":["subscription"],"type":"string"},"pause_collection":{"anyOf":[{"$ref":"#/components/schemas/subscriptions_resource_pause_collection"}],"description":"If specified, payment collection for this subscription will be paused.","nullable":true},"payment_settings":{"anyOf":[{"$ref":"#/components/schemas/subscriptions_resource_payment_settings"}],"description":"Payment settings passed on to invoices created by the subscription.","nullable":true},"pending_invoice_item_interval":{"anyOf":[{"$ref":"#/components/schemas/subscription_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.","nullable":true},"pending_setup_intent":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/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).","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/setup_intent"}]}},"pending_update":{"anyOf":[{"$ref":"#/components/schemas/subscriptions_resource_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.","nullable":true},"schedule":{"anyOf":[{"maxLength":5000,"type":"string"},{"$ref":"#/components/schemas/subscription_schedule"}],"description":"The schedule attached to the subscription","nullable":true,"x-expansionResources":{"oneOf":[{"$ref":"#/components/schemas/subscription_schedule"}]}},"start_date":{"description":"Date when the subscription was first created. The date might differ from the `created` date due to backdating.","format":"unix-time","type":"integer"},"status":{"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","trialing","unpaid"],"type":"string"},"transfer_data":{"anyOf":[{"$ref":"#/components/schemas/subscription_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.","nullable":true},"trial_end":{"description":"If the subscription has a trial, the end of that trial.","format":"unix-time","nullable":true,"type":"integer"},"trial_start":{"description":"If the subscription has a trial, the beginning of that trial.","format":"unix-time","nullable":true,"type":"integer"}},"required":["automatic_tax","billing_cycle_anchor","cancel_at_period_end","collection_method","created","current_period_end","current_period_start","customer","id","items","livemode","metadata","object","start_date","status"],"title":"Subscription","type":"object","x-expandableFields":["automatic_tax","billing_thresholds","customer","default_payment_method","default_source","default_tax_rates","discount","items","latest_invoice","pause_collection","payment_settings","pending_invoice_item_interval","pending_setup_intent","pending_update","schedule","transfer_data"],"x-resourceId":"subscription"}
```

### `default`

Error response.

### `application/json`

- Type: `object`

An error response from the Stripe API

```json
{"description":"An error response from the Stripe API","properties":{"error":{"$ref":"#/components/schemas/api_errors"}},"required":["error"],"type":"object"}
```

## Request examples

### cURL

```shell
curl --request POST \
  --url https://api.stripe.com/v1/customers/{customer}/subscriptions \
  --header 'content-type: application/x-www-form-urlencoded' \
  --data '{
  "add_invoice_items": [
    {
      "price": "string",
      "price_data": {
        "currency": "string",
        "product": "string",
        "tax_behavior": "string",
        "unit_amount": 1,
        "unit_amount_decimal": "string"
      },
      "quantity": 1,
      "tax_rates": "string"
    }
  ],
  "application_fee_percent": 1,
  "automatic_tax": {
    "enabled": true
  },
  "backdate_start_date": 1,
  "billing_cycle_anchor": 1,
  "billing_thresholds": "string",
  "cancel_at": 1,
  "cancel_at_period_end": true,
  "collection_method": "string",
  "coupon": "string",
  "days_until_due": 1,
  "default_payment_method": "string",
  "default_source": "string",
  "default_tax_rates": "string",
  "expand": [
    "string"
  ],
  "items": [
    {
      "billing_thresholds": "string",
      "metadata": {},
      "price": "string",
      "price_data": {
        "currency": "string",
        "product": "string",
        "recurring": {
          "interval": "string",
          "interval_count": 1
        },
        "tax_behavior": "string",
        "unit_amount": 1,
        "unit_amount_decimal": "string"
      },
      "quantity": 1,
      "tax_rates": "string"
    }
  ],
  "metadata": "string",
  "off_session": true,
  "payment_behavior": "string",
  "payment_settings": {
    "payment_method_options": {
      "acss_debit": "string",
      "bancontact": "string",
      "card": "string"
    },
    "payment_method_types": "string"
  },
  "pending_invoice_item_interval": "string",
  "promotion_code": "string",
  "proration_behavior": "string",
  "transfer_data": {
    "amount_percent": 1,
    "destination": "string"
  },
  "trial_end": "string",
  "trial_from_plan": true,
  "trial_period_days": 1
}'
```
