Switch subscription

This endpoint is used to upgrade or downgrade a subscription to another subscription plan. Use either subscriptionId OR customerId and fromOfferId together (customerId and fromOfferId can only be used with Cleeng-managed subscriptions where the whole lifecycle is under the control of Cleeng). As these last two parameters are deprecated, subscriptionId is going to be the only option to use this endpoint.

Important
Subscription upgrade and downgrade feature requires compatibility of the payment connector and payment gateway. Currently the feature is fully supported for the following: Adyen, PayPal. Please contact Cleeng Support Team if you wish to use other payment connectors/gateways.

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

Errors

Error codeExplanation
VALIDATION_ERRORGeneral input validation error. Details about error will be returned in message field in the response.
PAYMENT_GATEWAY_NOT_SUPPORTEDThe customer’s subscription was purchased with a payment gateway that is not supported by switch functionality.
The following payment gateways are supported:
  • Adyen
  • Paypal
RECURRING_PROCESS_ALREADY_STARTEDThe customer's subscription is currently during the recurring payment process. Once a new billing cycle begins it will be possible to use switch functionality.
ALREADY_HAS_ACCESSThe customer already has an active subscription to the target offer.
TO_OFFER_COUNTRY_NOT_ALLOWEDTarget offer is not accessible in the customer's country. Possible when geo-restriction was enabled on the target offer.
TO_FREE_OFFER_NOT_ALLOWEDSwitch functionality is not supported for offers with price 0.
SWITCH_NOT_DEFINED_IN_SWITCH_SETTINGSSubscription switch between the two given offers was not defined as possible in the dashboard.
SAME_TARGET_OFFERThe target offer is the same as the current offer.
SWITCH_IN_PROGRESSThe customer’s subscription is currently undergoing the switch to another one - the processing has already started.
OFFER_INACTIVEThe target offer is inactive.

Body Params
int32

Subscription identifier at Cleeng. This is the ID of the subscription the customer is switching from. Required conditionally when customerId and fromOfferId not provided.

string
required

ID of the subscription offer to which a customer wants to upgrade

string
required

Supported: upgrade, downgrade, unspecified. Note: unspecified is only supported for externally-managed subscriptions (subscriptions whose life cycle is managed outside of Cleeng).

string

Supported: DEFERRED, IMMEDIATE_WITHOUT_PRORATION. Required conditionally if the subscription is externally-managed (externally-managed subscriptions, e.g. managed in an app store, outside of Cleeng).

int32

Cleeng ID of a customer. Deprecated.

string

Offer ID of a customer’s subscription that will be upgraded. Deprecated.

Headers
string
required
Responses

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