XML guide

XML guide

UBL 2.1 Validator

This validator must be used to verify correctness of the XML file. If validation returns errors, they will be listed in the response. In the official specification you can locate the rule or XML element that caused the error.

Open UBL 2.1 Validator

Specification

This is the official Croatian Tax Authority specification for eInvoices and HR extensions. It defines which XML elements are used, where they are located, and whether they are mandatory or optional.

If the validator returns an error, search this specification for the rule or XML element causing the issue.

Open specification (PDF)

XSD Schema

The XSD schema defines the complete technical structure of the UBL 2.1 eInvoice. Most importantly, it defines the exact order of elements in the XML document.

Open XSD schema

XML Examples

This package contains ready-made XML examples for the most common business scenarios, including different VAT rates, VAT-exempt invoices, margin scheme, reverse charge, and combined tax cases. Use these examples to compare the structure and values of your XML with valid documents.

Download XML examples

 

Frequently Asked Questions (FAQ)

What should be entered in Seller Contact ID and Seller Contact Name?

Seller Contact ID must contain the OIB without the country prefix, i.e. exactly 11 digits. The OIB may belong to a natural person who created the invoice or to a legal entity (company), depending on the business case.

Seller Contact Name must contain the name of the person or company to which the specified OIB belongs.

When is tax category O used?

Tax category O is used exclusively when the entire invoice is not subject to VAT.

In this case, the value FRE must be entered in PartyTaxScheme / TaxScheme / ID. In all other cases, when VAT is present on the invoice, the TaxScheme ID must be VAT.

What if the XML contains empty elements or fields?

The XML must not contain empty elements or elements without values. Such elements must be completely removed from the XML document.

If an element is not mandatory and has no value, it must not be generated at all, otherwise the XML will fail validation.

How should EndpointID and PartyIdentificationID be populated?

The population method depends entirely on whether OIB or GLN is used.

If OIB is used:

  • EndpointID contains only the OIB, with the parameter schemeID="9934"
  • PartyIdentificationID is entered in the format 9934:OIB

If GLN is used:

  • EndpointID contains only the GLN value
  • PartyIdentificationID is entered with the parameter schemeID="0088"

Always verify correct population using our official XML examples.

How are pass-through items and special taxes shown on an invoice?

Items such as special hospitality taxes, returnable fees, or customs duties are shown as document-level charges and no KPD code is entered.

If the invoice contains no other items (InvoiceLine), such a charge must be shown as an InvoiceLine and the KPD code closest to the actual nature of the charge must be used.

Which documents do not require KPD codes?

Documents of type credit note (381) and advance invoice (386) do not require KPD codes.

If you are creating a reversal of an advance payment, you may use document ID 386 to avoid entering a KPD code.

How is the margin scheme shown on an invoice?

Under the special VAT margin scheme, VAT is not shown on the invoice itself, but is reported in a separate form submitted independently (this obligation still exists and is not affected by these changes).

The invoice itself is not subject to VAT based on Article 5 of the VAT Act. Accordingly, the eInvoice must contain:

  • Only one invoice line
  • An official exemption note
  • Tax category O
  • The cbc:Name element set to HR:O

If PPOM must also be shown, it is entered as a charge, but it must also be in category O, since only category O may exist on such an invoice.

When is the Copy Indicator used?

The Copy Indicator is used only when correcting an already successfully fiscalized invoice without changing any amounts.

In this case, a new corrected invoice is sent with the exact same invoice number.

If the amount of a fiscalized invoice must be changed, a reversal invoice must be created first, followed by a completely new invoice with a new number.

May the XML contain spaces in numeric field values?

No.

Numeric fields (amounts, taxes, quantities) must not contain spaces, blank characters, or text. Values must be entered in the XML strictly as numbers (e.g. 1500.50).

What if XML errors occur even though everything looks correct?

In that case, make sure to thoroughly check the namespaces defined at the very top of the XML document.

Namespaces must fully comply with the official UBL 2.1 specification.

It is highly recommended to use the namespaces from our official XML examples, as incorrect or outdated namespaces are a common cause of hidden validation errors.

Which KPD code should be entered?

Arbitrary or custom KPD codes must not be used.

One of the officially defined KPD codes from the Croatian Tax Authority code list must be used. If unsure about the exact classification, select the code that best matches the actual nature of the service or goods provided.

When is it necessary to create an HR document extension?

The HR document extension is created only when the invoice contains specific items that are not subject to standard VAT (e.g. exemptions, pass-through items, or special taxes).

If the invoice contains exclusively items that are taxable with standard VAT, the HR extension is not created in the document structure. Always follow the guidelines in our XML examples.

Newsletter subscription