Skip to main content

Overview

The InvoiceInfo type contains all the detailed information about the invoice including buyer information, amounts, taxes, and payment terms.

InvoiceInfo

Main invoice information type containing all invoice details.
export type InvoiceInfo = {
  fechaEmision: string;
  dirEstablecimiento: string;
  contribuyenteEspecial?: string;
  obligadoContabilidad: "SI" | "NO";
  comercioExterior?: string;
  incoTermFactura?: string;
  lugarIncoTerm?: string;
  paisOrigen?: string;
  puertoEmbarque?: string;
  puertoDestino?: string;
  paisDestino?: string;
  paisAdquisicion?: string;
  tipoIdentificacionComprador: "04" | "05" | "06" | "07" | "08";
  guiaRemision?: string;
  razonSocialComprador: string;
  identificacionComprador: string;
  direccionComprador: string;
  totalSinImpuestos: string;
  totalSubsidio?: string;
  incoTermTotalSinImpuestos?: string;
  totalDescuento: string;
  codDocReembolso?: string;
  totalComprobantesReembolso?: string;
  totalBaseImponibleReembolso?: string;
  totalImpuestoReembolso?: string;
  totalConImpuestos: TotalWithTaxes;
  compensaciones?: Compensations;
  propina?: string;
  fleteInternacional?: string;
  seguroInternacional?: string;
  gastosAduaneros?: string;
  gastosTransporteOtros?: string;
  importeTotal: string;
  moneda: string;
  placa?: string;
  pagos: Payments;
  valorRetIva?: string;
  valorRetRenta?: string;
};

Fields

fechaEmision
string
required
Invoice emission date in format DD/MM/YYYY (e.g., "01/01/2024")
dirEstablecimiento
string
required
Establishment address where the invoice is issued
contribuyenteEspecial
string
Special taxpayer resolution number, if applicable
obligadoContabilidad
'SI' | 'NO'
required
Whether the business is required to keep accounting records
  • "SI" - Yes, required to keep accounting
  • "NO" - Not required to keep accounting
comercioExterior
string
Foreign trade designation (e.g., "EXPORTADOR" for exporter)
incoTermFactura
string
Incoterm code for international trade
lugarIncoTerm
string
Incoterm location
paisOrigen
string
Country of origin code (3 digits)
puertoEmbarque
string
Port of embarkation for international shipments
puertoDestino
string
Port of destination for international shipments
paisDestino
string
Destination country code (3 digits)
paisAdquisicion
string
Acquisition country code (3 digits)
tipoIdentificacionComprador
string
required
Buyer’s identification type. Allowed values:
  • "04" - RUC
  • "05" - CÉDULA (ID card)
  • "06" - PASAPORTE (Passport)
  • "07" - VENTA A CONSUMIDOR FINAL (Final consumer sale)
  • "08" - IDENTIFICACIÓN DEL EXTERIOR (Foreign identification)
guiaRemision
string
Remission guide number in format XXX-XXX-XXXXXXXXX
razonSocialComprador
string
required
Buyer’s legal/business name
identificacionComprador
string
required
Buyer’s identification number (RUC, ID, passport, etc.)
direccionComprador
string
required
Buyer’s address
totalSinImpuestos
string
required
Total amount before taxes (decimal format: "50.00")
totalSubsidio
string
Total subsidy amount
incoTermTotalSinImpuestos
string
Incoterm total without taxes
totalDescuento
string
required
Total discount amount
codDocReembolso
string
Reimbursement document code
totalComprobantesReembolso
string
Total reimbursement receipts amount
totalBaseImponibleReembolso
string
Total reimbursement taxable base
totalImpuestoReembolso
string
Total reimbursement tax amount
totalConImpuestos
TotalWithTaxes
required
Tax totals breakdown by tax type and rate. See TotalWithTaxes
compensaciones
Compensations
Tax compensations. See Compensations
propina
string
Tip amount
fleteInternacional
string
International freight charges
seguroInternacional
string
International insurance charges
gastosAduaneros
string
Customs expenses
gastosTransporteOtros
string
Other transportation expenses
importeTotal
string
required
Total invoice amount including all taxes and charges
moneda
string
required
Currency code (e.g., "USD", "EUR")
placa
string
Vehicle license plate (for transportation services)
pagos
Payments
required
Payment information. See Payments
valorRetIva
string
VAT retention amount
valorRetRenta
string
Income tax retention amount

