Referencia API
Referencia de la API
Todos los endpoints de /v1, generados desde el OpenAPI 3.1 que publicamos junto con la especificación.
Esta referencia se genera desde public-api-openapi.yaml en cada build, así que no puede desviarse del contrato. La especificación en prosa manda donde ambas difieran.
https://api.facturia.cl/v1Solo TLS 1.2+. No hay raíz sin versionar ni puerto sin cifrar. Cada respuesta lleva Facturia-Request-Id; cítalo en soporte.
Capítulos
Cuenta y llaves (5)
La cuenta autenticada, la llave en uso y el minteo de llaves con una llave root.
Empresas (13)
El límite de tenencia: creación, custodia del certificado, mandato, puesta en marcha y automatizaciones.
Folios y CAF (5)
Disponibilidad de folios por tipo de documento, solicitud de timbraje y carga de CAF propios.
Documentos (13)
Emisión de DTE, lectura, artefactos PDF y XML, enlaces públicos y acciones sobre un documento.
Documentos recibidos (7)
Los DTE de tus proveedores y la respuesta comercial: aceptación, reclamo y acuse de recibo.
Impuestos (21)
RCV, caracterización, propuesta y declaración de F29, gastos y sugerencias de tipo 46.
Conectores (7)
Las fuentes de primera parte que alimentan el libro de gastos: Fintoc y la carga de cartolas.
Webhooks (11)
Endpoints, el libro de eventos, inspección de entregas y reintento manual.
Consumo (2)
El libro de medición inmutable del que sale tu factura.
Test helpers (4)
Endpoints que solo existen para llaves de prueba y mueven las piezas que normalmente mueve el mundo.
Meta (3)
Datos de referencia sin autenticación.
Todos los endpoints
| Método | Ruta | Qué hace |
|---|---|---|
GET | /account | Retrieve the account and the key in use |
GET | /api_keys | List API keys (metadata only; secrets are never returned) |
POST | /api_keys | Mint an API key (root key only) |
DELETE | /api_keys/{key_id} | Revoke an API key immediately (root key only) |
POST | /api_keys/{key_id}/roll | Issue a replacement secret for a key (root key only) |
GET | /empresas | List empresas visible to this key |
POST | /empresas | Create an empresa |
GET | /empresas/{empresa_id} | Retrieve an empresa |
PATCH | /empresas/{empresa_id} | Update an empresa |
GET | /empresas/{empresa_id}/certificate | Retrieve certificate metadata |
POST | /empresas/{empresa_id}/certificate | Upload (or reuse) the empresa's digital certificate |
DELETE | /empresas/{empresa_id}/certificate | Purge the certificate from the vault (revokes custody, suspends emission) |
POST | /empresas/{empresa_id}/mandato | Record the mandato authorizing Facturia to act before the SII |
DELETE | /empresas/{empresa_id}/mandato | Revoke the mandato |
GET | /empresas/{empresa_id}/onboarding | Onboarding lifecycle, steps and blocking human actions |
GET | /empresas/{empresa_id}/automation_settings | Retrieve per-empresa automation settings |
PATCH | /empresas/{empresa_id}/automation_settings | Update per-empresa automation settings |
PATCH | /empresas/{empresa_id}/branding | Update logo, default print format and footer text |
GET | /folios | Folio availability per doc type |
POST | /folios/requests | Request a new CAF from the SII (async) |
GET | /cafs | List CAFs held for this empresa |
POST | /cafs | Upload a CAF you already hold |
DELETE | /cafs/{caf_id} | Deactivate a CAF (history is preserved) |
GET | /documents | List emitted documents |
POST | /documents | Emit a DTE |
POST | /documents/previews | Price and validate a document without emitting it |
GET | /documents/previews/{preview_id} | Retrieve a stored preview |
GET | /documents/{document_id} | Retrieve a document |
GET | /documents/{document_id}/pdf | Download the PDF |
GET | /documents/{document_id}/xml | Download the signed XML exactly as sent to the SII |
GET | /documents/{document_id}/events | Lifecycle events for one document |
POST | /documents/{document_id}/retry | Retry a document in failed |
POST | /documents/{document_id}/send | Email the document to the receptor |
POST | /documents/{document_id}/credit_note | Emit a nota de crédito against this document |
POST | /documents/{document_id}/public_links | Create or rotate public links for this document's artifacts |
DELETE | /documents/{document_id}/public_links | Revoke every public link for this document |
GET | /received_documents | List supplier DTEs received for this empresa |
GET | /received_documents/{received_document_id} | Retrieve a received document |
GET | /received_documents/{received_document_id}/xml | Download the original supplier XML |
GET | /received_documents/{received_document_id}/pdf | Render the received document as PDF |
POST | /received_documents/{received_document_id}/accept | Accept the content (SII acción ACD) |
POST | /received_documents/{received_document_id}/reject | Reclamar the document (RCD / RFP / RFT) |
POST | /received_documents/{received_document_id}/acknowledge_receipt | Otorgar recibo de mercaderías o servicios (SII acción ERM) |
GET | /tax/purchases | RCV — registro de compras |
GET | /tax/sales | RCV — registro de ventas |
GET | /tax/summary | Aggregated RCV totals for a period (the F29 inputs) |
POST | /tax/sync | Force an RCV resync (async) |
POST | /tax/purchases/characterize | Caracterizar up to 500 purchase entries in one call |
POST | /tax/purchases/{entry_id}/characterize | Caracterizar one purchase entry (writes to the SII registry) |
POST | /tax/purchases/{entry_id}/estado_contable | Move an entry between REGISTRO / PENDIENTE / NO_INCLUIR |
GET | /tax/f29/proposals/{period} | Computed F29 propuesta for a period |
GET | /tax/f29/proposals/{period}/upload_file | Download the SII-format upload .txt for this proposal |
POST | /tax/f29/proposals/{period}/public_links | Mint a no-auth link to the propuesta's upload .txt |
DELETE | /tax/f29/proposals/{period}/public_links | Revoke every public link for this propuesta |
POST | /tax/f29/proposals/{period}/recompute | Recompute the proposal, optionally overriding codes |
GET | /tax/f29/filings | List F29 filings |
POST | /tax/f29/filings | File the F29 for a period (async job) |
GET | /tax/f29/filings/{filing_id} | Retrieve a filing |
GET | /tax/expenses | List ingested foreign-currency charges |
POST | /tax/expenses | Ingest a charge that may require a tipo-46 factura de compra |
GET | /tax/suggestions | List tax suggestions |
GET | /tax/suggestions/{suggestion_id} | Retrieve a suggestion |
POST | /tax/suggestions/{suggestion_id}/confirm | Act on a suggestion (for emit_46, emits the document) |
POST | /tax/suggestions/{suggestion_id}/dismiss | Dismiss a suggestion |
GET | /connections | List connector connections for this empresa |
POST | /connections | Create a Fintoc bank/card connection |
GET | /connections/{connection_id} | Retrieve a connection |
DELETE | /connections/{connection_id} | Disconnect (revokes the link, stops ingestion) |
POST | /connections/{connection_id}/sync | Force a movement sync (async) |
GET | /tax/statements | List uploaded cartolas |
POST | /tax/statements | Upload a cartola (CSV/XLSX) to create expenses |
GET | /webhook_endpoints | List webhook endpoints |
POST | /webhook_endpoints | Register a webhook endpoint |
GET | /webhook_endpoints/{webhook_endpoint_id} | Retrieve a webhook endpoint |
PATCH | /webhook_endpoints/{webhook_endpoint_id} | Update a webhook endpoint |
DELETE | /webhook_endpoints/{webhook_endpoint_id} | Delete a webhook endpoint |
POST | /webhook_endpoints/{webhook_endpoint_id}/ping | Send a synthetic event to verify plumbing |
POST | /webhook_endpoints/{webhook_endpoint_id}/rotate_secret | Rotate the signing secret |
GET | /webhook_endpoints/{webhook_endpoint_id}/deliveries | Inspect delivery attempts |
POST | /webhook_endpoints/{webhook_endpoint_id}/deliveries/{delivery_id}/retry | Redeliver an event |
GET | /events | Query the event ledger (retained 12 months) |
GET | /events/{event_id} | Retrieve an event |
GET | /usage | Usage summary for a billing period |
GET | /usage/records | The immutable metering ledger |
POST | /test_helpers/received_documents | Inject a supplier DTE as if it had arrived at the reception address |
POST | /test_helpers/rcv/seed | Seed RCV rows for a period so F29 propuestas have data |
POST | /test_helpers/clock | Advance this empresa's simulated clock |
POST | /test_helpers/empresas/{empresa_id}/onboarding | Drive an empresa's onboarding to any state |
GET | /jobs/{job_id} | Retrieve an async job (folio request, RCV sync, certification step) |
GET | /mandato_terms | The current mandato text and version |
GET | /error_codes | The machine-readable error dictionary (unauthenticated) |
Webhooks
El OpenAPI también describe los envíos salientes. Su forma, su firma y su calendario de reintentos están en Webhooks.
| Grupo | Eventos |
|---|---|
document.lifecycle | document.created | .sent | .accepted | .reparo | .rejected | .failed | .annulled |
received_document.lifecycle | received_document.created | .deadline_approaching | .accepted | .rejected | .receipt_acknowledged |
empresa.lifecycle | empresa.onboarding.* | empresa.suspended | certificate.expiring | folios.* |
tax.lifecycle | tax.rcv.synced | tax.f29.* | tax.suggestion.* |