Listar centros de costo
curl --request GET \
--url https://api.filexpress.app/api/external/accounting/cost-centers \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.filexpress.app/api/external/accounting/cost-centers', 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"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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": {
"list": [
{
"id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"code": "01",
"name": "Ventas",
"description": null,
"parent_id": null,
"level": 1,
"full_code": "01",
"is_active": true,
"is_leaf": false
},
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"code": "0101",
"name": "Ventas San Salvador",
"description": null,
"parent_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"level": 2,
"full_code": "01.0101",
"is_active": true,
"is_leaf": true
}
],
"tree": [
{
"id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"code": "01",
"name": "Ventas",
"description": null,
"parent_id": null,
"level": 1,
"full_code": "01",
"is_active": true,
"is_leaf": false,
"children": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"code": "0101",
"name": "Ventas San Salvador",
"description": null,
"parent_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"level": 2,
"full_code": "01.0101",
"is_active": true,
"is_leaf": true,
"children": []
}
]
}
]
}
}{
"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": "Validation errors",
"errors": {
"include_inactive": [
"The include inactive field must be true or false."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}Listar centros de costo
Lista plana (por código) y árbol de los centros de costo del negocio. Solo los centros hoja (is_leaf: true) y activos se asignan a documentos y partidas.
Permiso requerido: accounting.cost_centers
GET
/
accounting
/
cost-centers
Listar centros de costo
curl --request GET \
--url https://api.filexpress.app/api/external/accounting/cost-centers \
--header 'X-API-Key: <api-key>'const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.filexpress.app/api/external/accounting/cost-centers', 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"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(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",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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": {
"list": [
{
"id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"code": "01",
"name": "Ventas",
"description": null,
"parent_id": null,
"level": 1,
"full_code": "01",
"is_active": true,
"is_leaf": false
},
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"code": "0101",
"name": "Ventas San Salvador",
"description": null,
"parent_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"level": 2,
"full_code": "01.0101",
"is_active": true,
"is_leaf": true
}
],
"tree": [
{
"id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"code": "01",
"name": "Ventas",
"description": null,
"parent_id": null,
"level": 1,
"full_code": "01",
"is_active": true,
"is_leaf": false,
"children": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"code": "0101",
"name": "Ventas San Salvador",
"description": null,
"parent_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"level": 2,
"full_code": "01.0101",
"is_active": true,
"is_leaf": true,
"children": []
}
]
}
]
}
}{
"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": "Validation errors",
"errors": {
"include_inactive": [
"The include inactive field must be true or false."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}