Eliminar centro de costo
curl --request DELETE \
--url https://api.filexpress.app/api/external/accounting/cost-centers/{id} \
--header 'X-API-Key: <api-key>'const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.filexpress.app/api/external/accounting/cost-centers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/accounting/cost-centers/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/accounting/cost-centers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"data": {
"deleted": false,
"deactivated": true
}
}{
"status": false,
"message": "Invalid API Key."
}{
"status": false,
"message": "This integration does not have the 'hr.employees' permission.",
"required_scope": "hr.employees"
}{
"status": false,
"message": "Cost center not found"
}{
"status": false,
"message": "El centro de costo tiene subcentros; elimínelos o muévalos primero."
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}Eliminar centro de costo
Elimina el centro si no tiene movimientos ni documentos; si los tiene, lo desactiva (deleted: false, deactivated: true). Con subcentros responde 422.
Permiso requerido: accounting.cost_centers.write
DELETE
/
accounting
/
cost-centers
/
{id}
Eliminar centro de costo
curl --request DELETE \
--url https://api.filexpress.app/api/external/accounting/cost-centers/{id} \
--header 'X-API-Key: <api-key>'const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.filexpress.app/api/external/accounting/cost-centers/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/accounting/cost-centers/{id}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/accounting/cost-centers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"status": true,
"data": {
"deleted": false,
"deactivated": true
}
}{
"status": false,
"message": "Invalid API Key."
}{
"status": false,
"message": "This integration does not have the 'hr.employees' permission.",
"required_scope": "hr.employees"
}{
"status": false,
"message": "Cost center not found"
}{
"status": false,
"message": "El centro de costo tiene subcentros; elimínelos o muévalos primero."
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}