How to import DIAN XML invoices
Automatically import your electronic invoices from the DIAN. Extract data, review and confirm without manual entry.
Updated: April 5, 2026
contable.io can import electronic XML invoices directly from the DIAN, automatically extracting supplier, items, taxes and totals. This eliminates manual entry and reduces errors.
Before you start
You need:
- Digital certificate of your company registered with the DIAN.
- DIAN access credentials configured in contable.io.
- Active internet connection.
Configure the DIAN connection
- Go to Settings → DIAN integration.
- Upload your digital certificate (.p12 or .pfx) and enter its password.
- Click Test connection.
Your certificate and password are stored encrypted. contable.io never exposes them in plain text.
Import invoices
- Go to Purchases → Import from DIAN.
- Click Query invoices to fetch electronic invoices in your DIAN inbox. Filter by date range, supplier or status.
- Select the invoices to import. Already-imported invoices are flagged to avoid duplicates.
- Review the data extracted from each XML: supplier, items, taxes, totals, CUFE.
- Click Import selected. Invoices are created as
provisionalin the Purchases module for review.
2026 enhancements
Several major improvements landed in the importer:
Receiver fiscal profile
contable.io now auto-detects your fiscal profile (regular regime, simplified, large taxpayer, self-withholder) and applies the corresponding withholdings on import. Previously this had to be set manually per invoice.
VAT as added cost
When a product is flagged “non-deductible VAT” (consumption, representation expenses, etc.), the system now applies VAT as added cost automatically instead of routing to the deductible VAT account. No more manual adjustments per import.
Smart withholding suggestions
For each line of the imported invoice, contable.io now suggests applicable withholdings (ReteFuente, ReteICA, ReteIVA) based on:
- The item concept.
- The supplier’s fiscal profile (extracted from the RUT when available).
- Your fiscal profile as receiver.
Suggestions come pre-checked — you only need to confirm.
ML classifier on 6-digit codes
DIAN invoices include UNSPSC product codes. contable.io now uses a machine learning model trained on thousands of Colombian invoices to suggest the correct product in your catalog from the 6-digit code, even if the item name is ambiguous.
Automatic contact lookup (GetAcquirer)
When importing an invoice from a new supplier, contable.io now calls the DIAN GetAcquirer endpoint to fetch:
- Official business name.
- Fiscal regime.
- Person type.
- CIIU codes.
Full contacts are created without asking the supplier for their RUT.
Numbering ranges (GetNumberingRange)
The system validates that the imported invoice number falls within the supplier’s DIAN-authorized numbering range, alerting you if invoices fall outside (possible fake invoice or error).
Tip handling
Voluntary tips on invoices (common in restaurants and services) are automatically separated from the taxable subtotal and posted to a dedicated account.
Line-level discounts
Discounts used to apply only to the invoice total. The importer now respects per-line discounts from the DIAN XML, preserving effective unit prices for cost and margin reports.
What gets extracted from the XML
| Data | Field in contable.io |
|---|---|
| Supplier NIT | Contact (looked up or created) |
| Invoice number | Supplier invoice number |
| Issue date | Invoice date |
| Due date | Due date |
| Item description | Line item name |
| Quantity and price | Quantity and unit price |
| Item VAT | Deductible VAT |
| Withholdings | ReteFuente, ReteICA, ReteIVA |
| CUFE | Invoice external reference |
FAQ
What if the supplier from the XML doesn’t exist in my system?
contable.io shows the supplier data from the XML and offers to create them automatically. You only confirm the data is correct.
Can I import the same invoice twice?
No. The system detects duplicates by CUFE.
What if the XML has errors or missing data?
The invoice is created as provisional with alerts for fields needing manual review.
Can I import DIAN credit notes?
Yes, they’re imported the same way and created as purchase credit notes, linked to the original invoice when the XML includes that reference.