cURL
curl -X GET \
/subscription-items/{id}/change-options \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/subscription-items/{id}/change-options"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/subscription-items/{id}/change-options', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://coreapi.io/subscription-items/{id}/change-options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"current": {
"id": "<string>",
"name": "<string>",
"pricePlan": "<unknown>",
"product": "<unknown>"
},
"options": [
{
"id": "<string>",
"label": "<string>",
"product": "<unknown>",
"pricePlans": [
"<unknown>"
],
"changeTiming": "immediately",
"creditType": "full",
"isUpgrade": true,
"isDowngrade": true
}
],
"hasPendingChange": true
}Product Group
Get change options
Get available upgrade and downgrade options for a subscription item. Only available if the item has a product group assigned.
Required permissions:subscription:readGET
/
subscription-items
/
{id}
/
change-options
cURL
curl -X GET \
/subscription-items/{id}/change-options \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/subscription-items/{id}/change-options"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/subscription-items/{id}/change-options', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://coreapi.io/subscription-items/{id}/change-options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"current": {
"id": "<string>",
"name": "<string>",
"pricePlan": "<unknown>",
"product": "<unknown>"
},
"options": [
{
"id": "<string>",
"label": "<string>",
"product": "<unknown>",
"pricePlans": [
"<unknown>"
],
"changeTiming": "immediately",
"creditType": "full",
"isUpgrade": true,
"isDowngrade": true
}
],
"hasPendingChange": true
}Get available upgrade and downgrade options for a subscription item.
Prerequisites
The subscription item must have a product group assigned viaPUT /subscription-items/{id}/product-group.
Response
The response includes:current: Information about the current membership and price planoptions: Available upgrade/downgrade optionshasPendingChange: Whether a change is already scheduled
If
hasPendingChange is true, no further changes can be made until the pending change is applied.Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Pfadparameter
SubscriptionItem identifier
War diese Seite hilfreich?