Import cost centres
curl --request POST \
--url https://coreapi.io/accounting/cost-centres/import \
--header 'Authorization: Bearer <token>'import requests
url = "https://coreapi.io/accounting/cost-centres/import"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/accounting/cost-centres/import', 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/accounting/cost-centres/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": "cst_1J5Z2n2eZvKYlo2C2Z2n2eZvKYlo2C",
"name": "KOST1",
"code": "KOST1",
"type": "KOST1",
"status": "active"
}
]
}Cost Centre
Import cost centres
Import cost centres by CSV file. The file should contain the follwing headers: name, code, type. The type can be “KOST1” or “KOST2”. Already imported cost centres, identified by code, will be skipped.
Required permissions:cost-centre:writePOST
/
accounting
/
cost-centres
/
import
Import cost centres
curl --request POST \
--url https://coreapi.io/accounting/cost-centres/import \
--header 'Authorization: Bearer <token>'import requests
url = "https://coreapi.io/accounting/cost-centres/import"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/accounting/cost-centres/import', 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/accounting/cost-centres/import",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": [
{
"id": "cst_1J5Z2n2eZvKYlo2C2Z2n2eZvKYlo2C",
"name": "KOST1",
"code": "KOST1",
"type": "KOST1",
"status": "active"
}
]
}War diese Seite hilfreich?