Create subscription

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Overview

Create a new subscription for a customer. Associate them with a plan and optionally apply a coupon or trial period.

Example: A customer selects your Premium Annual plan. Create a subscription with their user_id, plan_id, and source_id to start billing immediately.


Conditional Requirements

ConditionRequired Fields
Alwaysplan_id OR plan_old_provider_id
Alwaysuser_id OR customer_old_provider_id
collection_method=charge_automatically (default)source_id OR source_old_provider_id
collection_method=send_invoicesource_id is optional
Account has taxes_enabled=trueaddress_id OR address_old_provider_id required for tax calculation (subscription created without taxes if missing)
Plan's product has address_required=true AND customer has no shipping addressaddress_id required
Plan's product has address_required=true AND customer has shipping addressaddress_id OR address_old_provider_id
is_gift_donor=truegift_recipient_email, gift_recipient_first_name, gift_recipient_last_name allowed
gift_donor_old_provider_id OR gift_donor_subscription_id is setCannot use is_gift_donor (mutually exclusive)
current_period_end is setCannot use trial_period_days (mutually exclusive)
trial_period_days is setCannot use current_period_end (mutually exclusive)
next_invoice_date is setcurrent_period_end must also be set and have same value
start_date is set in the futurebilling_behavior is required (bill_immediately or bill_on_start_date)
Both user_id AND customer_old_provider_id are setMust reference the same customer
Both address_id AND address_old_provider_id are setMust reference the same address
Both plan_id AND plan_old_provider_id are setMust reference the same plan
Both source_id AND source_old_provider_id are setMust reference the same source
Customer has reached max subscription limitRequest will fail

Webhook

Triggers the subscription.created webhook event.

Query Params
int32
required
Body Params
int32
int32
int32
int32
boolean
string
length ≤ 191
string
enum
Defaults to charge_automatically
Allowed:
string
int32
domains
array of strings
domains
metadata
array of objects
metadata
int32
required
1 to 100000
int32
boolean
int32
string
required
length ≤ 255
int32
≤ 730
boolean
boolean
ip_addresses
array of strings
ip_addresses
date
string
length ≤ 255
string
length ≤ 255
string
length ≤ 255
string
length ≤ 200
int32
string
length ≤ 191
string
length ≤ 191
integer
string
length ≤ 255
string
length ≤ 255
string
length ≤ 255
int64
string | null
enum
Allowed:
string | null
integer | null
integer | null
≥ 0
Headers
string
required
Defaults to Bearer eyJ***
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json