Skip to content
↑↓ navigate ↵ open Esc close
Resource · E43

Expenses API

The /expenses resource records minor expenses (E43): per diems, tolls, tips and other disbursements with no identifiable supplier. The operative rule the handler applies today is tax-based, not amount-based: the document only accepts lines with exempt ITBIS (0%).

Overview

The V1CreateMinorExpenseDto DTO is similar to the purchases one but does not expose supplierId: E43 exists without an identifiable supplier. The E43-specific domain validation (E43DocumentValidations.ValidateRequiredTax) requires every line to use the exempt tax (rate 0%); if a line carries 18% or any other rate, the handler rejects the document. For disbursements with a formal supplier and RNC, record the document as a purchase (E41).

Available operations

POST /api/v1/expenses X-Api-Key Stable

Registra un gasto menor (E43) con detalle por líneas hasta el tope DGII.

Name Type Description
branchId body string (uuid) Required

Sucursal receptora dentro del espacio de trabajo.

sequence body string Optional

Opcional. NCF E43 a usar (formato `E430000000000`). Si lo omites, la API toma el siguiente de la secuencia activa; si no hay una secuencia E43 activa, responde `500`.

externalReference body string Optional

Referencia externa libre del emisor (orden, ticket, ID en tu sistema).

issuedAt body string (ISO 8601) Required

Fecha de emisión del comprobante.

paymentTermId body integer Required

Identificador del término de pago aplicable.

limitDate body string (ISO 8601) Required

Fecha límite asociada al término de pago.

currencyId body integer Required

Identificador de la moneda del comprobante.

currencyRate body decimal Required

Tasa de cambio aplicada (1 cuando la moneda coincide con DOP).

freight body decimal Optional

Monto del flete o transporte cuando aplica.

notes body string Optional

Notas libres impresas en el comprobante.

tipoBienServicioComprado body integer Required

Tipo de bienes y servicios comprados según la clasificación del formato 606 de la DGII (1 a 11). Envíalo siempre, porque la API no lo valida; si lo omites, guarda 0 sin avisar y el 606 sale con ese egreso mal clasificado.

lines body V1LineDto[] Required

Líneas con concepto, cantidad, precio unitario, descuento, recargo, impuestos y retenciones aplicables.

payments body V1PaymentDto[] Optional

Opcional. Pagos asociados al comprobante; cada elemento lleva referencia y monto. Si lo omites, no se registra ningún pago.

POST /api/v1/expenses/{id}/edit-amount X-Api-Key Stable

Emite una nota de débito (E33) que corrige los montos de el comprobante y devuelve el documentId de esa nota; el original no se modifica.

Name Type Description
id path string (uuid) Required

Identificador del gasto.

lines body V1EditAmountLineDto[] Required

Lista de líneas a editar. Cada elemento referencia el orden de la línea original y los campos que se desean sobreescribir.

lines[].order body integer Required

Posición de la línea en el comprobante original (1 para la primera, 2 para la segunda…).

lines[].quantity body decimal Optional

Nueva cantidad. Solo se aplica si se envía.

lines[].unitPrice body decimal Optional

Nuevo precio unitario. Solo se aplica si se envía.

lines[].discount body decimal Optional

Nuevo descuento aplicable a la línea.

lines[].recharge body decimal Optional

Nuevo recargo aplicable a la línea.

lines[].taxes body V1TaxDto[] Optional

Nueva lista de impuestos aplicables a la línea.

lines[].withholdings body V1WithholdingDto[] Optional

Nueva lista de retenciones aplicables a la línea.

POST /api/v1/expenses/{id}/edit-text X-Api-Key Stable

Emite una nota de débito (E33) que corrige la descripción de las líneas de el comprobante y devuelve el documentId de esa nota; el original no se modifica.

Name Type Description
id path string (uuid) Required

Identificador del comprobante.

lines body V1EditTextLineDto[] Required

Lista de líneas a editar. Cada elemento referencia el orden de la línea original y la nueva descripción.

lines[].order body integer Required

Posición de la línea en el comprobante original (1 para la primera, 2 para la segunda…).

lines[].description body string Required

Nueva descripción a imprimir en la línea.

Example: record a minor expense

The body mirrors a purchase (E41) without supplierId: branchId, tipoBienServicioComprado (606 classification, 1 to 11), sequence (optional: if omitted, the next E43 NCF from the active sequence is used), lines and payments. Always send tipoBienServicioComprado: the API does not validate it and, if missing, silently stores 0 and the 606 comes out wrong. The /expenses list returns expenses, purchases and foreign payments mixed, and edit-amount and edit-text issue a new debit note (E33). For disbursements with no ITBIS the line goes with isExempt: true and an empty taxes array. The response follows the resource convention: documentId and consultationUrl.

POST /api/v1/expenses

expense.sh
curl -X POST https://tuempresa.factura.com.do/api/v1/expenses \
-H "X-Api-Key: $FACTURA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"branchId": "b1a2c3d4-e5f6-4789-abcd-1234567890ab",
"sequence": "E430000000001",
"issuedAt": "2026-05-08T10:00:00Z",
"paymentTermId": 1,
"limitDate": "2026-05-08T10:00:00Z",
"currencyId": 1,
"currencyRate": 1,
"tipoBienServicioComprado": 2,
"notes": "Peaje autopista Las Américas",
"lines": [
{
"code": "PEAJE",
"order": 1,
"description": "Peaje autopista Las Américas",
"isService": true,
"quantity": 1,
"unitId": 1,
"unitPrice": 350.00,
"isExempt": true,
"taxes": []
}
],
"payments": [
{ "reference": "EFECTIVO", "amount": 350.00 }
]
}'
expense.ts
const res = await fetch(
"https://tuempresa.factura.com.do/api/v1/expenses",
{
method: "POST",
headers: {
"X-Api-Key": process.env.FACTURA_API_KEY!,
"Content-Type": "application/json",
},
body: JSON.stringify({
branchId,
sequence: "E430000000001",
issuedAt: new Date().toISOString(),
paymentTermId: 1,
limitDate: new Date().toISOString(),
currencyId: 1,
currencyRate: 1,
tipoBienServicioComprado: 2, // clasificación 606 (1 a 11); si falta, se guarda 0
notes: "Peaje autopista Las Américas",
lines,
payments,
}),
},
);
if (!res.ok) throw new Error(`factura.com.do: ${res.status}`);
const { documentId, consultationUrl } = await res.json();

Response

response.json
{
"documentId": "e3b0c442-98fc-4c14-9afb-f4c8996fb924",
"consultationUrl": "https://ecf.dgii.gov.do/ecf/ConsultaTimbre?RNCEmisor=131000001&ENCF=E430000000001&…"
}

Example: 400 when a line carries a non-exempt ITBIS rate

The handler invokes ValidateE43Rules on the declared rates. If it finds one that is not zero, it responds with the domain rule text.

400-impuesto-no-exento.json
{
"success": false,
"message": "Los comprobantes E43 (Comprobante para gastos menores) solo permiten el impuesto exento (0%)."
}

Minor expense vs. formal purchase

  • Minor expense (E43): no identifiable supplier, lines with exempt ITBIS. Cases: toll, tip, ad-hoc per diems.
  • Formal purchase (E41): supplier in your catalog not registered with the DGII, lines with ITBIS and withholdings. Cases: supplies, professional services, rentals.

Next steps

Next step

Continue here