Importing documents
If you’re migrating from another provider (or reconciling), you can import existing electronic documents from their signed XML. The importer auto-detects direction — whether each document was issued by the tenant or received by it — and files it accordingly.
The flow
Section titled “The flow”An import is a staged job: create → start → review → commit.
POST /v1/documents/imports # create an import (upload/register XML)POST /v1/documents/imports/:id/start # parse + validate (dry run)GET /v1/documents/imports/:id # inspect parsed results / errorsPOST /v1/documents/imports/:id/commit # persist the reviewed documentsGET /v1/documents/imports # list importsThe dry-run (start) parses every XML and reports what would be imported and any
problems, without persisting. You commit only after reviewing.
What it does with each document
Section titled “What it does with each document”- Issued by the tenant → recorded as a historical invoice. It is never
re-submitted: EmiteCR asks Hacienda for its real state and records it
(
acceptedorrejected) — without notifying anyone. The system that issued it already sent it to your customer, so no email, WhatsApp notification or webhook goes out for it. You can still email it from the invoice yourself. - Received by the tenant → filed into Received documents.
- A MensajeReceptor is routed by cédula: if its Receptor is the tenant, it
back-fills the received document’s
acceptanceStatus; if its Emisor is the tenant, it’s a customer’s response to an invoice you issued, and stamps that invoice’sreceptorAcceptanceStatus.
Importing by email (inbound mailbox)
Section titled “Importing by email (inbound mailbox)”Each tenant has a shareable address at in.emite.cr (see
GET /v1/tenants/me/inbox). Suppliers can send the signed XML (or a ZIP) there;
every received email enters the same pipeline above as an auto-committed
import batch (source: 'email' — no dry-run review, since there is no human in
the loop) and is logged in the mailbox log (GET /v1/tenants/me/inbox/messages).
- Large XML is uploaded to object storage first; the importer reads from there.
- Importing never re-transmits to Hacienda — these documents already have their fiscal life. Import is bookkeeping, not emission.
- Sequences are not advanced by an import (it doesn’t allocate consecutivos); if you’re also going to emit new documents, seed your counter separately — see Consecutivo sequences.