Preview a tier switch
curl --request POST \
--url https://coreapi.io/api/customer/subscriptions/{id}/plan-tier-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
"items": []
}
'import requests
url = "https://coreapi.io/api/customer/subscriptions/{id}/plan-tier-preview"
payload = {
"planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
"items": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({planTierId: 'f5ece259-08ea-77a4-8bd9-9f3a9ed9e246', items: []})
};
fetch('https://coreapi.io/api/customer/subscriptions/{id}/plan-tier-preview', 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/api/customer/subscriptions/{id}/plan-tier-preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'planTierId' => 'f5ece259-08ea-77a4-8bd9-9f3a9ed9e246',
'items' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"creditAmount": "14.50",
"chargeAmount": "24.50",
"currency": "EUR",
"effectiveAt": "2023-11-07T05:31:56Z",
"recurringTotal": {
"netAmount": "49.00",
"taxAmount": "9.31",
"grossAmount": "58.31",
"currency": "EUR"
},
"warnings": [
"active_discount_will_be_lost"
]
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 422,
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"title": "Validation Failed",
"violations": [
{
"propertyPath": "tiers[0].name",
"message": "This value should not be blank.",
"code": "<string>"
}
]
}Tarifwechsel
Preview a tier switch
Return a financial preview for switching the subscription into a target tier, with optional quantity overrides. This call does not change anything.
POST
/
api
/
customer
/
subscriptions
/
{id}
/
plan-tier-preview
Preview a tier switch
curl --request POST \
--url https://coreapi.io/api/customer/subscriptions/{id}/plan-tier-preview \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
"items": []
}
'import requests
url = "https://coreapi.io/api/customer/subscriptions/{id}/plan-tier-preview"
payload = {
"planTierId": "f5ece259-08ea-77a4-8bd9-9f3a9ed9e246",
"items": []
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({planTierId: 'f5ece259-08ea-77a4-8bd9-9f3a9ed9e246', items: []})
};
fetch('https://coreapi.io/api/customer/subscriptions/{id}/plan-tier-preview', 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/api/customer/subscriptions/{id}/plan-tier-preview",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'planTierId' => 'f5ece259-08ea-77a4-8bd9-9f3a9ed9e246',
'items' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"creditAmount": "14.50",
"chargeAmount": "24.50",
"currency": "EUR",
"effectiveAt": "2023-11-07T05:31:56Z",
"recurringTotal": {
"netAmount": "49.00",
"taxAmount": "9.31",
"grossAmount": "58.31",
"currency": "EUR"
},
"warnings": [
"active_discount_will_be_lost"
]
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 404,
"type": "PLAN__NOT_FOUND",
"title": "An error occurred",
"detail": "Plan not found."
}{
"status": 422,
"type": "https://tools.ietf.org/html/rfc2616#section-10",
"title": "Validation Failed",
"violations": [
{
"propertyPath": "tiers[0].name",
"message": "This value should not be blank.",
"code": "<string>"
}
]
}Autorisierungen
Pfadparameter
Body
application/json
Antwort
The switch preview. May be null when no schedule exists yet.
Financial preview of a tier switch. creditAmount and chargeAmount are absolute decimal strings, the direction is implied by the field name.
War diese Seite hilfreich?