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.

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
Supported
Not Supported

Common Validation Errors & Solutions

Learn about common UBL validation errors and how to fix them.

Missing mandatory elements

BR-01

Example: 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-02

Example: 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-03

Example: 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-04

Example: 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-05

Example: 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

Validation Steps

1 Validate XML well-formedness
2 Check against XSD schema
3 Verify business rules
4 Test with target systems
5 Validate calculations
6 Check code list values
7 Verify party identifiers