Fetch 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/customers/{customerId}/subscription_switches/{offerId}/availability
Request
- Base URLhttps://mediastoreapi-sandbox.cleeng.com
- URLhttps://mediastoreapi-sandbox.cleeng.com/customers/{customerId}/subscription_switches/{offerId}/availability
- AuthAPI key in header Authorization
Path parameters
customerIdstring required
Cleeng ID of a customer
offerIdstring required
ID of subscription offer from which all available offers to switch will be returned, e.g.: S565568989_US
Response
200
Example response
{
"responseData": {
"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_PRORATION",
"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"
}
}
]
}
}Changes
No recorded changes to this operation across all 2 revisions of this API.