Create Subscription
create_subscriptionCreate a new subscription for an existing customer by specifying at least one price item. Set trial days, payment method, metadata, and more.
Instructions
Create a new subscription for a customer. Requires at least one price item.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| customer | Yes | Customer ID (cus_...) | |
| items | Yes | Subscription line items | |
| default_payment_method | No | Payment method ID to use | |
| trial_period_days | No | Free trial days | |
| cancel_at_period_end | No | Cancel at end of current period | |
| metadata | No | Metadata key-value pairs | |
| collection_method | No | How to collect payment | |
| days_until_due | No | Days until invoice is due (for send_invoice) | |
| coupon | No | Coupon ID to apply | |
| promotion_code | No | Promotion code ID to apply | |
| idempotency_key | No | Optional idempotency key for safe retries |