Registrar compra
curl --request POST \
--url https://api.filexpress.app/api/external/expenses \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"provider_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"document_type": "ccf",
"date": "2026-10-01",
"observation": "Compra de insumos",
"is_credit": false,
"credit_days": 0,
"number_control": "DTE-03-M001P001-000000000000123",
"generation_code": "A1B2C3D4-...",
"stamp": "2026XYZ...",
"products": [
{
"sku": "INS-001",
"name": "Insumo A",
"type": "goods",
"quantity": 5,
"price_before_taxes": 8,
"expense_not_suject": 0,
"expense_exent": 0,
"expense_taxed": 40,
"subtotal": 40
}
],
"totals": {
"netTotals": 40,
"charge_1": 0,
"charge_2": 0,
"expenseTotalTax": 40,
"totalRent": 0,
"totalTax": 5.2,
"totalRetein": 0,
"expenseTotalToPayment": 45.2
}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
provider_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
document_type: 'ccf',
date: '2026-10-01',
observation: 'Compra de insumos',
is_credit: false,
credit_days: 0,
number_control: 'DTE-03-M001P001-000000000000123',
generation_code: 'A1B2C3D4-...',
stamp: '2026XYZ...',
products: [
{
sku: 'INS-001',
name: 'Insumo A',
type: 'goods',
quantity: 5,
price_before_taxes: 8,
expense_not_suject: 0,
expense_exent: 0,
expense_taxed: 40,
subtotal: 40
}
],
totals: {
netTotals: 40,
charge_1: 0,
charge_2: 0,
expenseTotalTax: 40,
totalRent: 0,
totalTax: 5.2,
totalRetein: 0,
expenseTotalToPayment: 45.2
}
})
};
fetch('https://api.filexpress.app/api/external/expenses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/expenses"
payload = {
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"provider_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"document_type": "ccf",
"date": "2026-10-01",
"observation": "Compra de insumos",
"is_credit": False,
"credit_days": 0,
"number_control": "DTE-03-M001P001-000000000000123",
"generation_code": "A1B2C3D4-...",
"stamp": "2026XYZ...",
"products": [
{
"sku": "INS-001",
"name": "Insumo A",
"type": "goods",
"quantity": 5,
"price_before_taxes": 8,
"expense_not_suject": 0,
"expense_exent": 0,
"expense_taxed": 40,
"subtotal": 40
}
],
"totals": {
"netTotals": 40,
"charge_1": 0,
"charge_2": 0,
"expenseTotalTax": 40,
"totalRent": 0,
"totalTax": 5.2,
"totalRetein": 0,
"expenseTotalToPayment": 45.2
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/expenses",
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([
'branch_id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'provider_id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'document_type' => 'ccf',
'date' => '2026-10-01',
'observation' => 'Compra de insumos',
'is_credit' => false,
'credit_days' => 0,
'number_control' => 'DTE-03-M001P001-000000000000123',
'generation_code' => 'A1B2C3D4-...',
'stamp' => '2026XYZ...',
'products' => [
[
'sku' => 'INS-001',
'name' => 'Insumo A',
'type' => 'goods',
'quantity' => 5,
'price_before_taxes' => 8,
'expense_not_suject' => 0,
'expense_exent' => 0,
'expense_taxed' => 40,
'subtotal' => 40
]
],
'totals' => [
'netTotals' => 40,
'charge_1' => 0,
'charge_2' => 0,
'expenseTotalTax' => 40,
'totalRent' => 0,
'totalTax' => 5.2,
'totalRetein' => 0,
'expenseTotalToPayment' => 45.2
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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,
"message": "Expense created successfully",
"data": {
"expense_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"generation_code": "A1B2C3D4-...",
"control_number": "DTE-03-M001P001-000000000000123",
"status": "processed",
"issue_time": "2026-10-01 10:00:00",
"total": 45.2
}
}{
"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": "Not found."
}{
"status": false,
"message": "Validation errors",
"errors": {
"start_date": [
"The start date field is required."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}{
"status": false,
"message": "An error occurred while creating the invoice"
}Registrar compra
Registra una compra de proveedor con desgloses fiscales calculados.
Permiso requerido: expenses
POST
/
expenses
Registrar compra
curl --request POST \
--url https://api.filexpress.app/api/external/expenses \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"provider_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"document_type": "ccf",
"date": "2026-10-01",
"observation": "Compra de insumos",
"is_credit": false,
"credit_days": 0,
"number_control": "DTE-03-M001P001-000000000000123",
"generation_code": "A1B2C3D4-...",
"stamp": "2026XYZ...",
"products": [
{
"sku": "INS-001",
"name": "Insumo A",
"type": "goods",
"quantity": 5,
"price_before_taxes": 8,
"expense_not_suject": 0,
"expense_exent": 0,
"expense_taxed": 40,
"subtotal": 40
}
],
"totals": {
"netTotals": 40,
"charge_1": 0,
"charge_2": 0,
"expenseTotalTax": 40,
"totalRent": 0,
"totalTax": 5.2,
"totalRetein": 0,
"expenseTotalToPayment": 45.2
}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
provider_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
document_type: 'ccf',
date: '2026-10-01',
observation: 'Compra de insumos',
is_credit: false,
credit_days: 0,
number_control: 'DTE-03-M001P001-000000000000123',
generation_code: 'A1B2C3D4-...',
stamp: '2026XYZ...',
products: [
{
sku: 'INS-001',
name: 'Insumo A',
type: 'goods',
quantity: 5,
price_before_taxes: 8,
expense_not_suject: 0,
expense_exent: 0,
expense_taxed: 40,
subtotal: 40
}
],
totals: {
netTotals: 40,
charge_1: 0,
charge_2: 0,
expenseTotalTax: 40,
totalRent: 0,
totalTax: 5.2,
totalRetein: 0,
expenseTotalToPayment: 45.2
}
})
};
fetch('https://api.filexpress.app/api/external/expenses', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/expenses"
payload = {
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"provider_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"document_type": "ccf",
"date": "2026-10-01",
"observation": "Compra de insumos",
"is_credit": False,
"credit_days": 0,
"number_control": "DTE-03-M001P001-000000000000123",
"generation_code": "A1B2C3D4-...",
"stamp": "2026XYZ...",
"products": [
{
"sku": "INS-001",
"name": "Insumo A",
"type": "goods",
"quantity": 5,
"price_before_taxes": 8,
"expense_not_suject": 0,
"expense_exent": 0,
"expense_taxed": 40,
"subtotal": 40
}
],
"totals": {
"netTotals": 40,
"charge_1": 0,
"charge_2": 0,
"expenseTotalTax": 40,
"totalRent": 0,
"totalTax": 5.2,
"totalRetein": 0,
"expenseTotalToPayment": 45.2
}
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.filexpress.app/api/external/expenses",
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([
'branch_id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'provider_id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'document_type' => 'ccf',
'date' => '2026-10-01',
'observation' => 'Compra de insumos',
'is_credit' => false,
'credit_days' => 0,
'number_control' => 'DTE-03-M001P001-000000000000123',
'generation_code' => 'A1B2C3D4-...',
'stamp' => '2026XYZ...',
'products' => [
[
'sku' => 'INS-001',
'name' => 'Insumo A',
'type' => 'goods',
'quantity' => 5,
'price_before_taxes' => 8,
'expense_not_suject' => 0,
'expense_exent' => 0,
'expense_taxed' => 40,
'subtotal' => 40
]
],
'totals' => [
'netTotals' => 40,
'charge_1' => 0,
'charge_2' => 0,
'expenseTotalTax' => 40,
'totalRent' => 0,
'totalTax' => 5.2,
'totalRetein' => 0,
'expenseTotalToPayment' => 45.2
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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,
"message": "Expense created successfully",
"data": {
"expense_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"generation_code": "A1B2C3D4-...",
"control_number": "DTE-03-M001P001-000000000000123",
"status": "processed",
"issue_time": "2026-10-01 10:00:00",
"total": 45.2
}
}{
"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": "Not found."
}{
"status": false,
"message": "Validation errors",
"errors": {
"start_date": [
"The start date field is required."
]
}
}{
"status": false,
"message": "Rate limit exceeded. Please try again later.",
"rate_limit": 100
}{
"status": false,
"message": "An error occurred while creating the invoice"
}Authorizations
API Key de la integración (Integraciones → Nueva Integración).
Body
application/json
Sucursal.
Proveedor.
Tipo de documento.
Available options:
ccf, fse, ticket Fecha.
Al crédito.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Días de crédito.
Observaciones.
Número de control del DTE.
Código de generación.
Sello.
Response
Compra registrada