v1
latestOpenAPI 3.1.02026-07-241080412.6 KBFetch available switches
This endpoint returns all available offers to which a customer can switch from the current subscription in available array. Offers to which customer can't switch are returned in unavailable array with the reason why the switch is not possible.
get/subscription_switches/availability
Query parameters
customerIdinteger required
Cleeng ID of a customer
offerIdstring required
ID of subscription offer from which all available offers to switch will be returned.
Headers
X-Publisher-Tokenstring required
Response
200
Example response
{
"success": true,
"data": {
"available": [
{
"algorithm": "IMMEDIATE_WITHOUT_PRORATION",
"toOfferId": "S500730020_PL",
"switchDirection": "upgrade",
"title": "Test offer3",
"price": 10,
"currency": "USD",
"currencySymbol": "$",
"period": "monthly",
"nextPaymentPrice": 11.08,
"nextPaymentPriceCurrency": "EUR",
"nextPaymentPriceCurrencySymbol": "€"
}
],
"unavailable": [
{
"algorithm": "IMMEDIATE_WITHOUT_PRORARTION",
"toOfferId": "S678500650_PL",
"switchDirection": "upgrade",
"title": "Test offer1",
"price": 30,
"currency": "EUR",
"currencySymbol": "€",
"period": "monthly",
"nextPaymentPrice": 30,
"nextPaymentPriceCurrency": "EUR",
"nextPaymentPriceCurrencySymbol": "€",
"reason": {
"code": "TO_OFFER_COUNTRY_NOT_ALLOWED",
"message": "Offer with ID 'S678500650_PL' can't be accessed from customer's country"
}
}
]
},
"message": "Successfully fetched available subscription switches"
}