Quickstart
Install the Simplo SDK, emit your first DTE (Chilean electronic invoice) and follow its SII status in a few minutes.
Emit your first DTE (Documento Tributario Electronico — a Chilean electronic tax document, such as an invoice or receipt) in a few minutes.
1. Install
Section titled “1. Install”npm install @simplohq/sdk# or: pnpm add @simplohq/sdkRequirements: Node.js 18.17+ (or Deno, Bun, Cloudflare Workers — anything
with a global fetch). The SDK has zero runtime dependencies.
2. Configure credentials
Section titled “2. Configure credentials”Get an API key (sk_simplo_...) from your Simplo account — see
Authentication — and export it:
export SIMPLO_API_KEY="sk_simplo_..."The client picks up SIMPLO_API_KEY automatically, or you can pass apiKey
explicitly.
3. Emit an invoice
Section titled “3. Emit an invoice”import Simplo from '@simplohq/sdk';
const simplo = new Simplo(); // reads SIMPLO_API_KEY
const dte = await simplo.dtes.emit({ tipo_dte: 33, // Factura Electronica (invoice) receptor: { rut: '76543210-K', // recipient's RUT (Chilean tax ID) razon_social: 'Cliente Ejemplo SpA', giro: 'Software services', direccion: 'Av. Providencia 1234', comuna: 'Providencia', }, detalle: [{ nombre: 'Consulting services', cantidad: 10, precio: 50000 }],});
console.log(dte.id, dte.folio, dte.estado); // "….", 1042, "firmado"emit returns as soon as the document is signed (estado: "firmado").
Submission to the SII (Servicio de Impuestos Internos, the Chilean tax
authority) happens asynchronously.
Amounts are integer Chilean pesos (CLP). VAT (19%) is computed by the API — you send net prices.
4. Follow the document’s status
Section titled “4. Follow the document’s status”Poll:
const current = await simplo.dtes.retrieve(dte.id);console.log(current.estado); // "enviando" | "procesando" | "aceptado" | "rechazado" | "con_reparos"console.log(current.tracking?.track_id); // SII track ID once submittedOr subscribe to webhooks — see Webhooks.
The full status lifecycle is documented in Estados.
5. Download the PDF and XML
Section titled “5. Download the PDF and XML”import { writeFile } from 'node:fs/promises';
const pdf = await simplo.dtes.pdf(dte.id); // ArrayBufferawait writeFile('invoice.pdf', Buffer.from(pdf));
const xml = await simplo.dtes.xml(dte.id); // signed XML as stringPass { cedible: true } to pdf() for the transferable copy used in
factoring.
Before you can emit for real
Section titled “Before you can emit for real”Two one-time setup steps per company:
- Digital certificate — uploaded through your Simplo account; the SDK
lets you check it with
await simplo.company.certificate.status(). - Folios (CAF) — a CAF (Codigo de Autorizacion de Folios) is the SII
file authorizing a range of document numbers. Upload one through the SDK
with
await simplo.folios.upload({ tipo_dte: 33, caf_xml })and monitor availability withsimplo.folios.list().
Next steps
Section titled “Next steps”The rest of this site is in Spanish (the root locale); every page an integration needs is linked from the sidebar. The English SDK docs live in the SDK repository as plain markdown.