Upgrade subscription

Raises the amount of a shopper's live subscription, for example when the shopper moves to a bigger plan on your site. The shopper pays the difference for the rest of the current period at once, and every later renewal charges the new amount. The billing date does not move, and the currency and interval stay as they are. Downgrades are not supported.

Call this from your server with your merchant credentials — never from a browser or app. The shopper is identified by email in the X-Customer-Email header; you only see that shopper's subscriptions.

amount is the new amount per period, in minor units, and must be greater than the current one; otherwise 409. order_id is optional: when sent, it replaces the subscription's order_id, and the upgrade's charge and every later renewal carry it.

Only an active subscription that is not set to cancel at the end of its period can be upgraded; anything else is 409.

The charge. The difference is prorated by the time left in the current period: (new amount − current amount) × time left ÷ period length, rounded to the nearest minor unit. It is charged at once, off-session, to the card the subscription renews with, and booked like any card payment: you receive payment.succeeded for it, and subscription.upgraded carries its payment_id. When nothing is left of the period, or the difference is too small to charge, nothing is charged and the upgrade still applies.

A declined card, or one that needs the shopper to authenticate, is 402, and nothing changes. A new call may try again.

Retries. Repeating the same request is safe and never charges twice. After a 502, either nothing was charged, or the upgrade was charged and the same request (or our own retry, within minutes) finishes it. While an upgrade is unfinished, a request with a different amount or order_id is 409. Repeating a request that already applied returns the subscription unchanged.

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

The subscription_id (sub_…).

Body Params
integer
required

The new amount per period in minor units, e.g. 5000 for £50.00. It must be greater than the subscription's current amount.

length ≥ 1

Optional. Replaces the subscription's order_id; the upgrade's charge and every later renewal carry it. When omitted, the order_id is kept.

Headers
string
required
length ≥ 3

The shopper's email, as sent to POST /api/v1/checkout/init (case-insensitive).

Responses

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