Migrate a subscription

POST /v1/subscriptions/:id/migrate

Upgrade the billing_mode of an existing subscription.

Parameters

  • billing_modeobjectRequired

    Controls how prorations and invoices for subscriptions are calculated and orchestrated.

Returns

The newly migrated Subscription object, if the call succeeded.

curl https://api.stripe.com/v1/subscriptions//migrate \
-u "sk_test_VePHdqK...NInc7u56JBrQsk_test_VePHdqKTYQjKNInc7u56JBrQ:" \
-d "billing_mode[type]=flexible"
Response
{
"object": "subscription",
"application": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": null
},
"billing_cycle_anchor": 1679609767,
"billing_mode": "flexible",
"billing_mode_details": {
"updated_at": 1679609768
},
"billing_thresholds": null,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"cancellation_details": {
"comment": null,
"feedback": null,
"reason": null
},
"collection_method": "charge_automatically",
"created": 1679609767,
"currency": "usd",
"customer": "",
"days_until_due": null,
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [],
"description": null,
"discounts": null,
"ended_at": null,
"invoice_settings": {
"issuer": {
"type": "self"
}
},
"items": {
"object": "list",
"data": [
{
"object": "subscription_item",
"billing_thresholds": null,
"created": 1679609768,
"current_period_end": 1682288167,
"current_period_start": 1679609767,
"metadata": {},
"plan": {
"object": "plan",
"active": true,
"aggregate_usage": null,
"amount": 1000,
"amount_decimal": "1000",
"billing_scheme": "per_unit",
"created": 1679609766,
"currency": "usd",
"discounts": null,
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"nickname": null,
"product": "",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"price": {
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1679609766,
"currency": "usd",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "",
"recurring": {
"aggregate_usage": null,
"interval": "month",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 1000,
"unit_amount_decimal": "1000"
},
"quantity": 1,
"subscription": "",
"tax_rates": []
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/subscription_items?subscription=sub_1MowQVLkdIwHu7ixeRlqHVzs"
},
"latest_invoice": "",
"livemode": false,
"metadata": {
"order_id": "6735"
},
"next_pending_invoice_item_invoice": null,
"on_behalf_of": null,
"pause_collection": null,
"payment_settings": {
"payment_method_options": null,
"payment_method_types": null,
"save_default_payment_method": "off"
},
"pending_invoice_item_interval": null,
"pending_setup_intent": null,
"pending_update": null,
"schedule": null,
"start_date": 1679609767,
"status": "active",
"test_clock": null,
"transfer_data": null,
"trial_end": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "create_invoice"
}
},
"trial_start": null
}

Resume a subscription

POST /v1/subscriptions/:id/resume

Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. Resume is only available for subscriptions that use charge_automatically collection. If Stripe doesn’t generate a resumption invoice, the subscription becomes active immediately. When a resumption invoice is generated, Stripe finalizes it immediately. If the invoice is paid or marked uncollectible, the subscription becomes active. If the invoice is manually voided, the subscription stays paused. If there is no payment attempt within 23 hours, Stripe voids the invoice and the subscription stays paused. Learn more about resuming subscriptions.

Parameters

  • billing_cycle_anchorenum

    The billing cycle anchor that applies when the subscription is resumed. Either now or unchanged. The default is now. For more information, see the billing cycle documentation.

    Possible enum values
    now

    Reset the subscription’s billing cycle anchor to the current time (in UTC) and start a new billing period.

    unchanged

    Advance the subscription to the period that surrounds the current time without resetting the billing cycle anchor.

  • proration_behaviorenum

    Determines how to handle prorations resulting from the billing_cycle_anchor being unchanged. When the billing_cycle_anchor is set to now (default value), no prorations are generated. If no value is passed, the default is create_prorations.

    Possible enum values
    always_invoice

    Always invoice immediately for prorations.

    create_prorations

    Will cause proration invoice items to be created when applicable. These proration items will only be invoiced immediately under certain conditions.

    none

    Disable creating prorations in this request.

More parameters

  • proration_datetimestamp

Returns

The subscription object.

curl https://api.stripe.com/v1/subscriptions//resume \
-u "sk_test_VePHdqK...NInc7u56JBrQsk_test_VePHdqKTYQjKNInc7u56JBrQ:" \
-d billing_cycle_anchor=now
Response
{
"object": "subscription",
"application": null,
"application_fee_percent": null,
"automatic_tax": {
"enabled": false,
"liability": null
},
"billing_cycle_anchor": 1679447726,
"cancel_at": null,
"cancel_at_period_end": false,
"canceled_at": null,
"cancellation_details": {
"comment": null,
"feedback": null,
"reason": null
},
"collection_method": "charge_automatically",
"created": 1679447723,
"currency": "usd",
"customer": "",
"days_until_due": null,
"default_payment_method": null,
"default_source": null,
"default_tax_rates": [],
"description": null,
"discounts": null,
"ended_at": null,
"invoice_settings": {
"issuer": {
"type": "self"
}
},
"items": {
"object": "list",
"data": [
{
"object": "subscription_item",
"created": 1679447724,
"current_period_end": 1682126126,
"current_period_start": 1679447726,
"metadata": {},
"plan": {
"object": "plan",
"active": true,
"amount": 1099,
"amount_decimal": "1099",
"billing_scheme": "per_unit",
"created": 1679447722,
"currency": "usd",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"nickname": null,
"product": "",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"price": {
"object": "price",
"active": true,
"billing_scheme": "per_unit",
"created": 1679447722,
"currency": "usd",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "",
"recurring": {
"interval": "month",
"interval_count": 1,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "recurring",
"unit_amount": 1099,
"unit_amount_decimal": "1099"
},
"quantity": 1,
"subscription": "",
"tax_rates": []
}
],
"has_more": false,
"total_count": 1,
"url": "/v1/subscription_items?subscription=sub_1MoGGtLkdIwHu7ixk5CfdiqC"
},
"latest_invoice": "",
"livemode": false,
"metadata": {},
"next_pending_invoice_item_invoice": null,
"on_behalf_of": null,
"pause_collection": null,
"payment_settings": {
"payment_method_options": null,
"payment_method_types": null,
"save_default_payment_method": "off"
},
"pending_invoice_item_interval": null,
"pending_setup_intent": null,
"pending_update": null,
"plan": {
"object": "plan",
"active": true,
"amount": 1099,
"amount_decimal": "1099",
"billing_scheme": "per_unit",
"created": 1679447722,
"currency": "usd",
"interval": "month",
"interval_count": 1,
"livemode": false,
"metadata": {},
"nickname": null,
"product": "",
"tiers_mode": null,
"transform_usage": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"quantity": 1,
"schedule": null,
"start_date": 1679447723,
"status": "active",
"test_clock": null,
"transfer_data": null,
"trial_end": null,
"trial_settings": {
"end_behavior": {
"missing_payment_method": "create_invoice"
}
},
"trial_start": null
}