Crear venta (DTE)
curl --request POST \
--url https://api.filexpress.app/api/external/sales \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"customer_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"document_type": "fc",
"date": "2026-10-01T10:00:00",
"observation": "Entrega en bodega central",
"is_credit": false,
"credit_days": 0,
"payment_details": [
{
"code": "01",
"payment_method": "Efectivo",
"amount": 22.6,
"reference": ""
}
],
"products": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"sku": "PRD-001",
"name": "Producto A",
"quantity": 2,
"price_before_taxes": 10,
"sale_not_suject": 0,
"sale_exent": 0,
"sale_taxed": 20,
"subtotal": 20,
"discount": 0,
"type": "phisical"
}
],
"totals": {
"netTotals": 20,
"saleTotalNotSuject": 0,
"saleTotalExent": 0,
"saleTotalTax": 20,
"totalTax": 2.6,
"totalRetein": 0,
"totalRent": 0,
"freight": 0,
"insurance": 0,
"saleTotalToPayment": 22.6
}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
customer_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
document_type: 'fc',
date: '2026-10-01T10:00:00',
observation: 'Entrega en bodega central',
is_credit: false,
credit_days: 0,
payment_details: [{code: '01', payment_method: 'Efectivo', amount: 22.6, reference: ''}],
products: [
{
id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
sku: 'PRD-001',
name: 'Producto A',
quantity: 2,
price_before_taxes: 10,
sale_not_suject: 0,
sale_exent: 0,
sale_taxed: 20,
subtotal: 20,
discount: 0,
type: 'phisical'
}
],
totals: {
netTotals: 20,
saleTotalNotSuject: 0,
saleTotalExent: 0,
saleTotalTax: 20,
totalTax: 2.6,
totalRetein: 0,
totalRent: 0,
freight: 0,
insurance: 0,
saleTotalToPayment: 22.6
}
})
};
fetch('https://api.filexpress.app/api/external/sales', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/sales"
payload = {
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"customer_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"document_type": "fc",
"date": "2026-10-01T10:00:00",
"observation": "Entrega en bodega central",
"is_credit": False,
"credit_days": 0,
"payment_details": [
{
"code": "01",
"payment_method": "Efectivo",
"amount": 22.6,
"reference": ""
}
],
"products": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"sku": "PRD-001",
"name": "Producto A",
"quantity": 2,
"price_before_taxes": 10,
"sale_not_suject": 0,
"sale_exent": 0,
"sale_taxed": 20,
"subtotal": 20,
"discount": 0,
"type": "phisical"
}
],
"totals": {
"netTotals": 20,
"saleTotalNotSuject": 0,
"saleTotalExent": 0,
"saleTotalTax": 20,
"totalTax": 2.6,
"totalRetein": 0,
"totalRent": 0,
"freight": 0,
"insurance": 0,
"saleTotalToPayment": 22.6
}
}
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/sales",
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',
'customer_id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'document_type' => 'fc',
'date' => '2026-10-01T10:00:00',
'observation' => 'Entrega en bodega central',
'is_credit' => false,
'credit_days' => 0,
'payment_details' => [
[
'code' => '01',
'payment_method' => 'Efectivo',
'amount' => 22.6,
'reference' => ''
]
],
'products' => [
[
'id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'sku' => 'PRD-001',
'name' => 'Producto A',
'quantity' => 2,
'price_before_taxes' => 10,
'sale_not_suject' => 0,
'sale_exent' => 0,
'sale_taxed' => 20,
'subtotal' => 20,
'discount' => 0,
'type' => 'phisical'
]
],
'totals' => [
'netTotals' => 20,
'saleTotalNotSuject' => 0,
'saleTotalExent' => 0,
'saleTotalTax' => 20,
'totalTax' => 2.6,
'totalRetein' => 0,
'totalRent' => 0,
'freight' => 0,
'insurance' => 0,
'saleTotalToPayment' => 22.6
]
]),
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": "Invoice created successfully",
"data": {
"sale_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"generation_code": "6F1E2D3C-8A4B-4C5D-9E6F-0A1B2C3D4E5F",
"control_number": "DTE-01-M001P001-000000000000001",
"status": "processed",
"issue_time": "2026-10-01 10:30:00",
"stamp": "2026A1B2C3D4E5F6",
"total": 22.6
}
}{
"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"
}Crear venta (DTE)
Emite un documento de venta. El sistema externo debe enviar los desgloses fiscales y totales calculados.
Permiso requerido: sales
POST
/
sales
Crear venta (DTE)
curl --request POST \
--url https://api.filexpress.app/api/external/sales \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"customer_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"document_type": "fc",
"date": "2026-10-01T10:00:00",
"observation": "Entrega en bodega central",
"is_credit": false,
"credit_days": 0,
"payment_details": [
{
"code": "01",
"payment_method": "Efectivo",
"amount": 22.6,
"reference": ""
}
],
"products": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"sku": "PRD-001",
"name": "Producto A",
"quantity": 2,
"price_before_taxes": 10,
"sale_not_suject": 0,
"sale_exent": 0,
"sale_taxed": 20,
"subtotal": 20,
"discount": 0,
"type": "phisical"
}
],
"totals": {
"netTotals": 20,
"saleTotalNotSuject": 0,
"saleTotalExent": 0,
"saleTotalTax": 20,
"totalTax": 2.6,
"totalRetein": 0,
"totalRent": 0,
"freight": 0,
"insurance": 0,
"saleTotalToPayment": 22.6
}
}
'const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
customer_id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
document_type: 'fc',
date: '2026-10-01T10:00:00',
observation: 'Entrega en bodega central',
is_credit: false,
credit_days: 0,
payment_details: [{code: '01', payment_method: 'Efectivo', amount: 22.6, reference: ''}],
products: [
{
id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
sku: 'PRD-001',
name: 'Producto A',
quantity: 2,
price_before_taxes: 10,
sale_not_suject: 0,
sale_exent: 0,
sale_taxed: 20,
subtotal: 20,
discount: 0,
type: 'phisical'
}
],
totals: {
netTotals: 20,
saleTotalNotSuject: 0,
saleTotalExent: 0,
saleTotalTax: 20,
totalTax: 2.6,
totalRetein: 0,
totalRent: 0,
freight: 0,
insurance: 0,
saleTotalToPayment: 22.6
}
})
};
fetch('https://api.filexpress.app/api/external/sales', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.filexpress.app/api/external/sales"
payload = {
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"customer_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"document_type": "fc",
"date": "2026-10-01T10:00:00",
"observation": "Entrega en bodega central",
"is_credit": False,
"credit_days": 0,
"payment_details": [
{
"code": "01",
"payment_method": "Efectivo",
"amount": 22.6,
"reference": ""
}
],
"products": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"sku": "PRD-001",
"name": "Producto A",
"quantity": 2,
"price_before_taxes": 10,
"sale_not_suject": 0,
"sale_exent": 0,
"sale_taxed": 20,
"subtotal": 20,
"discount": 0,
"type": "phisical"
}
],
"totals": {
"netTotals": 20,
"saleTotalNotSuject": 0,
"saleTotalExent": 0,
"saleTotalTax": 20,
"totalTax": 2.6,
"totalRetein": 0,
"totalRent": 0,
"freight": 0,
"insurance": 0,
"saleTotalToPayment": 22.6
}
}
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/sales",
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',
'customer_id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'document_type' => 'fc',
'date' => '2026-10-01T10:00:00',
'observation' => 'Entrega en bodega central',
'is_credit' => false,
'credit_days' => 0,
'payment_details' => [
[
'code' => '01',
'payment_method' => 'Efectivo',
'amount' => 22.6,
'reference' => ''
]
],
'products' => [
[
'id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'sku' => 'PRD-001',
'name' => 'Producto A',
'quantity' => 2,
'price_before_taxes' => 10,
'sale_not_suject' => 0,
'sale_exent' => 0,
'sale_taxed' => 20,
'subtotal' => 20,
'discount' => 0,
'type' => 'phisical'
]
],
'totals' => [
'netTotals' => 20,
'saleTotalNotSuject' => 0,
'saleTotalExent' => 0,
'saleTotalTax' => 20,
'totalTax' => 2.6,
'totalRetein' => 0,
'totalRent' => 0,
'freight' => 0,
'insurance' => 0,
'saleTotalToPayment' => 22.6
]
]),
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": "Invoice created successfully",
"data": {
"sale_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"generation_code": "6F1E2D3C-8A4B-4C5D-9E6F-0A1B2C3D4E5F",
"control_number": "DTE-01-M001P001-000000000000001",
"status": "processed",
"issue_time": "2026-10-01 10:30:00",
"stamp": "2026A1B2C3D4E5F6",
"total": 22.6
}
}{
"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 emisora (GET /branches).
Cliente receptor.
SV: fc, ccf, fex, nc, nd, nr. US: inv, cm, dm.
Available options:
fc, ccf, fex, nc, nd, nr, inv, cm, dm Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Fecha y hora ISO 8601. Por defecto, ahora.
Observaciones.
Venta al crédito.
Días de crédito.
Proyecto asociado.
Incoterm (exportación).
Response
Documento emitido