Facturiadocs
API reference

Received documents

Your suppliers' DTEs and the commercial response: acceptance, claim and acknowledgement of receipt.

Base: https://api.facturia.cl/v1. Every endpoint in this chapter authenticates with Authorization: Bearer unless stated otherwise, and the error envelope is the one in Errors.

MethodPathWhat it does
GET/received_documentsList supplier DTEs received for this empresa
GET/received_documents/{received_document_id}Retrieve a received document
GET/received_documents/{received_document_id}/xmlDownload the original supplier XML
GET/received_documents/{received_document_id}/pdfRender the received document as PDF
POST/received_documents/{received_document_id}/acceptAccept the content (SII acción ACD)
POST/received_documents/{received_document_id}/rejectReclamar the document (RCD / RFP / RFT)
POST/received_documents/{received_document_id}/acknowledge_receiptOtorgar recibo de mercaderías o servicios (SII acción ERM)

GET /received_documents

List supplier DTEs received for this empresa

Supplier DTEs that arrived at the empresa's reception address, newest first, filterable by tipo_dte and acceptance status.

curl -sS https://api.facturia.cl/v1/received_documents \
  -H "Authorization: Bearer $FACTURIA_KEY" \
  -H "Facturia-Empresa: $EMPRESA"

Parameters

ParameterInRequiredTypeNotes
Facturia-Empresaheader—stringTarget empresa: canonical RUT (77928532-4) or empresa id (emp_…). Required on every empresa-scoped call unless the key is an empresa token. This header is the ONLY mechanism: there is no ?empresa= query parameter and no empresa body field. Omitted where required → 400 empresa_required; outside the allowlist → 403 empresa_not_allowed.
limitquery—integer
cursorquery—stringOpaque cursor from a previous response's next_cursor.
expandquery—stringAccepts nothing on this list, and says so rather than ignoring it. raw_xml inlines the supplier's entire signed envelope, so it is available on GET /received_documents/\{received_document_id\} only; any value here is 400 invalid_field (§5.4).
tipo_dtequery—33 · 34 · 39 · 41 · 46 · 52 · 56 · 61
emisor_rutquery—Rut
commercial_response_statequery—pending · accepted · rejected · receipt_acknowledged · expired_accepted · not_applicable
sourcequery—intercambio · rcv · manual
issue_date[gte]query—string
issue_date[lte]query—string

Responses

CodeMeaningBody
200A list of received documents.lista de ReceivedDocument
401Missing, malformed or revoked key.ErrorResponse
403Valid key, not permitted — scope, empresa allowlist, or mode.ErrorResponse
429Too many requests.ErrorResponse
defaultAn error not otherwise enumerated for this operation, in the same §5.5 envelope as every other refusal. Branch on error.code, never on the HTTP status alone or on error.message — a code this operation has not been seen to throw yet is still safer to route on than a string meant for a human.ErrorResponse

GET /received_documents/{received_document_id}

Retrieve a received document

One received DTE, including whatever commercial response (accept/reject/acknowledge_receipt) has been registered for it.

curl -sS https://api.facturia.cl/v1/received_documents/rdoc_01K2R9M3D8V5QW7N \
  -H "Authorization: Bearer $FACTURIA_KEY" \
  -H "Facturia-Empresa: $EMPRESA"

Parameters

ParameterInRequiredTypeNotes
received_document_idpathyesstring
Facturia-Empresaheader—stringTarget empresa: canonical RUT (77928532-4) or empresa id (emp_…). Required on every empresa-scoped call unless the key is an empresa token. This header is the ONLY mechanism: there is no ?empresa= query parameter and no empresa body field. Omitted where required → 400 empresa_required; outside the allowlist → 403 empresa_not_allowed.
expandquery—stringraw_xml returns the supplier's original XML inline, signature intact.

Responses

CodeMeaningBody
200The received document.ReceivedDocument
401Missing, malformed or revoked key.ErrorResponse
403Valid key, not permitted — scope, empresa allowlist, or mode.ErrorResponse
404No such object under this key.ErrorResponse
429Too many requests.ErrorResponse
defaultAn error not otherwise enumerated for this operation, in the same §5.5 envelope as every other refusal. Branch on error.code, never on the HTTP status alone or on error.message — a code this operation has not been seen to throw yet is still safer to route on than a string meant for a human.ErrorResponse

