Skip to content
SimploSimplo Docs

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.

Ventana de terminal
npm install @simplohq/sdk
# or: pnpm add @simplohq/sdk

Requirements: Node.js 18.17+ (or Deno, Bun, Cloudflare Workers — anything with a global fetch). The SDK has zero runtime dependencies.

Get an API key (sk_simplo_...) from your Simplo account — see Authentication — and export it:

Ventana de terminal
export SIMPLO_API_KEY="sk_simplo_..."

The client picks up SIMPLO_API_KEY automatically, or you can pass apiKey explicitly.

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.

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 submitted

Or subscribe to webhooks — see Webhooks.

The full status lifecycle is documented in Estados.

import { writeFile } from 'node:fs/promises';
const pdf = await simplo.dtes.pdf(dte.id); // ArrayBuffer
await writeFile('invoice.pdf', Buffer.from(pdf));
const xml = await simplo.dtes.xml(dte.id); // signed XML as string

Pass { cedible: true } to pdf() for the transferable copy used in factoring.

Two one-time setup steps per company:

  1. Digital certificate — uploaded through your Simplo account; the SDK lets you check it with await simplo.company.certificate.status().
  2. 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 with simplo.folios.list().

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.