Zum Hauptinhalt springen
PUT
/
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
    }
  ],
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z"
}
Update a product group.

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Pfadparameter

id
string
erforderlich

ProductGroup identifier

Body

application/json

The updated ProductGroup resource

Create or update a product group

name
string
erforderlich
Beispiel:

"SaaS Packages"

enabled
boolean
erforderlich
Beispiel:

true

forceSameBillingInterval
boolean
Beispiel:

false

memberships
object[]

Antwort

ProductGroup resource updated

A product group for up- and downgrades

id
string
read-only
Beispiel:

"ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"

name
string
Beispiel:

"SaaS Packages"

enabled
boolean
Beispiel:

true

forceSameBillingInterval
boolean

If true, customers can only switch between plans with the same billing interval

Beispiel:

false

memberships
object[]
createdAt
string<date-time>
read-only
updatedAt
string<date-time>
read-only