curl -X POST \
/catalogue/products \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"productFamilies": [
[]
],
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"number": "M-1234",
"translations": [],
"type": "",
"measurement": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"code": "users",
"description": "The number of users.",
"fairBilling": "1"
},
"invoiceVisibility": "",
"createdAt": "",
"updatedAt": "",
"taxGroup": {
"id": "00000000-0000-0000-0000-000000000000",
"internalDescription": "19%"
},
"isArchived": "",
"customFields": {
"field1": "value1",
"field2": "value2"
}
}'import requests
url = "https://coreapi.io/catalogue/products"
payload = {
"productFamilies": [{ "name": "Team Packages" }],
"translations": {},
"measurement": {
"unit": {
"name": "Stück",
"translations": {}
},
"code": "users",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": True,
"type": "recurring"
},
"taxGroup": {
"internalDescription": "19%",
"reverseChargeType": "REVERSE_CHARGE",
"type": "standard"
},
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"number": "M-1234",
"costCentre": {
"name": "Cost Centre",
"type": "KOST1",
"code": "CC"
},
"costCentre2": {
"name": "Cost Centre",
"type": "KOST1",
"code": "CC"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": True,
"customFields": {
"field1": "value1",
"field2": "value2"
}
}
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({
productFamilies: [{name: 'Team Packages'}],
translations: {},
measurement: {
unit: {name: 'Stück', translations: {}},
code: 'users',
description: 'The number of users.',
aggregationType: 'sum',
fairBilling: true,
type: 'recurring'
},
taxGroup: {
internalDescription: '19%',
reverseChargeType: 'REVERSE_CHARGE',
type: 'standard'
},
name: 'Basic',
description: 'For small teams.',
internalName: 'Basic (Weekly)',
number: 'M-1234',
costCentre: {name: 'Cost Centre', type: 'KOST1', code: 'CC'},
costCentre2: {name: 'Cost Centre', type: 'KOST1', code: 'CC'},
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
isArchived: true,
customFields: {field1: 'value1', field2: 'value2'}
})
};
fetch('https://coreapi.io/catalogue/products', 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/products",
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([
'productFamilies' => [
[
'name' => 'Team Packages'
]
],
'translations' => [
],
'measurement' => [
'unit' => [
'name' => 'Stück',
'translations' => [
]
],
'code' => 'users',
'description' => 'The number of users.',
'aggregationType' => 'sum',
'fairBilling' => true,
'type' => 'recurring'
],
'taxGroup' => [
'internalDescription' => '19%',
'reverseChargeType' => 'REVERSE_CHARGE',
'type' => 'standard'
],
'name' => 'Basic',
'description' => 'For small teams.',
'internalName' => 'Basic (Weekly)',
'number' => 'M-1234',
'costCentre' => [
'name' => 'Cost Centre',
'type' => 'KOST1',
'code' => 'CC'
],
'costCentre2' => [
'name' => 'Cost Centre',
'type' => 'KOST1',
'code' => 'CC'
],
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'isArchived' => true,
'customFields' => [
'field1' => 'value1',
'field2' => 'value2'
]
]),
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;
}{
"productFamilies": [
{
"name": "Team Packages",
"id": "ad8b3b9e-5b0a-4e1a-8b0a-4e1a8b0a4e1a"
}
],
"translations": {},
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück",
"translations": {}
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {
"internalDescription": "19%",
"reverseChargeType": "REVERSE_CHARGE",
"type": "standard",
"id": "00000000-0000-0000-0000-000000000000"
},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"number": "M-1234",
"invoiceVisibility": "always",
"costCentre": {
"name": "Cost Centre",
"type": "KOST1",
"id": "ad8f1c9c-4f0a-4e1a-8b1a-9c4d9c4d9c4d",
"code": "CC",
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
},
"costCentre2": {
"name": "Cost Centre",
"type": "KOST1",
"id": "ad8f1c9c-4f0a-4e1a-8b1a-9c4d9c4d9c4d",
"code": "CC",
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"customFields": {
"field1": "value1",
"field2": "value2"
}
}Create a product
Create a product
Required permissions:product:writecurl -X POST \
/catalogue/products \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"productFamilies": [
[]
],
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"number": "M-1234",
"translations": [],
"type": "",
"measurement": {
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"code": "users",
"description": "The number of users.",
"fairBilling": "1"
},
"invoiceVisibility": "",
"createdAt": "",
"updatedAt": "",
"taxGroup": {
"id": "00000000-0000-0000-0000-000000000000",
"internalDescription": "19%"
},
"isArchived": "",
"customFields": {
"field1": "value1",
"field2": "value2"
}
}'import requests
url = "https://coreapi.io/catalogue/products"
payload = {
"productFamilies": [{ "name": "Team Packages" }],
"translations": {},
"measurement": {
"unit": {
"name": "Stück",
"translations": {}
},
"code": "users",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": True,
"type": "recurring"
},
"taxGroup": {
"internalDescription": "19%",
"reverseChargeType": "REVERSE_CHARGE",
"type": "standard"
},
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"number": "M-1234",
"costCentre": {
"name": "Cost Centre",
"type": "KOST1",
"code": "CC"
},
"costCentre2": {
"name": "Cost Centre",
"type": "KOST1",
"code": "CC"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": True,
"customFields": {
"field1": "value1",
"field2": "value2"
}
}
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({
productFamilies: [{name: 'Team Packages'}],
translations: {},
measurement: {
unit: {name: 'Stück', translations: {}},
code: 'users',
description: 'The number of users.',
aggregationType: 'sum',
fairBilling: true,
type: 'recurring'
},
taxGroup: {
internalDescription: '19%',
reverseChargeType: 'REVERSE_CHARGE',
type: 'standard'
},
name: 'Basic',
description: 'For small teams.',
internalName: 'Basic (Weekly)',
number: 'M-1234',
costCentre: {name: 'Cost Centre', type: 'KOST1', code: 'CC'},
costCentre2: {name: 'Cost Centre', type: 'KOST1', code: 'CC'},
createdAt: '2023-11-07T05:31:56Z',
updatedAt: '2023-11-07T05:31:56Z',
isArchived: true,
customFields: {field1: 'value1', field2: 'value2'}
})
};
fetch('https://coreapi.io/catalogue/products', 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/products",
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([
'productFamilies' => [
[
'name' => 'Team Packages'
]
],
'translations' => [
],
'measurement' => [
'unit' => [
'name' => 'Stück',
'translations' => [
]
],
'code' => 'users',
'description' => 'The number of users.',
'aggregationType' => 'sum',
'fairBilling' => true,
'type' => 'recurring'
],
'taxGroup' => [
'internalDescription' => '19%',
'reverseChargeType' => 'REVERSE_CHARGE',
'type' => 'standard'
],
'name' => 'Basic',
'description' => 'For small teams.',
'internalName' => 'Basic (Weekly)',
'number' => 'M-1234',
'costCentre' => [
'name' => 'Cost Centre',
'type' => 'KOST1',
'code' => 'CC'
],
'costCentre2' => [
'name' => 'Cost Centre',
'type' => 'KOST1',
'code' => 'CC'
],
'createdAt' => '2023-11-07T05:31:56Z',
'updatedAt' => '2023-11-07T05:31:56Z',
'isArchived' => true,
'customFields' => [
'field1' => 'value1',
'field2' => 'value2'
]
]),
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;
}{
"productFamilies": [
{
"name": "Team Packages",
"id": "ad8b3b9e-5b0a-4e1a-8b0a-4e1a8b0a4e1a"
}
],
"translations": {},
"type": "product",
"measurement": {
"unit": {
"id": {},
"name": "Stück",
"translations": {}
},
"code": "users",
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"description": "The number of users.",
"aggregationType": "sum",
"fairBilling": true,
"type": "recurring"
},
"taxGroup": {
"internalDescription": "19%",
"reverseChargeType": "REVERSE_CHARGE",
"type": "standard",
"id": "00000000-0000-0000-0000-000000000000"
},
"id": "ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b",
"name": "Basic",
"description": "For small teams.",
"internalName": "Basic (Weekly)",
"number": "M-1234",
"invoiceVisibility": "always",
"costCentre": {
"name": "Cost Centre",
"type": "KOST1",
"id": "ad8f1c9c-4f0a-4e1a-8b1a-9c4d9c4d9c4d",
"code": "CC",
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
},
"costCentre2": {
"name": "Cost Centre",
"type": "KOST1",
"id": "ad8f1c9c-4f0a-4e1a-8b1a-9c4d9c4d9c4d",
"code": "CC",
"createdAt": "2021-01-01T00:00:00+00:00",
"updatedAt": "2021-01-01T00:00:00+00:00"
},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"isArchived": true,
"customFields": {
"field1": "value1",
"field2": "value2"
}
}Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The new Product resource
A product family groups multiple products together.
Show child attributes
Show child attributes
The translations of the product. The locale is used as key.
Show child attributes
Show child attributes
The type of the product.
product: recurring billed productcharge: one-time billingplan: plan specific product, which cannot be used as a normal product. Will be filtered out in any product lists.
product, charge, plan The measurement that is used for the price plan. This could define the quantity or a metered usage.
Show child attributes
Show child attributes
The tax group that is used for the product.
Show child attributes
Show child attributes
The name of the product based on the current tenant language. This will be displayed on customer communication.
"Basic"
The description of the product based on the current tenant language.
"For small teams."
Internal name of the product, to differentiate between products with the same name. This will shown in web-app lists, selections and reports.
"Basic (Weekly)"
Internal product number
2 - 255"M-1234"
Defines when the product should be displayed in the invoice.
always: The product is always displayed in the invoice.only_if_charged: The product is only displayed in the invoice if it is charged.
always, only_if_charged The cost centre is used for accounting exports.
Show child attributes
Show child attributes
The KOST2 cost centre is used for accounting exports (DATEV axis KOST2).
Show child attributes
Show child attributes
Defines if the product is archived and should not be used anymore.
Custom fields for the entity. The keys are the field names and the values are the field values. They need to be configured under "/custom-fields" in the API documentation. The input is validated against the configuration. For more details see Custom Fields Guide
Show child attributes
Show child attributes
{ "field1": "value1", "field2": "value2" }
Antwort
Product resource created
A product family groups multiple products together.
Show child attributes
Show child attributes
The translations of the product. The locale is used as key.
Show child attributes
Show child attributes
The type of the product.
product: recurring billed productcharge: one-time billingplan: plan specific product, which cannot be used as a normal product. Will be filtered out in any product lists.
product, charge, plan The measurement that is used for the price plan. This could define the quantity or a metered usage.
Show child attributes
Show child attributes
The tax group that is used for the product.
Show child attributes
Show child attributes
The unique identifier of the product.
"ad8f1c2c-3b1c-4b0a-8b0a-0b0b0b0b0b0b"
The name of the product based on the current tenant language. This will be displayed on customer communication.
"Basic"
The description of the product based on the current tenant language.
"For small teams."
Internal name of the product, to differentiate between products with the same name. This will shown in web-app lists, selections and reports.
"Basic (Weekly)"
Internal product number
2 - 255"M-1234"
Defines when the product should be displayed in the invoice.
always: The product is always displayed in the invoice.only_if_charged: The product is only displayed in the invoice if it is charged.
always, only_if_charged The cost centre is used for accounting exports.
Show child attributes
Show child attributes
The KOST2 cost centre is used for accounting exports (DATEV axis KOST2).
Show child attributes
Show child attributes
Defines if the product is archived and should not be used anymore.
Custom fields for the entity. The keys are the field names and the values are the field values. They need to be configured under "/custom-fields" in the API documentation. The input is validated against the configuration. For more details see Custom Fields Guide
Show child attributes
Show child attributes
{ "field1": "value1", "field2": "value2" }
War diese Seite hilfreich?