Update a subscription
POST {{baseUrl}}/v1/subscriptions/:subscription_exposed_id
Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. To preview how the proration is calculated, use the upcoming invoice endpoint.
By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a
Switching prices does not normally change the billing date or generate an immediate charge unless:
- The billing interval is changed (for example, from monthly to yearly).
- The subscription moves from free to paid, or paid to free.
- A trial starts or ends.
In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date.
If you want to charge for an upgrade immediately, pass proration_behavior
as always_invoice
to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations
, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription’s renewal date, you need to manually invoice the customer.
If you don’t want to prorate, set the proration_behavior
option to none
. With this option, the customer is billed proration_behavior
to none
when switching between different billing intervals (for example, from monthly to yearly), we don’t generate any credits for the old subscription’s unused time. We still reset the billing date and bill immediately for the new subscription.
Updating the quantity on a subscription many times in an hour may result in rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing instead.
Request Body
[{"name"=>"add_invoice_items[0][price]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[0][price_data][currency]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[0][price_data][product]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[0][price_data][tax_behavior]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[0][price_data][unit_amount]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"add_invoice_items[0][price_data][unit_amount_decimal]", "value"=>"<decimal>", "datatype"=>"string"}, {"name"=>"add_invoice_items[0][quantity]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"add_invoice_items[0][tax_rates][0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[0][tax_rates][1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][price]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][price_data][currency]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][price_data][product]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][price_data][tax_behavior]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][price_data][unit_amount]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][price_data][unit_amount_decimal]", "value"=>"<decimal>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][quantity]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][tax_rates][0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"add_invoice_items[1][tax_rates][1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"automatic_tax[enabled]", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"automatic_tax[liability][type]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"automatic_tax[liability][account]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"billing_cycle_anchor", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"billing_thresholds[amount_gte]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"billing_thresholds[reset_billing_cycle_anchor]", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"cancel_at_period_end", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"cancellation_details[comment]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"cancellation_details[feedback]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"collection_method", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"coupon", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"days_until_due", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"default_payment_method", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"default_tax_rates[0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"default_tax_rates[1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"expand[0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"expand[1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"invoice_settings[account_tax_ids][0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"invoice_settings[account_tax_ids][1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"invoice_settings[issuer][type]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"invoice_settings[issuer][account]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[0][billing_thresholds][usage_gte]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"items[0][clear_usage]", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"items[0][deleted]", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"items[0][id]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[0][metadata]", "value"=>"<object>", "datatype"=>"string"}, {"name"=>"items[0][price]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[0][price_data][currency]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[0][price_data][product]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[0][price_data][recurring][interval]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[0][price_data][recurring][interval_count]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"items[0][price_data][tax_behavior]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[0][price_data][unit_amount]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"items[0][price_data][unit_amount_decimal]", "value"=>"<decimal>", "datatype"=>"string"}, {"name"=>"items[0][quantity]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"items[0][tax_rates][0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[0][tax_rates][1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[1][billing_thresholds][usage_gte]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"items[1][clear_usage]", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"items[1][deleted]", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"items[1][id]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[1][metadata]", "value"=>"<object>", "datatype"=>"string"}, {"name"=>"items[1][price]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[1][price_data][currency]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[1][price_data][product]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[1][price_data][recurring][interval]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[1][price_data][recurring][interval_count]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"items[1][price_data][tax_behavior]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[1][price_data][unit_amount]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"items[1][price_data][unit_amount_decimal]", "value"=>"<decimal>", "datatype"=>"string"}, {"name"=>"items[1][quantity]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"items[1][tax_rates][0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"items[1][tax_rates][1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"off_session", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"pause_collection[behavior]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"pause_collection[resumes_at]", "value"=>"<unix-time>", "datatype"=>"string"}, {"name"=>"payment_behavior", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][acss_debit][mandate_options][transaction_type]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][acss_debit][verification_method]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][bancontact][preferred_language]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][card][mandate_options][amount]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][card][mandate_options][amount_type]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][card][mandate_options][description]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][card][network]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][card][request_three_d_secure]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][customer_balance][bank_transfer][eu_bank_transfer][country]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][customer_balance][bank_transfer][type]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][customer_balance][funding_type]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][us_bank_account][financial_connections][permissions][1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][us_bank_account][financial_connections][prefetch][0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][us_bank_account][financial_connections][prefetch][1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_options][us_bank_account][verification_method]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_types][0]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[payment_method_types][1]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"payment_settings[save_default_payment_method]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"pending_invoice_item_interval[interval]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"pending_invoice_item_interval[interval_count]", "value"=>"<integer>", "datatype"=>"string"}, {"name"=>"promotion_code", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"proration_behavior", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"proration_date", "value"=>"<unix-time>", "datatype"=>"string"}, {"name"=>"transfer_data[destination]", "value"=>"<string>", "datatype"=>"string"}, {"name"=>"transfer_data[amount_percent]", "value"=>"<number>", "datatype"=>"string"}, {"name"=>"trial_from_plan", "value"=>"<boolean>", "datatype"=>"string"}, {"name"=>"trial_settings[end_behavior][missing_payment_method]", "value"=>"<string>", "datatype"=>"string"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Content-Type | string |