TotalWithTax

Individual tax total information.
export type TotalWithTax = {
  codigo: "2" | "3" | "5";
  codigoPorcentaje: "0" | "2" | "3" | "6" | "7" | "8";
  descuentoAdicional: string;
  baseImponible: string;
  tarifa?: string;
  valor: string;
  valorDevolucionIva?: string;
};
codigo
string
required
Tax code:
  • "2" - IVA (VAT)
  • "3" - ICE (Special consumption tax)
  • "5" - IRBPNR (Tax on non-renewable natural resources)
codigoPorcentaje
string
required
Tax rate code. For IVA:
  • "0" - 0% IVA
  • "2" - 12% IVA
  • "3" - 14% IVA
  • "6" - No Objeto de Impuesto (Not subject to tax)
  • "7" - Exento de IVA (Exempt from VAT)
  • "8" - IVA diferenciado (Differentiated VAT)
For ICE, see table 18 of the electronic receipts technical sheet
descuentoAdicional
string
required
Additional discount amount
baseImponible
string
required
Taxable base amount
tarifa
string
Tax rate percentage
valor
string
required
Tax amount
valorDevolucionIva
string
VAT refund amount

TotalWithTaxes

Container for all tax totals.
export type TotalWithTaxes = {
  totalImpuesto: TotalWithTax[];
};
totalImpuesto
TotalWithTax[]
required
Array of tax totals, one for each applicable tax type and rate

Compensation

Individual compensation/offset information.
export type Compensation = {
  codigo: string;
  tarifa: string;
  valor: string;
};
codigo
string
required
Compensation code
tarifa
string
required
Compensation rate
valor
string
required
Compensation amount

Compensations

Container for all compensations.
export type Compensations = {
  compensacion: Compensation[];
};
compensacion
Compensation[]
required
Array of compensation items

Payment

Individual payment information.
export type Payment = {
  formaPago: string;
  total: string;
  plazo: string;
  unidadTiempo: string;
};
formaPago
string
required
Payment method code (e.g., "01" for cash, "20" for bank transfer). See SRI payment method codes
total
string
required
Payment amount
plazo
string
required
Payment term/period
unidadTiempo
string
required
Time unit for payment term (e.g., "dias", "meses")

Payments

Container for all payment information.
export type Payments = {
  pago: Payment[];
};
pago
Payment[]
required
Array of payment items. Multiple payments can be specified for split payments

Usage Example

import { InvoiceInfo, TotalWithTaxes, Payments } from 'open-factura';

const invoiceInfo: InvoiceInfo = {
  fechaEmision: "03/03/2026",
  dirEstablecimiento: "Av. Amazonas 123, Quito",
  obligadoContabilidad: "SI",
  tipoIdentificacionComprador: "04",
  razonSocialComprador: "CLIENTE EJEMPLO S.A.",
  identificacionComprador: "0987654321001",
  direccionComprador: "Av. 6 de Diciembre 456, Quito",
  totalSinImpuestos: "100.00",
  totalDescuento: "0.00",
  totalConImpuestos: {
    totalImpuesto: [
      {
        codigo: "2",
        codigoPorcentaje: "2",
        descuentoAdicional: "0.00",
        baseImponible: "100.00",
        tarifa: "12",
        valor: "12.00"
      }
    ]
  },
  importeTotal: "112.00",
  moneda: "USD",
  pagos: {
    pago: [
      {
        formaPago: "01",
        total: "112.00",
        plazo: "0",
        unidadTiempo: "dias"
      }
    ]
  }
};

Build docs developers (and LLMs) love