Idempotency-Key header on every create and send.
- Keys belong to the tenant and the stage of the API key. A sandbox key and a test key of the same tenant never see each other’s keys.
- The same key with the same request (method, path and body) replays the stored answer with
Idempotent-Replayed: true, and nothing is done again. The same key with a different request answers422 idempotency_key_reused; while the first request is still running,409 idempotency_in_progress. - Only a
2xxor a422that breaks an invoice rule is stored. A5xx, or a403,404or409you can fix by configuring the tenant, releases the key: retry with the same key. - A key is kept 24 hours from its first use. After that it is forgotten and the same key starts a new request.
reference and ask Cufea whether it exists:
items is definitive: the document was never created and the create can be sent
again. A create that reuses a reference answers 409 reference_conflict.
POST /v1/invoices/{document_id}/send (and the note send route) is safe to repeat at any
time, with or without a key: at most one send is queued per document, and the answer says
queued, pending (a send already queued or running) or sent (the DIAN already has it).