Skip to main content

Overview

The TaxInfo type contains all tax-related and business identification information required by Ecuador’s SRI (Servicio de Rentas Internas) for electronic invoices.

Type Definition

export type TaxInfo = {
  ambiente: "1" | "2";
  tipoEmision: string;
  razonSocial: string;
  nombreComercial: string;
  ruc: string;
  claveAcceso: string;
  codDoc: "01" | "03" | "04" | "05" | "06" | "07";
  estab: string;
  ptoEmi: string;
  secuencial: string;
  dirMatriz: string;
  regimenMicroempresas?: "CONTRIBUYENTE RÉGIMEN MICROEMPRESAS";
  agenteRetencion?: string;
  contribuyenteRimpe?:
    | "CONTRIBUYENTE NEGOCIO POPULAR - RÉGIMEN RIMPE"
    | "CONTRIBUYENTE RÉGIMEN RIMPE";
};

Fields

ambiente
'1' | '2'
required
Environment type for the invoice
  • "1" - Testing (pruebas)
  • "2" - Production (producción)
tipoEmision
string
required
Emission type code. Typically "1" for normal emission
razonSocial
string
required
Legal business name (company’s official registered name)
nombreComercial
string
required
Commercial/trade name (business name used commercially)
ruc
string
required
RUC (Registro Único de Contribuyentes) - Ecuador’s tax identification number. Must be 13 digits
claveAcceso
string
required
Access key (clave de acceso) - 49-digit unique identifier for the electronic document. This is automatically generated by the system
codDoc
string
required
Document type code. Allowed values:
  • "01" - FACTURA (Invoice)
  • "03" - LIQUIDACIÓN DE COMPRA DE BIENES Y PRESTACIÓN DE SERVICIOS (Purchase settlement)
  • "04" - NOTA DE CRÉDITO (Credit note)
  • "05" - NOTA DE DÉBITO (Debit note)
  • "06" - GUÍA DE REMISIÓN (Delivery guide)
  • "07" - COMPROBANTE DE RETENCIÓN (Retention receipt)
estab
string
required
Establishment code - 3-digit code identifying the business establishment (e.g., "001")
ptoEmi
string
required
Point of emission code - 3-digit code identifying the emission point (e.g., "001")
secuencial
string
required
Sequential number - 9-digit sequential invoice number (e.g., "000000001")
dirMatriz
string
required
Main office address (headquarters address)
regimenMicroempresas
string
Microenterprise regime indicator. Only allowed value:
  • "CONTRIBUYENTE RÉGIMEN MICROEMPRESAS"
agenteRetencion
string
Withholding agent code. Typically "0" if not a withholding agent, or a resolution number if applicable
contribuyenteRimpe
string
RIMPE (Régimen Simplificado para Emprendedores y Negocios Populares) taxpayer type. Allowed values:
  • "CONTRIBUYENTE NEGOCIO POPULAR - RÉGIMEN RIMPE" - Popular business taxpayer
  • "CONTRIBUYENTE RÉGIMEN RIMPE" - RIMPE regime taxpayer

Usage Example

import { TaxInfo } from 'open-factura';

const taxInfo: TaxInfo = {
  ambiente: "1", // Testing environment
  tipoEmision: "1",
  razonSocial: "EJEMPLO EMPRESA S.A.",
  nombreComercial: "Ejemplo Empresa",
  ruc: "1234567890001",
  claveAcceso: "0101202301123456789000110010010000000011234567818",
  codDoc: "01", // Invoice
  estab: "001",
  ptoEmi: "001",
  secuencial: "000000001",
  dirMatriz: "Av. Principal 123, Quito, Ecuador",
  agenteRetencion: "0"
};

Notes

  • The claveAcceso (access key) is automatically generated when using InvoiceInput type
  • The combination of estab, ptoEmi, and secuencial must be unique for each invoice
  • RUC must be exactly 13 digits
  • Establishment and emission point codes must be exactly 3 digits
  • Sequential number must be exactly 9 digits

Build docs developers (and LLMs) love