Overview
DIAN Extensions are specialized UBL extensions for Colombian electronic invoicing requirements. These extensions contain regulatory information required by the Dirección de Impuestos y Aduanas Nacionales (DIAN). The DIAN extension system consists of:- DianExtensions - Main container for DIAN-specific content
- DianExtensionsContent - Core DIAN data including invoice control, software provider, and QR code
- Supporting components - InvoiceControl, InvoiceSource, SoftwareProvider, and AuthorizationProvider
DianExtensions
Main container class that wraps DIAN-specific extension content.Constructor
The DIAN extension content containing invoice control, software provider information, and other regulatory data.
Methods
getDianExtensionsContent()
Retrieve the DIAN extensions content.DianExtensionsContent object containing all DIAN-specific data.
Example:
DianExtensionsContent
Core class containing all DIAN regulatory information.Constructor
Parameters
Invoice authorization and control information including authorization number, period, and authorized invoice range.UBL Field:
sts:InvoiceControlSource identification code for the invoice.UBL Field:
sts:InvoiceSourceSoftware provider and software identification information.UBL Field:
sts:SoftwareProviderSecurity code for the invoicing software.UBL Field:
sts:SoftwareSecurityCodeAuthorization provider identification.UBL Field:
sts:AuthorizationProviderQR code content for the invoice (typically used for validation).UBL Field:
sts:QRCodeMethods
setQRCode()
Set or update the QR code value.QR code content as a string or UdtText instance.
getQRCode()
Retrieve the QR code value.If
true, returns the raw string content. If false, returns the full UdtText object.UdtText object (if raw=false).
Supporting Components
InvoiceControl
Contains invoice authorization and control information.Constructor
Invoice authorization number from DIAN.UBL Field:
sts:InvoiceAuthorizationPeriod during which the authorization is valid.UBL Field:
sts:AuthorizationPeriodRange of authorized invoice numbers.UBL Field:
sts:AuthorizedInvoicesAuthorizedInvoices
Defines the range of authorized invoice numbers.Constructor
Invoice number prefix.UBL Field:
sts:PrefixStarting invoice number in the authorized range.UBL Field:
sts:FromEnding invoice number in the authorized range.UBL Field:
sts:ToInvoiceSource
Source identification for the invoice.Constructor
Identification code for the invoice source.UBL Field:
cbc:IdentificationCodeSoftwareProvider
Software provider and software identification.Constructor
Identifier for the software provider.UBL Field:
sts:ProviderIDIdentifier for the invoicing software.UBL Field:
sts:SoftwareIDAuthorizationProvider
Authorization provider identification.Constructor
Identifier for the authorization provider.UBL Field:
sts:AuthorizationProviderIDUsage Examples
Complete DIAN Extension
Adding DIAN Extensions to an Invoice
Updating QR Code
All DIAN extension parameters are optional in
DianExtensionsContent, but you should include at least the information required by DIAN regulations for your specific use case.Best Practices
- Authorization Information: Always include complete
InvoiceControldata with valid authorization numbers and periods - Software Registration: Ensure your
SoftwareProviderIDs match your DIAN registration - QR Code Generation: Generate QR codes according to DIAN specifications
- Security Codes: Keep
softwareSecurityCodesecure and never expose it in client-side code - Invoice Ranges: Ensure invoice numbers fall within your
AuthorizedInvoicesrange
Related
- UBL Extensions - General UBL extension system
- Invoice Document - Using DIAN extensions in invoices