Facturación
Register of Colombian electronic documents and import of DIAN documents by CUFE.
Raw Markdown for agents: facturacion.md. MCP: read_docs("facturacion").
Facturación keeps a register of the Colombian electronic documents (invoices, credit notes, debit notes and support documents) issued through the Facturación integration, with DIAN status, legal status and CUFE/CUDE. It also imports the XML of documents a company issued or received, by CUFE, through Soluciones Alegra S.A.S as technology provider.
Operations:
facturacion.documents.list: the documents of a Space, newest first; filter bykind,status,legal_status,prefix,counterparty_identification,dian_uuidor creation date, and page withcursor.facturacion.documents.get: one document with the complete provider and government response, the files archived in the Space and the CUFE/CUDE.- DIAN document lists and their XMLs: DIAN sources sync them on a schedule
(
dian.sources.*,dian.sync.run); the single steps aredian.token.request,dian.excel.exportanddian.xml.import. Read read_docs("dian").
Importing documents without habilitation:
- Needs a Facturación connection whose owner confirmed in the app (connection,
DIAN tab) that Soluciones Alegra S.A.S is the company's technology provider,
or a finished habilitation, plus a grant of the Space that allows
integrations.facturacion.dian.query. Only the connection owner starts it. - XMLs land in
DIAN/EmitidosandDIAN/Recibidosunderfolder_idor the Space root. CUFEs already imported into the Space are skipped, so a new run over the same range only fetches what is missing. Events (acuses, application responses) and rows of other NITs are skipped. - The import runs in the background at up to 60 documents per minute; poll
dian.runs.get.resultcountsimported,no_xml,failedandpending.NO_XMLmeans the DIAN returned no XML for that CUFE, usually because Soluciones Alegra S.A.S is not the technology provider of that NIT. - Every fetch is billed (3 credits), also when the result is
NO_XML.
Rules:
facturacion.documents.*only read. Documents are issued through the integration operationsintegrations.facturacion.*.create(read the read_docs("integrations")); each successful call is registered here automatically. Issuing needs the finished habilitation.- A credit or debit note references its invoice by CUFE; read it with
facturacion.documents.getfirst.