Folios and CAF
What a CAF is, how SII-authorized folios get uploaded to the Simplo API, and how to avoid running out of folios.
You don’t invent folios, and neither does Simplo — the SII pre-authorizes ranges per document type through CAF (Código de Autorización de Folios, “Folio Authorization Code”) files that you download from the SII portal and upload to Simplo once. See the SII’s official notice on electronic stamping (in Spanish) for the regulatory detail, and Electronic invoicing in Chile for the rest of the concepts (certificate, certification, environments).
Endpoints
Section titled “Endpoints”| Method | Path | Description |
|---|---|---|
GET |
/api/v1/billing/caf |
List the uploaded folio ranges (CAFs) and their availability. |
POST |
/api/v1/billing/caf |
Upload a CAF file downloaded from the SII. |
These endpoints are session-only (your account’s JWT): a billing:dte
API key can’t call them (403 BILLING_API_KEY_ROUTE_NOT_ALLOWED). Folios
are managed from your account at app.simplo.cl; your integration only
emits. In the sandbox there’s nothing to upload: synthetic folios are
provisioned automatically when you create your key.
With the SDK
Section titled “With the SDK”await simplo.folios.upload({ tipo_dte: 33, caf_xml: cafFileContents });
const cafs = await simplo.folios.list({ tipo_dte: 33, is_active: true });console.log(cafs[0].folios_disponibles); // e.g. 158 remainingSimplo assigns the next folio automatically on every emit. Watch
folios_disponibles from your account (the caf.low_stock webhook event
exists in the contract, but webhook delivery isn’t live yet) and upload a
new CAF before you run out of folios — emission fails when no folios are
available.
Uploading a duplicate CAF is safe: it returns a ConflictError, it never
duplicates the range.
folios.list() returns a plain array (no pagination): a company handles a
handful of CAFs by nature.
Related
Section titled “Related”- Emission — how folios get consumed
- Webhooks — the
caf.low_stockevent - Digital certificate — the other one-time setup requirement
- Electronic invoicing in Chile — the CAF in context, with the official SII sources