v1

latestOpenAPI 3.1.02026-07-241080412.6 KB

Update switch

Use this endpoint to manage a subscription switch. <br><br> Currently, this endpoint supports cancelling a pending switch. (Pending is the status of the switch between the subscription switch request and the actual switch processing.) <br><br> Cancelling a pending switch triggers a subscriptionSwitchCancelled webhook. <br><br> Important <br> 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.

patch/subscription_switches/{switchId}

Path parameters

switchIdstring required

Cleeng ID of a switch

Request body

statusstring required

The status of the updated switch. Currently supported status: cancelled, finished (finished - only supported for <<glossary:externally-managed subscriptions>>).

paymentIdinteger

The identifier of Cleeng payment. It can be provided only for the status finished.

Response

200

idstring
directionstring
algorithmstring
customerIdinteger
fromOfferIdstring
toOfferIdstring
subscriptionIdinteger
statusstring
createdAtinteger
updatedAtinteger

Example response

{
  "id": "e11e3627-0186-41db-b539-5b441354a4f9",
  "direction": "downgrade",
  "algorithm": "DEFERRED",
  "customerId": 111222333,
  "fromOfferId": "S653123187_PL",
  "toOfferId": "S278490202_PL",
  "subscriptionId": 12345,
  "status": "cancelled",
  "createdAt": 1661777938,
  "updatedAt": 1661778034
}