Update a subscription item.
curl --request PATCH \
--url https://coreapi.io/subscription-items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/merge-patch+json' \
--data '
{
"name": "Fitness M",
"description": "Everything included",
"furtherInformation": "Additional agreements: The contract includes a free drink flatrate.",
"periods": [
{
"contractPeriod": "1M",
"cancellationPeriod": "1M"
}
]
}
'import requests
url = "https://coreapi.io/subscription-items/{id}"
payload = {
"name": "Fitness M",
"description": "Everything included",
"furtherInformation": "Additional agreements: The contract includes a free drink flatrate.",
"periods": [
{
"contractPeriod": "1M",
"cancellationPeriod": "1M"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/merge-patch+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/merge-patch+json'
},
body: JSON.stringify({
name: 'Fitness M',
description: 'Everything included',
furtherInformation: 'Additional agreements: The contract includes a free drink flatrate.',
periods: [{contractPeriod: '1M', cancellationPeriod: '1M'}]
})
};
fetch('https://coreapi.io/subscription-items/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Fitness M',
'description' => 'Everything included',
'furtherInformation' => 'Additional agreements: The contract includes a free drink flatrate.',
'periods' => [
[
'contractPeriod' => '1M',
'cancellationPeriod' => '1M'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/merge-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "01F9ZQZJZJQZJZJZJZJZJZJZJZ",
"parent": "<unknown>",
"plan": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"family": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
},
"code": "basic-m2023",
"originProduct": {
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"allowCheckout": true,
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>"
},
"measurementValues": [
{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"quantity": 1,
"measuredAt": "2021-01-01T00:00:00+00:00"
}
],
"billing": {
"lastBilledAt": "2023-11-07T05:31:56Z",
"lastBilledTo": "2023-11-07T05:31:56Z",
"lastBilledFrom": "2023-11-07T05:31:56Z",
"nextBillingAt": "2023-11-07T05:31:56Z",
"billingInterval": "1M"
},
"name": "Fitness M",
"description": "Everything included",
"furtherInformation": "Additional agreements: The contract includes a free drink flatrate.",
"pricePlan": {
"type": "flat_fee",
"price": {
"amount": 123,
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00",
"tenantId": "<string>"
},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"internalName": "Exclusive pricing for partners.",
"status": "active",
"applyTrial": true,
"payInAdvance": true,
"proRata": true,
"freeUnits": 1,
"billingInterval": "1M",
"showPricePerInterval": "1M",
"custom": true,
"charge": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"productSetOption": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"inUse": true
},
"status": "active",
"product": {
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"appliedDiscounts": [
{
"id": "<string>",
"coupon": {
"code": "10OFF",
"name": "10% off",
"type": "percentage",
"frequency": "limited",
"id": "<string>",
"percentage": 10,
"fixedAmount": {},
"frequencyInterval": 3,
"maxRedemptionsPerCustomer": "null",
"maxRedemptions": "null",
"expiresAt": "null",
"limitedToPlans": [
{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"family": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
},
"code": "basic-m2023",
"originProduct": {
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"allowCheckout": true,
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>"
}
],
"excludedFromPlans": [
{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"family": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
},
"code": "basic-m2023",
"originProduct": {
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"allowCheckout": true,
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>"
}
],
"limitedToProducts": [
{
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
}
],
"excludedFromProducts": [
{
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
}
],
"isEnabled": true,
"reedemptions": true
},
"status": "active",
"discount": {
"name": "10% off",
"type": "percentage",
"frequency": "limited",
"percentage": 10,
"fixedAmount": {},
"frequencyInterval": 3
},
"appliedIntervals": 1
}
],
"periods": [
{
"id": "<string>",
"contractPeriodCount": 123,
"contractPeriod": {},
"cancellationPeriod": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"activatedAt": "2021-01-01T00:00:00+00:00",
"type": "addon",
"currentMeasurementValue": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"quantity": 1,
"measuredAt": "2021-01-01T00:00:00+00:00"
},
"inheritedPeriod": true
}Item
Update a subscription item.
Updates the subscription item. Provided values in payload will be updated.
Required permissions:subscription:writePATCH
/
subscription-items
/
{id}
Update a subscription item.
curl --request PATCH \
--url https://coreapi.io/subscription-items/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/merge-patch+json' \
--data '
{
"name": "Fitness M",
"description": "Everything included",
"furtherInformation": "Additional agreements: The contract includes a free drink flatrate.",
"periods": [
{
"contractPeriod": "1M",
"cancellationPeriod": "1M"
}
]
}
'import requests
url = "https://coreapi.io/subscription-items/{id}"
payload = {
"name": "Fitness M",
"description": "Everything included",
"furtherInformation": "Additional agreements: The contract includes a free drink flatrate.",
"periods": [
{
"contractPeriod": "1M",
"cancellationPeriod": "1M"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/merge-patch+json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
Authorization: 'Bearer <token>',
'Content-Type': 'application/merge-patch+json'
},
body: JSON.stringify({
name: 'Fitness M',
description: 'Everything included',
furtherInformation: 'Additional agreements: The contract includes a free drink flatrate.',
periods: [{contractPeriod: '1M', cancellationPeriod: '1M'}]
})
};
fetch('https://coreapi.io/subscription-items/{id}', 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}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Fitness M',
'description' => 'Everything included',
'furtherInformation' => 'Additional agreements: The contract includes a free drink flatrate.',
'periods' => [
[
'contractPeriod' => '1M',
'cancellationPeriod' => '1M'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/merge-patch+json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"id": "01F9ZQZJZJQZJZJZJZJZJZJZJZ",
"parent": "<unknown>",
"plan": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"family": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
},
"code": "basic-m2023",
"originProduct": {
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"allowCheckout": true,
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>"
},
"measurementValues": [
{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"quantity": 1,
"measuredAt": "2021-01-01T00:00:00+00:00"
}
],
"billing": {
"lastBilledAt": "2023-11-07T05:31:56Z",
"lastBilledTo": "2023-11-07T05:31:56Z",
"lastBilledFrom": "2023-11-07T05:31:56Z",
"nextBillingAt": "2023-11-07T05:31:56Z",
"billingInterval": "1M"
},
"name": "Fitness M",
"description": "Everything included",
"furtherInformation": "Additional agreements: The contract includes a free drink flatrate.",
"pricePlan": {
"type": "flat_fee",
"price": {
"amount": 123,
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00",
"tenantId": "<string>"
},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"internalName": "Exclusive pricing for partners.",
"status": "active",
"applyTrial": true,
"payInAdvance": true,
"proRata": true,
"freeUnits": 1,
"billingInterval": "1M",
"showPricePerInterval": "1M",
"custom": true,
"charge": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"productSetOption": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"inUse": true
},
"status": "active",
"product": {
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"appliedDiscounts": [
{
"id": "<string>",
"coupon": {
"code": "10OFF",
"name": "10% off",
"type": "percentage",
"frequency": "limited",
"id": "<string>",
"percentage": 10,
"fixedAmount": {},
"frequencyInterval": 3,
"maxRedemptionsPerCustomer": "null",
"maxRedemptions": "null",
"expiresAt": "null",
"limitedToPlans": [
{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"family": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
},
"code": "basic-m2023",
"originProduct": {
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"allowCheckout": true,
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>"
}
],
"excludedFromPlans": [
{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"family": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
},
"code": "basic-m2023",
"originProduct": {
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
},
"allowCheckout": true,
"status": "draft",
"createdAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"description": "<string>"
}
],
"limitedToProducts": [
{
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
}
],
"excludedFromProducts": [
{
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"invoiceVisibility": "always",
"costCentre": {},
"costCentre2": {},
"customFields": {
"field1": "value1",
"field2": "value2"
}
}
],
"isEnabled": true,
"reedemptions": true
},
"status": "active",
"discount": {
"name": "10% off",
"type": "percentage",
"frequency": "limited",
"percentage": 10,
"fixedAmount": {},
"frequencyInterval": 3
},
"appliedIntervals": 1
}
],
"periods": [
{
"id": "<string>",
"contractPeriodCount": 123,
"contractPeriod": {},
"cancellationPeriod": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"activatedAt": "2021-01-01T00:00:00+00:00",
"type": "addon",
"currentMeasurementValue": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"measurement": {
"unit": {
"id": {},
"name": "Stück"
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"quantity": 1,
"measuredAt": "2021-01-01T00:00:00+00:00"
},
"inheritedPeriod": true
}Autorisierungen
Body
application/merge-patch+jsonapplication/vnd.api+json
The updated SubscriptionItem resource
Antwort
SubscriptionItem resource updated
The status of the item.
Possible values:
active: The item is active and will be billed.canceled: The item is canceled and will be billed until the end of the contract.pending: The item is pending and will be billed after the contract start.terminated: The item is terminated and will not be billed.
Verfügbare Optionen:
active, canceled, pending, terminated Beispiel:
"active"
The type of the item.
Possible values:
option: The item is an product set option.charge: The item is a charge.plan-product: The item is a plan product.product: The item is a product, and not created from a plan.
Verfügbare Optionen:
addon, charge, plan-product, product Beispiel:
"addon"
War diese Seite hilfreich?