GET /received_documents/{received_document_id}/xml

Download the original supplier XML

The exact XML the SII delivered for this received document.

curl -sS https://api.facturia.cl/v1/received_documents/rdoc_01K2R9M3D8V5QW7N/xml \
  -H "Authorization: Bearer $FACTURIA_KEY" \
  -H "Facturia-Empresa: $EMPRESA"

Parameters

ParameterInRequiredTypeNotes
received_document_idpathyesstring
Facturia-Empresaheader—stringTarget empresa: canonical RUT (77928532-4) or empresa id (emp_…). Required on every empresa-scoped call unless the key is an empresa token. This header is the ONLY mechanism: there is no ?empresa= query parameter and no empresa body field. Omitted where required → 400 empresa_required; outside the allowlist → 403 empresa_not_allowed.

Responses

CodeMeaningBody
200The XML as received. This file is the legal artifact.application/xml
401Missing, malformed or revoked key.ErrorResponse
403Valid key, not permitted — scope, empresa allowlist, or mode.ErrorResponse
429Too many requests.ErrorResponse
defaultAn error not otherwise enumerated for this operation, in the same §5.5 envelope as every other refusal. Branch on error.code, never on the HTTP status alone or on error.message — a code this operation has not been seen to throw yet is still safer to route on than a string meant for a human.ErrorResponse

GET /received_documents/{received_document_id}/pdf

Render the received document as PDF

A rendered PDF of the received document, for display or archival outside the API.

curl -sS https://api.facturia.cl/v1/received_documents/rdoc_01K2R9M3D8V5QW7N/pdf \
  -H "Authorization: Bearer $FACTURIA_KEY" \
  -H "Facturia-Empresa: $EMPRESA"

Parameters

ParameterInRequiredTypeNotes
received_document_idpathyesstring
Facturia-Empresaheader—stringTarget empresa: canonical RUT (77928532-4) or empresa id (emp_…). Required on every empresa-scoped call unless the key is an empresa token. This header is the ONLY mechanism: there is no ?empresa= query parameter and no empresa body field. Omitted where required → 400 empresa_required; outside the allowlist → 403 empresa_not_allowed.

Responses

CodeMeaningBody
200The rendered PDF.application/pdf
401Missing, malformed or revoked key.ErrorResponse
403Valid key, not permitted — scope, empresa allowlist, or mode.ErrorResponse
429Too many requests.ErrorResponse
defaultAn error not otherwise enumerated for this operation, in the same §5.5 envelope as every other refusal. Branch on error.code, never on the HTTP status alone or on error.message — a code this operation has not been seen to throw yet is still safer to route on than a string meant for a human.ErrorResponse

POST /received_documents/{received_document_id}/accept

Accept the content (SII acción ACD)

Types 33/34/43 only, inside the 8-day window, once. Doing nothing is also a valid, legally meaningful choice: silence accepts on day 8.

curl -sS -X POST https://api.facturia.cl/v1/received_documents/rdoc_01K2R9M3D8V5QW7N/accept \
  -H "Authorization: Bearer $FACTURIA_KEY" \
  -H "Facturia-Empresa: $EMPRESA" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"note":"…"}'

Parameters

ParameterInRequiredTypeNotes
received_document_idpathyesstring
Facturia-Empresaheader—stringTarget empresa: canonical RUT (77928532-4) or empresa id (emp_…). Required on every empresa-scoped call unless the key is an empresa token. This header is the ONLY mechanism: there is no ?empresa= query parameter and no empresa body field. Omitted where required → 400 empresa_required; outside the allowlist → 403 empresa_not_allowed.
Idempotency-Keyheader—stringClient-generated key, unique per logical operation, retained 24h and scoped to (account, empresa, endpoint). Replays return the original response with Facturia-Idempotent-Replay: true. Same key + different body → 409.

Body

