{"object":"doc","slug":"upgrades-downgrades-and-cancel","title":"Upgrades, downgrades and cancel","summary":"Change a subscription's plan or end it. Upgrades charge the prorated difference now and switch only after the charge is captured; downgrades wait for the period end; cancel is at period end, or now when you must.","tags":["guide","billing","subscriptions"],"body":"# Upgrades, downgrades and cancel\n\nEvery change below is `POST /v1/subscriptions/{subscription_id}` with an `Idempotency-Key`, or the MCP tool `update_subscription` with a `request_key`. A retry with the same key and body returns the first answer and never charges twice. Amounts are integer cents. The examples move between Pro at $29.00 a month (`price_pro_m`, 2900), Premium at $52.00 a month (`price_prem_m`, 5200) and Pro at $250.56 a year (`price_pro_y`, 25056).\n\n| From, to | When it applies | What is charged |\n|---|---|---|\n| Pro monthly to Premium monthly (upgrade) | Now, once the charge is captured | The prorated difference, now |\n| Premium monthly to Pro monthly (downgrade) | At `current_period_end` | Nothing now; the renewal is at the new price |\n| Same price amount, other product (lateral) | At `current_period_end` | Nothing now |\n| Pro monthly to Pro yearly | Now, once the charge is captured; the year starts now | The year minus unused time on the month |\n| Pro yearly to Pro monthly | At `current_period_end` | Nothing now |\n\n## Upgrade\n\n```\nPOST /v1/subscriptions/{subscription_id}      (sub_123)\nIdempotency-Key: upgrade-user_42-1\n\n{\"items\": [{\"id\": \"si_123\", \"price\": \"price_prem_m\"}], \"proration_behavior\": \"always_invoice\"}\n```\n\nMCP: `update_subscription` with `subscription_id`, `price: price_prem_m`, `proration_behavior: always_invoice` and a new `request_key` (the tool fills in the item id).\n\n- `proration_behavior: always_invoice` is required for any change charged now; without it the answer is `400 proration_behavior_required` and nothing happens. It is never guessed.\n- The charge is two lines, each rounded half up to the cent on its own, then added:\n  - credit: minus the unused fraction (time left in the period over the period's length, to the second) of what was actually paid for this period, which is the plan's price after the discount that applied to that payment, minus any refund. A refunded or voided period credits nothing, and the credit never exceeds what the period's invoices still hold.\n  - new plan: the same fraction of the new price after the discount active now. A `forever` code (or a `repeating` one still in its window) applies; a `once` code was used up by the first invoice and does not.\n  - Example, upgrading Pro $29 to Premium $52 at the start of a period: with 20% off forever the lines are -2320 and +4160 and the charge is 1840; with a 20% off once code the lines are -2320 and +5200 and the charge is 2880. A proration invoice lists no `discounts` and no line has `discount_amounts`: the discount is already inside each amount.\n- The plan changes only after that payment is proven captured. Until then `pending_update` shows the new price and the customer keeps the old plan. A decline answers `402 card_declined` (or `processor_rejected`, `payment_failed`, `payment_method_blocked`) and the plan does not change.\n- An unknown outcome answers `502 processor_unavailable` or `409 invoice_reconciling`. Retry with the same key; a new key answers `409 change_pending` while that change is being paid.\n- A difference below the minimum charge (50 cents by default) is not charged now: the plan changes at once and the difference is added to the next renewal invoice.\n- `proration_date` (optional, Unix seconds) pins the moment to prorate from, for example when the customer saw the price. It must be inside the current period, not in the future and at most 1 hour old.\n- The subscription must be `active`. `past_due` answers `409 subscription_past_due`: collect the open invoice first. At or after `current_period_end`, before the renewal ran, the answer is `409 renewal_due` with `Retry-After: 120`.\n- Show the exact charge before the customer confirms: `POST /v1/invoices/create_preview` with `subscription` and `subscription_details` holding the same `items` and `proration_behavior` (MCP `preview_invoice` with `price` and `proration_behavior`). It creates, changes and charges nothing, and needs `catalog:read` as well as `invoices:read` (it shows the new price). `amount_due` is what the update charges now, computed by the same code; send its `subscription_proration_date` as `proration_date` on the update (within the hour) and the update charges exactly that amount. `plan_change.amount_due_now` says the same, and for a difference below the minimum charge it is 0 and `next_invoice` shows the renewal with the carried line. A downgrade previews the next renewal at the new price, with `plan_change.effective_at`. The preview answers the same refusals as the update.\n\nEvents: `customer.subscription.updated` when the proration invoice is created (`latest_invoice` names it, `pending_update` shows the new price; the plan has not changed yet), then `invoice.paid` for the proration invoice and `customer.subscription.updated` when the plan switches. When the charge fails (declined, refused by the processor, or the invoice voided), the plan does not change and the failure is announced too: a decline sends `invoice.payment_failed` (`billing_reason: subscription_update`, `next_payment_attempt: null`: the plan has not ended, do not treat it as a failed renewal), then `invoice.voided`, then `customer.subscription.updated` with `pending_update: null` and, if the upgrade had replaced a scheduled downgrade, that `scheduled_change` back (while a cancel at period end is pending the downgrade is kept but not shown, and comes back if the cancel is undone; if the period ends canceled it is discarded); a processor refusal or a void sends `invoice.voided`, then the same `customer.subscription.updated`. The last subscription event always matches `GET /v1/subscriptions/{id}` (except `scheduled_change.blocked_by`, below, which can change with no event).\n\n## Downgrade, lateral change, annual to monthly\n\n```\nPOST /v1/subscriptions/{subscription_id}      (sub_123)\nIdempotency-Key: downgrade-user_42-1\n\n{\"items\": [{\"id\": \"si_123\", \"price\": \"price_pro_m\"}]}\n```\n\nThe answer is `200` with the plan unchanged and `scheduled_change: {price, effective_at, blocked_by}`. At `current_period_end` the renewal is charged at the new price. Nothing is charged or credited now. `change_timing: now` on a downgrade answers `400 change_timing_unsupported`.\n\nTo take it back before it applies: `POST /v1/subscriptions/{subscription_id}/scheduled_change/cancel` (MCP `cancel_scheduled_change`).\n\n`blocked_by` is `null` unless the merchant's duplicate guard (`subscription_guard`) would keep the change from applying: the change was stored while the guard was off or looser, and another live subscription of the same customer now holds that price (under `product` and `customer`, that product). Then it reads `scheduled_change_refused_subscription_exists`: as things stand, the renewal cancels the change with that same `data.reason.code` and bills the current plan. The change stays listed and you can still cancel it. `blocked_by` is a reading of now: it changes with no event on this subscription when the other subscription starts, ends or changes plan, or the guard setting changes, so read `GET` when you need it fresh. It, the billing portal's next charge and the invoice preview all answer as of now: if the subscription holding the price is set to end before this renewal, the change reads blocked today but applies at the renewal once that subscription has ended. Two subscriptions of one customer both scheduled onto the same price block each other: whichever renews first loses its change, and the other's then applies.\n\n## Cancel at period end, and undo\n\n```\nPOST /v1/subscriptions/{subscription_id}      (sub_123)\nIdempotency-Key: cancel-user_42-1\n\n{\"cancel_at_period_end\": true}\n```\n\nMCP: `update_subscription` with `cancel_at_period_end: true` and a `request_key`. The subscription stays `active` until `current_period_end`, then ends `canceled` with `customer.subscription.deleted`. No renewal is charged, and a renewal declined meanwhile is not retried. To undo it before the period ends, send `false`.\n\nA scheduled change (a downgrade waiting for the period end) is kept while the subscription is ending, but it is inactive: `scheduled_change` reads `null`, because nothing will change, the subscription ends. Undo the cancel and `scheduled_change` is back exactly as it was, in the same `customer.subscription.updated` that clears `cancel_at_period_end`. If the period ends with the cancel in place, the change is discarded with the subscription. `POST /v1/subscriptions/{subscription_id}/scheduled_change/cancel` while it is inactive discards it for good, so an undo then restores nothing. The inactive change still counts for the duplicate guard (unless `subscription_guard` is `off`): while it is kept, the customer cannot buy the change's target on another subscription (`409 subscription_exists`, \"already has a subscription to this product\" under `product`), although nothing shows the change. To let them buy it, cancel the scheduled change on the ending subscription first; that frees the target.\n\nWhile the subscription is `past_due`, `unpaid` or `incomplete`, `cancel_at_period_end: true` cancels it now: there is no paid period to wait for. Stripe waits for the period end in that case; ZeroPoint does not.\n\nThe customer can do the same on the [portal](subscriptions.md).\n\n## Cancel now\n\n```\nDELETE /v1/subscriptions/{subscription_id}      (sub_123)\n```\n\nMCP: `cancel_subscription`. The subscription ends `canceled` at once with `customer.subscription.deleted`. Its open invoice is voided unless a payment on it is still being processed; that payment resolves by itself, and if it was captured the invoice is kept paid. Nothing is refunded.\n\n## Refunds are separate\n\nNeither cancel refunds anything, and a refund or void never cancels the subscription. To give money back, reverse the payment that paid the invoice (`payment_intent` on the invoice is its `pay_...` id): `POST /v1/payments/{payment_id}/void` before settlement, `POST /v1/payments/{payment_id}/refund` after it. A `not_settled_use_void` answer means use the void; never switch on your own without the merchant's approval.","updated":1795275945}