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

How to fix it

Let one branch in your code choose both the document element and its type-code element together.

Wrong
<CreditNote …><cbc:InvoiceTypeCode>381</cbc:InvoiceTypeCode>
Right
<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-packLayerSeverityApplies to
pint-om-1.0.1pint-baseerrorbilling/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice
pint-ae-2026.5pint-baseerrorbilling/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice
pint-eu-1.1.1pint-baseerrorbilling/creditnote, billing/invoice
pint-ae-2026.3pint-baseerrorbilling/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice
pint-om-1.0.0pint-baseerrorbilling/creditnote, billing/invoice, self-billing/creditnote, self-billing/invoice

Related rules

ibr-cl-01 · ibr-191-ae

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
ibr-004 — An invoice must have an invoice type code, and a credit not… · PINT Probe