All rules · pint-base · error
ibr-004
An invoice must have an invoice type code, and a credit note must have a credit note type code.
Reviewed
Why this rule exists
The type code and the document element have to agree. A receiver routes on the element and reports on the code, so a mismatch sends the document one way and files it another.
Why it usually happens
- Emitting cbc:InvoiceTypeCode inside a UBL CreditNote element (it must be cbc:CreditNoteTypeCode)
- Omitting the type code entirely and relying on the element name to convey it
How to fix it
Let one branch in your code choose both the document element and its type-code element together.
<CreditNote …><cbc:InvoiceTypeCode>381</cbc:InvoiceTypeCode>
<CreditNote …><cbc:CreditNoteTypeCode>381</cbc:CreditNoteTypeCode>
The official rule
An Invoice MUST have an Invoice type code (ibt-003) / A Credit note MUST have a Credit note Type code (ibt-003).
Verbatim from the published artefact. We execute the official Schematron unmodified, so this is exactly what an Access Point checks.
Schematron test
normalize-space(cbc:InvoiceTypeCode) !='' or normalize-space(cbc:CreditNoteTypeCode) !=''
Applied to nodes matching /ubl:Invoice | /cn:CreditNote
Rule-pack versions
| Rule-pack | Layer | Severity | Applies to |
|---|---|---|---|
| pint-om-1.0.1 | pint-base | error | billing/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice |
| pint-ae-2026.5 | pint-base | error | billing/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice |
| pint-eu-1.1.1 | pint-base | error | billing/creditnote, billing/invoice |
| pint-ae-2026.3 | pint-base | error | billing/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice |
| pint-om-1.0.0 | pint-base | error | billing/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice |
Related rules
Check your own invoice
Paste your XML and see every rule that fires, not just this one. Free, no sign-up, and we never store the document.
Open the validator