curl --request POST \
--url https://api.filexpress.app/api/external/v2/sales \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"customer_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"document_type": "ccf",
"date": "2026-10-21T10:00:00",
"currency_code": "GTQ",
"exchange_rate": 0.128,
"payment_details": [
{
"code": "01",
"amount": 863.13
}
],
"products": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Servicio de transporte",
"quantity": 5,
"price_before_taxes": 100,
"discount": 0,
"subtotal": 500,
"sale_taxed": 500,
"sale_exent": 0,
"sale_not_suject": 0,
"tax_ids": [
"3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f"
]
},
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Servicio de carga",
"quantity": 5,
"price_before_taxes": 50,
"discount": 0,
"subtotal": 250,
"sale_taxed": 250,
"sale_exent": 0,
"sale_not_suject": 0,
"tax_ids": [
"3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f"
]
}
],
"totals": {
"netTotals": 750,
"saleTotalNotSuject": 0,
"saleTotalExent": 0,
"saleTotalTax": 750,
"totalTax": 97.5,
"totalRetein": 0,
"totalRent": 0,
"saleTotalToPayment": 863.13,
"taxes": [
{
"tax_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"amount": 97.5
},
{
"tax_id": "5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f",
"amount": 15.63
}
],
"withholdings": []
}
}
'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: '3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
document_type: 'ccf',
date: '2026-10-21T10:00:00',
currency_code: 'GTQ',
exchange_rate: 0.128,
payment_details: [{code: '01', amount: 863.13}],
products: [
{
id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
name: 'Servicio de transporte',
quantity: 5,
price_before_taxes: 100,
discount: 0,
subtotal: 500,
sale_taxed: 500,
sale_exent: 0,
sale_not_suject: 0,
tax_ids: ['3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01', '5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f']
},
{
id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
name: 'Servicio de carga',
quantity: 5,
price_before_taxes: 50,
discount: 0,
subtotal: 250,
sale_taxed: 250,
sale_exent: 0,
sale_not_suject: 0,
tax_ids: ['3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01', '5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f']
}
],
totals: {
netTotals: 750,
saleTotalNotSuject: 0,
saleTotalExent: 0,
saleTotalTax: 750,
totalTax: 97.5,
totalRetein: 0,
totalRent: 0,
saleTotalToPayment: 863.13,
taxes: [
{tax_id: '3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01', amount: 97.5},
{tax_id: '5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f', amount: 15.63}
],
withholdings: []
}
})
};
fetch('https://api.filexpress.app/api/external/v2/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/v2/sales"
payload = {
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"customer_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"document_type": "ccf",
"date": "2026-10-21T10:00:00",
"currency_code": "GTQ",
"exchange_rate": 0.128,
"payment_details": [
{
"code": "01",
"amount": 863.13
}
],
"products": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Servicio de transporte",
"quantity": 5,
"price_before_taxes": 100,
"discount": 0,
"subtotal": 500,
"sale_taxed": 500,
"sale_exent": 0,
"sale_not_suject": 0,
"tax_ids": ["3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01", "5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f"]
},
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Servicio de carga",
"quantity": 5,
"price_before_taxes": 50,
"discount": 0,
"subtotal": 250,
"sale_taxed": 250,
"sale_exent": 0,
"sale_not_suject": 0,
"tax_ids": ["3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01", "5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f"]
}
],
"totals": {
"netTotals": 750,
"saleTotalNotSuject": 0,
"saleTotalExent": 0,
"saleTotalTax": 750,
"totalTax": 97.5,
"totalRetein": 0,
"totalRent": 0,
"saleTotalToPayment": 863.13,
"taxes": [
{
"tax_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"amount": 97.5
},
{
"tax_id": "5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f",
"amount": 15.63
}
],
"withholdings": []
}
}
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/v2/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' => '3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
'document_type' => 'ccf',
'date' => '2026-10-21T10:00:00',
'currency_code' => 'GTQ',
'exchange_rate' => 0.128,
'payment_details' => [
[
'code' => '01',
'amount' => 863.13
]
],
'products' => [
[
'id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'name' => 'Servicio de transporte',
'quantity' => 5,
'price_before_taxes' => 100,
'discount' => 0,
'subtotal' => 500,
'sale_taxed' => 500,
'sale_exent' => 0,
'sale_not_suject' => 0,
'tax_ids' => [
'3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
'5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f'
]
],
[
'id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'name' => 'Servicio de carga',
'quantity' => 5,
'price_before_taxes' => 50,
'discount' => 0,
'subtotal' => 250,
'sale_taxed' => 250,
'sale_exent' => 0,
'sale_not_suject' => 0,
'tax_ids' => [
'3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
'5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f'
]
]
],
'totals' => [
'netTotals' => 750,
'saleTotalNotSuject' => 0,
'saleTotalExent' => 0,
'saleTotalTax' => 750,
'totalTax' => 97.5,
'totalRetein' => 0,
'totalRent' => 0,
'saleTotalToPayment' => 863.13,
'taxes' => [
[
'tax_id' => '3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
'amount' => 97.5
],
[
'tax_id' => '5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f',
'amount' => 15.63
]
],
'withholdings' => [
]
]
]),
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-03-M001P001-000000000000045",
"status": "PROCESADO",
"issue_time": "2026-10-21 10:00:00",
"stamp": "2026A1B2C3D4E5F6",
"point_of_sale_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"establishment_code": "M001",
"point_of_sale_code": "P001",
"total": 110.48,
"currency_code": "GTQ",
"exchange_rate": "0.12800000",
"foreign_total": "863.13",
"base_currency_code": "USD"
}
}Crear venta (v2)
Igual que POST /sales de v1, más moneda (currency_code, exchange_rate), tax_ids obligatorio por línea y validación estricta de impuestos (un monto distinto al recalculado responde 422 tax_invalid). Los montos del documento van en la moneda de currency_code; el servidor los convierte a la moneda base y el DTE sale en la moneda legal del país. data.total es el total a pagar en moneda base y foreign_total, en la moneda del documento.
Permiso requerido: sales
curl --request POST \
--url https://api.filexpress.app/api/external/v2/sales \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"customer_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"document_type": "ccf",
"date": "2026-10-21T10:00:00",
"currency_code": "GTQ",
"exchange_rate": 0.128,
"payment_details": [
{
"code": "01",
"amount": 863.13
}
],
"products": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Servicio de transporte",
"quantity": 5,
"price_before_taxes": 100,
"discount": 0,
"subtotal": 500,
"sale_taxed": 500,
"sale_exent": 0,
"sale_not_suject": 0,
"tax_ids": [
"3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f"
]
},
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Servicio de carga",
"quantity": 5,
"price_before_taxes": 50,
"discount": 0,
"subtotal": 250,
"sale_taxed": 250,
"sale_exent": 0,
"sale_not_suject": 0,
"tax_ids": [
"3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f"
]
}
],
"totals": {
"netTotals": 750,
"saleTotalNotSuject": 0,
"saleTotalExent": 0,
"saleTotalTax": 750,
"totalTax": 97.5,
"totalRetein": 0,
"totalRent": 0,
"saleTotalToPayment": 863.13,
"taxes": [
{
"tax_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"amount": 97.5
},
{
"tax_id": "5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f",
"amount": 15.63
}
],
"withholdings": []
}
}
'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: '3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
document_type: 'ccf',
date: '2026-10-21T10:00:00',
currency_code: 'GTQ',
exchange_rate: 0.128,
payment_details: [{code: '01', amount: 863.13}],
products: [
{
id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
name: 'Servicio de transporte',
quantity: 5,
price_before_taxes: 100,
discount: 0,
subtotal: 500,
sale_taxed: 500,
sale_exent: 0,
sale_not_suject: 0,
tax_ids: ['3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01', '5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f']
},
{
id: '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
name: 'Servicio de carga',
quantity: 5,
price_before_taxes: 50,
discount: 0,
subtotal: 250,
sale_taxed: 250,
sale_exent: 0,
sale_not_suject: 0,
tax_ids: ['3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01', '5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f']
}
],
totals: {
netTotals: 750,
saleTotalNotSuject: 0,
saleTotalExent: 0,
saleTotalTax: 750,
totalTax: 97.5,
totalRetein: 0,
totalRent: 0,
saleTotalToPayment: 863.13,
taxes: [
{tax_id: '3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01', amount: 97.5},
{tax_id: '5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f', amount: 15.63}
],
withholdings: []
}
})
};
fetch('https://api.filexpress.app/api/external/v2/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/v2/sales"
payload = {
"branch_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"customer_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"document_type": "ccf",
"date": "2026-10-21T10:00:00",
"currency_code": "GTQ",
"exchange_rate": 0.128,
"payment_details": [
{
"code": "01",
"amount": 863.13
}
],
"products": [
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Servicio de transporte",
"quantity": 5,
"price_before_taxes": 100,
"discount": 0,
"subtotal": 500,
"sale_taxed": 500,
"sale_exent": 0,
"sale_not_suject": 0,
"tax_ids": ["3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01", "5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f"]
},
{
"id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"name": "Servicio de carga",
"quantity": 5,
"price_before_taxes": 50,
"discount": 0,
"subtotal": 250,
"sale_taxed": 250,
"sale_exent": 0,
"sale_not_suject": 0,
"tax_ids": ["3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01", "5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f"]
}
],
"totals": {
"netTotals": 750,
"saleTotalNotSuject": 0,
"saleTotalExent": 0,
"saleTotalTax": 750,
"totalTax": 97.5,
"totalRetein": 0,
"totalRent": 0,
"saleTotalToPayment": 863.13,
"taxes": [
{
"tax_id": "3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01",
"amount": 97.5
},
{
"tax_id": "5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f",
"amount": 15.63
}
],
"withholdings": []
}
}
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/v2/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' => '3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
'document_type' => 'ccf',
'date' => '2026-10-21T10:00:00',
'currency_code' => 'GTQ',
'exchange_rate' => 0.128,
'payment_details' => [
[
'code' => '01',
'amount' => 863.13
]
],
'products' => [
[
'id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'name' => 'Servicio de transporte',
'quantity' => 5,
'price_before_taxes' => 100,
'discount' => 0,
'subtotal' => 500,
'sale_taxed' => 500,
'sale_exent' => 0,
'sale_not_suject' => 0,
'tax_ids' => [
'3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
'5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f'
]
],
[
'id' => '9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11',
'name' => 'Servicio de carga',
'quantity' => 5,
'price_before_taxes' => 50,
'discount' => 0,
'subtotal' => 250,
'sale_taxed' => 250,
'sale_exent' => 0,
'sale_not_suject' => 0,
'tax_ids' => [
'3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
'5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f'
]
]
],
'totals' => [
'netTotals' => 750,
'saleTotalNotSuject' => 0,
'saleTotalExent' => 0,
'saleTotalTax' => 750,
'totalTax' => 97.5,
'totalRetein' => 0,
'totalRent' => 0,
'saleTotalToPayment' => 863.13,
'taxes' => [
[
'tax_id' => '3b8e2f10-7c4d-4a9e-b1f2-5d6c7e8f9a01',
'amount' => 97.5
],
[
'tax_id' => '5d7e9f10-2a3b-4c5d-8e6f-7a8b9c0d1e2f',
'amount' => 15.63
]
],
'withholdings' => [
]
]
]),
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-03-M001P001-000000000000045",
"status": "PROCESADO",
"issue_time": "2026-10-21 10:00:00",
"stamp": "2026A1B2C3D4E5F6",
"point_of_sale_id": "9d1c5a3e-4b7f-4e2a-9c1d-2f6b8a0e7c11",
"establishment_code": "M001",
"point_of_sale_code": "P001",
"total": 110.48,
"currency_code": "GTQ",
"exchange_rate": "0.12800000",
"foreign_total": "863.13",
"base_currency_code": "USD"
}
}Authorizations
API Key de la integración (Integraciones → Nueva Integración).
Body
Sucursal emisora (GET /branches).
Cliente receptor.
SV: fc, ccf, fex, nc, nd, nr. US: inv, cm, dm.
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.
Punto de venta emisor (de la sucursal y activo). Por defecto, el predeterminado de la sucursal.
Centro de costo de la venta (hoja y activo; GET /accounting/cost-centers). Va a las líneas de ingreso al contabilizar.
Incoterm (exportación).
Distribución activa (GET /accounting/cost-center-distributions): el ingreso se reparte entre sus centros por porcentaje. Excluyente con cost_center_id en el mismo nivel (422 Indique centro de costo o distribución, no ambos.).
Moneda del documento (3 letras, por ejemplo GTQ). Debe estar activa para el negocio (GET /v2/currencies). Si se omite o es la moneda base, el documento es en moneda base. Todos los montos van en esta moneda.
3Unidades de moneda base por 1 unidad de currency_code. Si se omite, se usa la tasa vigente a la fecha del documento.
x > 0Response
Documento emitido