Create a subscription
create_subscriptionCreates a recurring subscription for a customer and price, with optional trial, coupon, quantity, and metadata; requires test keys.
Instructions
Create a subscription.
Renewed by invoice: the customer pays each period themselves. Without a trial the first invoice opens now (latest_invoice); the subscription turns active when it is paid.
Test keys only: refused with a live key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| price | Yes | A subscription price. | |
| coupon | No | ||
| customer | Yes | A customer id, `cus_…`. | |
| metadata | No | Your own key–value pairs (≤ 50 keys, values ≤ 500 characters). On an update they are merged in; an empty value removes its key. | |
| quantity | No | ||
| trial_days | No | Default: the price's. |