Zum Hauptinhalt springen
This guide shows you how to implement self-service upgrades and downgrades using product groups in your application.

Overview

The upgrade/downgrade flow consists of three main steps:
  1. Check eligibility - Get available change options for a subscription item
  2. Display options - Show the customer available upgrades/downgrades
  3. Apply change - Execute the selected package change

Prerequisites

Before implementing upgrades:
  1. Create a Product Group with a tier for each package level
  2. Assign the product group to the subscription item via PUT /subscription-items/{id}/product-group. The item’s product and price plan must be a member of that group.
GET /subscription-items/{id}/change-options requires that the subscription item is assigned to a product group. For an item without one, the route answers 404 with the type SUBSCRIPTION_ITEM__NO_PRODUCT_GROUP (see Error Handling).

Step 1: Get Change Options

Fetch available upgrade/downgrade options for a subscription item:

Response

Response Fields

The price plans have the shape of GET /price-plans: billingInterval is the interval token (1M monthly, 3M, 1Y, 14D), and price.amount is in major units (29.0 is 29.00 EUR). The change routes (POST /api/subscriptions/{id}/changes) take an agreed price as pricing with whole minor units instead ("price": 2900), next to the price plan’s id in priceId; see the quantity changes guide.
If hasPendingChange is true, no further changes can be made until the pending change is applied.

Step 2: Display Options to Customer

Use the response to build a selection UI:

Step 3: Apply the Change

When the customer selects an option, apply the change:

Request Parameters

Response


Change Timing Behavior

Immediately

The change takes effect right away:
  1. Current subscription item is ended
  2. Credit note is created (based on creditType)
  3. New subscription item is created and starts immediately
  4. New invoice is generated

End of Period

The change is scheduled for the next billing cycle:
  1. Current subscription item continues until period end
  2. At period end, item switches to new product/plan
  3. No credit note is created
  4. Next invoice uses new pricing

Credit Types

When changeTiming is immediately, a credit is issued based on creditType:

Complete Example


Error Handling

The answer of GET /subscription-items/{id}/change-options for an item without a product group:

Webhooks

Listen for these events to track changes:

Product Groups

Set up product groups

Subscription Transitions

Manual transitions

Webhooks

Listen for events