UBL Format Examples
Explore comprehensive examples of various UBL formats, validation guides, and best practices for e-invoicing standards.
<Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
<cbc:CustomizationID>urn:cen.eu:en16931:2017</cbc:CustomizationID>
<cbc:ID>INVOICE-001</cbc:ID>
<cbc:IssueDate>2024-03-21</cbc:IssueDate>
...
</Invoice>
Peppol BIS 3.0
Peppol BIS 3.0 (Business Interoperability Specifications) is the cornerstone of European e-invoicing, mandated by many governments for B2G transactions. Adopted widely across Europe, particularly in countries like Norway, Sweden, and the Netherlands.
Key Features
- Mandatory for government suppliers in many EU countries
- Built on UBL 2.1 with specific business rules
- Supports automated validation and processing
- Ensures cross-border interoperability
Basic Invoice
Standard Peppol BIS 3.0 invoice with basic elements like supplier, customer, and line items.
Credit Note
Peppol BIS 3.0 credit note with reference to original invoice.
Format Comparison
Features | Peppol BIS 3.0 | ZUGFeRD 2.1 | NLCIUS | UBL 2.1 |
---|---|---|---|---|
Base Standard | UBL 2.1 | UN/CEFACT CII | UBL 2.1 | ISO/IEC 19845 |
Geographic Focus | Pan-European | Germany | Netherlands | Global |
B2G Mandate | ||||
PDF/A Support | ||||
EN 16931 Compliance | ||||
Cross-border Support | Strong | Limited | Limited | Strong |
Industry Focus | All sectors | All sectors | All sectors | Generic |
Validation Tools | Extensive | Good | Good | Limited |
Common Validation Errors & Solutions
Learn about common UBL validation errors and how to fix them.
Missing mandatory elements
BR-01Example: Invoice/cbc:ID is required but missing
Solution: Ensure all mandatory fields are included in your UBL document. Check the specific standard's documentation for required elements.
Invalid date format
BR-02Example: Invoice/cbc:IssueDate format must be YYYY-MM-DD
Solution: Use the correct date format: YYYY-MM-DD for dates and YYYY-MM-DDThh:mm:ss for timestamps.
Invalid currency code
BR-03Example: Invoice/cbc:DocumentCurrencyCode must be ISO 4217 compliant
Solution: Use valid three-letter ISO 4217 currency codes (e.g., EUR, USD, GBP).
Invalid country code
BR-04Example: Invalid country identification code
Solution: Use valid two-letter ISO 3166-1 alpha-2 country codes (e.g., NL, DE, FR).
Tax calculation error
BR-05Example: Tax amount calculation is incorrect
Solution: Verify that tax calculations match the specified rates and bases. Total tax amount must equal sum of tax subtotals.
UBL Best Practices
Follow these best practices to create high-quality UBL documents.
Document Structure
- Use meaningful IDs that can be referenced in business processes
- Include clear document type identification
- Maintain consistent naming conventions
- Use appropriate date formats consistently
- Include relevant reference documents when available
Data Quality
- Validate all codes against official code lists
- Use precise quantity units from UN/ECE rec 20
- Ensure mathematical calculations are correct
- Include detailed party information
- Provide clear item descriptions
Compliance
- Follow standard-specific business rules
- Include all mandatory elements
- Use correct namespace declarations
- Validate against official schemas
- Keep customizations within allowed extensions
Schema Validation & Testing
Tools and resources for validating your UBL documents.
Official Validators
Use standard-specific validation tools:
- Peppol Validator for Peppol BIS 3.0
- ZUGFeRD Validator for ZUGFeRD 2.1
- SI Validation Service for NLCIUS
Testing Approaches
Recommended testing methods:
- Validate XML syntax and structure
- Check business rules compliance
- Verify calculations and totals
- Test with real-world data
- Validate in target systems