cURL
curl -X POST \
/product-families \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"name": "Team Packages"
}'import requests
url = "https://coreapi.io/product-families"
payload = {
"name": "Team Packages",
"parent": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
}
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({name: 'Team Packages', parent: '01F9Z3ZJXZQZJZJZJZJZJZJZJZ'})
};
fetch('https://coreapi.io/product-families', 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/product-families",
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([
'name' => 'Team Packages',
'parent' => '01F9Z3ZJXZQZJZJZJZJZJZJZJZ'
]),
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;
}{
"name": "Team Packages",
"id": "ad8b3b9e-5b0a-4e1a-8b0a-4e1a8b0a4e1a",
"products": [
"https://example.com/"
],
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
}Product Family
Create a product family
Create a product family
Required permissions:product-family:writePOST
/
product-families
cURL
curl -X POST \
/product-families \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"name": "Team Packages"
}'import requests
url = "https://coreapi.io/product-families"
payload = {
"name": "Team Packages",
"parent": "01F9Z3ZJXZQZJZJZJZJZJZJZJZ"
}
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({name: 'Team Packages', parent: '01F9Z3ZJXZQZJZJZJZJZJZJZJZ'})
};
fetch('https://coreapi.io/product-families', 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/product-families",
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([
'name' => 'Team Packages',
'parent' => '01F9Z3ZJXZQZJZJZJZJZJZJZJZ'
]),
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;
}{
"name": "Team Packages",
"id": "ad8b3b9e-5b0a-4e1a-8b0a-4e1a8b0a4e1a",
"products": [
"https://example.com/"
],
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/jsontext/html
The new ProductFamily resource
Antwort
ProductFamily resource created
Maximum string length:
255Beispiel:
"Team Packages"
Beispiel:
"ad8b3b9e-5b0a-4e1a-8b0a-4e1a8b0a4e1a"
The date and time when the resource was created.
Beispiel:
"2021-01-01T00:00:00+00:00"
The date and time when the resource was last updated.
Beispiel:
"2021-01-01T00:00:00+00:00"
War diese Seite hilfreich?