FieldTypeRequiredNotes
notestring—
Responses
CodeMeaningBody
201The registered commercial response.CommercialResponse
401Missing, malformed or revoked key.ErrorResponse
403Valid key, not permitted — scope, empresa allowlist, or mode.ErrorResponse
409State conflict — idempotency reuse, duplicate external_id, artifact not ready.ErrorResponse
422Well-formed but violates a domain rule — folios exhausted, acuse window closed.ErrorResponse
429Too many requests.ErrorResponse
defaultAn error not otherwise enumerated for this operation, in the same §5.5 envelope as every other refusal. Branch on error.code, never on the HTTP status alone or on error.message — a code this operation has not been seen to throw yet is still safer to route on than a string meant for a human.ErrorResponse

POST /received_documents/{received_document_id}/reject

Reclamar the document (RCD / RFP / RFT)

Irreversible. There is no un-reclamar.

curl -sS -X POST https://api.facturia.cl/v1/received_documents/rdoc_01K2R9M3D8V5QW7N/reject \
  -H "Authorization: Bearer $FACTURIA_KEY" \
  -H "Facturia-Empresa: $EMPRESA" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"reason":"content"}'

Parameters

ParameterInRequiredTypeNotes
received_document_idpathyesstring
Facturia-Empresaheader—stringTarget empresa: canonical RUT (77928532-4) or empresa id (emp_…). Required on every empresa-scoped call unless the key is an empresa token. This header is the ONLY mechanism: there is no ?empresa= query parameter and no empresa body field. Omitted where required → 400 empresa_required; outside the allowlist → 403 empresa_not_allowed.
Idempotency-Keyheader—stringClient-generated key, unique per logical operation, retained 24h and scoped to (account, empresa, endpoint). Replays return the original response with Facturia-Idempotent-Replay: true. Same key + different body → 409.

Body

FieldTypeRequiredNotes
reasoncontent · partial_missing · total_missingyescontent → RCD, partial_missing → RFP, total_missing → RFT.
notestring—
Responses
CodeMeaningBody
201The registered commercial response.CommercialResponse
401Missing, malformed or revoked key.ErrorResponse
403Valid key, not permitted — scope, empresa allowlist, or mode.ErrorResponse
409State conflict — idempotency reuse, duplicate external_id, artifact not ready.ErrorResponse
422Well-formed but violates a domain rule — folios exhausted, acuse window closed.ErrorResponse
429Too many requests.ErrorResponse
defaultAn error not otherwise enumerated for this operation, in the same §5.5 envelope as every other refusal. Branch on error.code, never on the HTTP status alone or on error.message — a code this operation has not been seen to throw yet is still safer to route on than a string meant for a human.ErrorResponse

POST /received_documents/{received_document_id}/acknowledge_receipt

Otorgar recibo de mercaderías o servicios (SII acción ERM)

Register the acuse de recibo — receipt of the goods or service, distinct from accept/reject's commercial acceptance — inside the statutory 8-day window.

curl -sS -X POST https://api.facturia.cl/v1/received_documents/rdoc_01K2R9M3D8V5QW7N/acknowledge_receipt \
  -H "Authorization: Bearer $FACTURIA_KEY" \
  -H "Facturia-Empresa: $EMPRESA" \
  -H "Idempotency-Key: $(uuidgen)"

Parameters

ParameterInRequiredTypeNotes
received_document_idpathyesstring
Facturia-Empresaheader—stringTarget empresa: canonical RUT (77928532-4) or empresa id (emp_…). Required on every empresa-scoped call unless the key is an empresa token. This header is the ONLY mechanism: there is no ?empresa= query parameter and no empresa body field. Omitted where required → 400 empresa_required; outside the allowlist → 403 empresa_not_allowed.
Idempotency-Keyheader—stringClient-generated key, unique per logical operation, retained 24h and scoped to (account, empresa, endpoint). Replays return the original response with Facturia-Idempotent-Replay: true. Same key + different body → 409.

Responses

CodeMeaningBody
201The registered commercial response.CommercialResponse
401Missing, malformed or revoked key.ErrorResponse
403Valid key, not permitted — scope, empresa allowlist, or mode.ErrorResponse
422Well-formed but violates a domain rule — folios exhausted, acuse window closed.ErrorResponse
429Too many requests.ErrorResponse
defaultAn error not otherwise enumerated for this operation, in the same §5.5 envelope as every other refusal. Branch on error.code, never on the HTTP status alone or on error.message — a code this operation has not been seen to throw yet is still safer to route on than a string meant for a human.ErrorResponse

On this page