Get renewal options
Returns the renewal options of the contact in the bearer token. A fixed-term subscription, such as a membership for one season, does not renew automatically. The contact renews it by buying a product for the next term.
The response has one renewal group for each active fixed-term subscription of the contact. Each group lists the products that the subscription can be renewed onto. OneBasket removes the products that the contact is not eligible for.
To renew, add one of the options to a basket with Add product to basket. Send the productId, the variantId as productVariantId, the subscriptionKey, and currentSubscription.subscriptionId as subscriptionRenewId. Then check out the basket.
Do not offer renewal when currentSubscription.status.isLocked is true.
Authorization
BearerAuth ApiKeyAuth In: header
In: header
Header Parameters
The ISO 4217 code of the currency to return prices in, for example GBP. The default currency of the store is used when the header is missing or the value is not a known currency.
The ISO 3166-1 alpha-2 code of the country of the contact, for example GB. It is used for rules that depend on the country. When the header is missing, OneBasket uses the country it detects from the request.
Response Body
application/json
application/problem+json
curl -X GET "https://example.com/products/renewal-options"{ "renewalGroups": [ { "currentSubscription": { "subscriptionId": "d079718b-ff63-45dd-947b-4950c023750f", "productId": "string", "variantId": "string", "productName": "string", "status": { "type": "active", "isLocked": true }, "subscriptionEndDate": "2019-08-24T14:15:22Z" }, "options": [ { "productId": "string", "variantId": "string", "productName": "string", "isSuggestedDefault": true, "isRecommended": true, "subscriptionKey": "string", "price": { "amount": 45, "currencyCode": "GBP" } } ], "warning": "string", "existingBasket": { "basketId": "string", "productId": "string", "variantId": "string", "productName": "string", "price": { "amount": 45, "currencyCode": "GBP" } }, "renewalDeadline": "2019-08-24T14:15:22Z" } ]}