Subscription Object
Subscriptions enable recurring payments for memberships, services, or product deliveries. They automatically charge customers at specified intervals using their stored HSA/FSA or regular payment method.The Subscription Object
Attributes
| Attribute | Type | Description |
|---|---|---|
id | string | Unique subscription identifier |
customer_id | string | Customer ID |
status | enum | Subscription status (see below) |
product_id | integer | Associated product ID |
merchant_product_id | string | Your product reference ID |
amount_cents | integer | Recurring charge amount in cents |
currency | string | ISO 4217 currency code |
interval | enum | Billing interval: daily, weekly, monthly, yearly |
interval_count | integer | Number of intervals between billings |
trial_period_days | integer | Free trial duration in days |
trial_end | timestamp | When trial ends (null if no trial) |
current_period_start | timestamp | Start of current billing period |
current_period_end | timestamp | End of current billing period |
next_billing_date | timestamp | Next scheduled charge date |
cancel_at_period_end | boolean | Whether subscription cancels at period end |
cancelled_at | timestamp | When subscription was cancelled (null if active) |
ended_at | timestamp | When subscription ended (null if active) |
payment_method | object | Stored payment method details |
metadata | object | Custom key-value pairs |
created_at | timestamp | When subscription was created |
updated_at | timestamp | When subscription was last updated |
Subscription Status
| Status | Description |
|---|---|
trialing | In free trial period |
active | Active and billing normally |
past_due | Payment failed, retrying |
cancelled | Cancelled, will end at period end |
ended | Subscription has ended |
paused | Temporarily paused |
Billing Intervals
| Interval | interval_count | Billing Frequency |
|---|---|---|
daily | 1 | Every day |
daily | 7 | Every 7 days |
weekly | 1 | Every week |
weekly | 2 | Every 2 weeks (bi-weekly) |
monthly | 1 | Every month |
monthly | 3 | Every 3 months (quarterly) |
yearly | 1 | Every year |
Subscription Lifecycle
A subscription moves through these states:- trialing - Subscription created with trial period
- active - Subscription is active and billing normally (can come from trialing or be created without trial)
- past_due - Payment failed, retrying (can come from trialing or active)
- cancelled - Cancel requested, will end at period end
- ended - Subscription has ended (can come from cancelled, past_due after max retries, or active for immediate cancellation)
Trial Periods
Subscriptions can include a free trial period:- Customer is not charged
- Payment method is verified
- First charge occurs when trial ends
Payment Method
| Type | Description |
|---|---|
hsa_fsa_card | HSA/FSA debit card |
credit_card | Regular credit card |
debit_card | Regular debit card |
Cancellation Behavior
Cancel at Period End
Immediate Cancellation
Past Due Handling
When a payment fails:- Status changes to
past_due - Automatic retry attempts (days 3, 7, 14)
- Customer receives notification
- After max retries, subscription ends
Examples
Monthly Membership
Quarterly Subscription
Annual Plan with Trial
Related Endpoints
- Create Subscription - POST /v2/subscriptions
- Get Subscription - GET /v2/subscriptions/
- List Subscriptions - GET /v2/subscriptions
- Cancel Subscription - POST /v2/subscriptions//cancel
- Update Subscription - PUT /v2/subscriptions/
