cURL
curl -X PUT \
/catalogue/product-groups/{id} \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{"name": "Updated Name", "enabled": true}'import requests
url = "https://coreapi.io/catalogue/product-groups/{id}"
payload = {
"name": "SaaS Packages",
"enabled": True,
"forceSameBillingInterval": False,
"memberships": [
{
"product": "/api/products/uuid",
"pricePlans": ["/api/plans/uuid"],
"position": 123,
"upgradeable": True,
"downgradeable": True,
"label": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'SaaS Packages',
enabled: true,
forceSameBillingInterval: false,
memberships: [
{
product: '/api/products/uuid',
pricePlans: ['/api/plans/uuid'],
position: 123,
upgradeable: true,
downgradeable: true,
label: '<string>'
}
]
})
};
fetch('https://coreapi.io/catalogue/product-groups/{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/catalogue/product-groups/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'SaaS Packages',
'enabled' => true,
'forceSameBillingInterval' => false,
'memberships' => [
[
'product' => '/api/products/uuid',
'pricePlans' => [
'/api/plans/uuid'
],
'position' => 123,
'upgradeable' => true,
'downgradeable' => true,
'label' => '<string>'
]
]
]),
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;
}{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "SaaS Packages",
"enabled": true,
"forceSameBillingInterval": false,
"memberships": [
{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"product": "<unknown>",
"pricePlans": [
"<unknown>"
],
"position": 123,
"label": "Pro",
"upgradeable": true,
"downgradeable": true,
"changeTiming": "immediately",
"creditType": "full"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Product Group
Update a product group
Update a product group.
Required permissions:product-group:writePUT
/
catalogue
/
product-groups
/
{id}
cURL
curl -X PUT \
/catalogue/product-groups/{id} \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{"name": "Updated Name", "enabled": true}'import requests
url = "https://coreapi.io/catalogue/product-groups/{id}"
payload = {
"name": "SaaS Packages",
"enabled": True,
"forceSameBillingInterval": False,
"memberships": [
{
"product": "/api/products/uuid",
"pricePlans": ["/api/plans/uuid"],
"position": 123,
"upgradeable": True,
"downgradeable": True,
"label": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'SaaS Packages',
enabled: true,
forceSameBillingInterval: false,
memberships: [
{
product: '/api/products/uuid',
pricePlans: ['/api/plans/uuid'],
position: 123,
upgradeable: true,
downgradeable: true,
label: '<string>'
}
]
})
};
fetch('https://coreapi.io/catalogue/product-groups/{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/catalogue/product-groups/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'SaaS Packages',
'enabled' => true,
'forceSameBillingInterval' => false,
'memberships' => [
[
'product' => '/api/products/uuid',
'pricePlans' => [
'/api/plans/uuid'
],
'position' => 123,
'upgradeable' => true,
'downgradeable' => true,
'label' => '<string>'
]
]
]),
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;
}{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "SaaS Packages",
"enabled": true,
"forceSameBillingInterval": false,
"memberships": [
{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"product": "<unknown>",
"pricePlans": [
"<unknown>"
],
"position": 123,
"label": "Pro",
"upgradeable": true,
"downgradeable": true,
"changeTiming": "immediately",
"creditType": "full"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}Update a product group.
Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Pfadparameter
ProductGroup identifier
Body
application/json
The updated ProductGroup resource
Antwort
ProductGroup resource updated
A product group for up- and downgrades
Beispiel:
"ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
Beispiel:
"SaaS Packages"
Beispiel:
true
If true, customers can only switch between plans with the same billing interval
Beispiel:
false
Show child attributes
Show child attributes
War diese Seite hilfreich?
⌘I