errorxsd

cvc-complex-type.4:Required attribute is missing from an invoice element

An XML element in your invoice is missing a required attribute. In Peppol and UBL invoices, this typically means a monetary amount is missing its currencyID attribute, or an identifier is missing its schemeID. The element itself is present, but it lacks required metadata that receiving systems need to process it correctly.

Severity
Fatal
Rule set
xsd
Country
All EU
Fix type
BLOCKED
Category
structural

Engine Classification

Financial or legal field · Modification blocked by policy

Reason: This XML Schema error means a required attribute is missing from an element. Check that all monetary amounts have currencyID and all identifiers have their required schemeID. This must be fixed in the invoicing software that generated the file.

What is cvc-complex-type.4?

cvc-complex-type.4 is a fatal validation rule defined in the xsd specification. It validates the XSD error cvc-complex-type.4: "Attribute 'X' must appear on element 'Y'." This fires when an element's complex type definition requires an attribute that is not present on the element. Most common in Peppol: missing currencyID on cbc:TaxAmount, cbc:LineExtensionAmount, cbc:TaxExclusiveAmount, or missing schemeID on cbc:EndpointID. element in the UBL invoice XML.

When this rule fires, the invoice is non-compliant and will be rejected by Peppol access points and national validation services. The sending system receives a rejection response and the invoice does not reach the buyer.

Target path: XSD error cvc-complex-type.4: "Attribute 'X' must appear on element 'Y'." This fires when an element's complex type definition requires an attribute that is not present on the element. Most common in Peppol: missing currencyID on cbc:TaxAmount, cbc:LineExtensionAmount, cbc:TaxExclusiveAmount, or missing schemeID on cbc:EndpointID.

This error requires manual correction — financial fields are protected by policy.Get API Access

Why This Error Matters

cvc-complex-type.4 is a hard failure. Invoices that trigger this rule are rejected at the access point and never reach the recipient. In Peppol networks, this means your sending system receives an MLR (Message Level Response) with a rejection status. The invoice must be corrected and re-sent, adding delay to your payment cycle.

Validator Behavior

  • ·Causes invoice rejection
  • ·Error returned: cvc-complex-type.4
  • ·Specification: xsd

How to Fix It

1.

Identify the missing attribute

The error message specifies which attribute is missing and on which element. For example: 'Attribute currencyID must appear on element cbc:TaxAmount' means you need to add the currency code.

2.

Check common fixes

For currencyID: add the 3-letter ISO 4217 currency code (EUR, GBP, USD). For schemeID: add the appropriate identifier scheme (e.g., 0088 for GLN, 0184 for PEPPOL).

3.

Update your invoicing software

If attributes are consistently missing, your software's e-invoice export needs to be configured to include them. Contact your vendor with the error details.

4.

Validate before sending

Use Invoice Navigator to catch missing attributes before sending invoices.

XML Example

Generic example based on the rule's target XPath. Your actual XML structure may differ.

Before
<!-- Triggers validation error -->
<XSD error cvc-complex-type.4: "Attribute 'X' must appear on element 'Y'." This fires when an element's complex type definition requires an attribute that is not present on the element. Most common in Peppol: missing currencyID on cbc:TaxAmount, cbc:LineExtensionAmount, cbc:TaxExclusiveAmount, or missing schemeID on cbc:EndpointID.></XSD error cvc-complex-type.4: "Attribute 'X' must appear on element 'Y'." This fires when an element's complex type definition requires an attribute that is not present on the element. Most common in Peppol: missing currencyID on cbc:TaxAmount, cbc:LineExtensionAmount, cbc:TaxExclusiveAmount, or missing schemeID on cbc:EndpointID.>
After
<!-- Corrected -->
<XSD error cvc-complex-type.4: "Attribute 'X' must appear on element 'Y'." This fires when an element's complex type definition requires an attribute that is not present on the element. Most common in Peppol: missing currencyID on cbc:TaxAmount, cbc:LineExtensionAmount, cbc:TaxExclusiveAmount, or missing schemeID on cbc:EndpointID.>VALID_VALUE</XSD error cvc-complex-type.4: "Attribute 'X' must appear on element 'Y'." This fires when an element's complex type definition requires an attribute that is not present on the element. Most common in Peppol: missing currencyID on cbc:TaxAmount, cbc:LineExtensionAmount, cbc:TaxExclusiveAmount, or missing schemeID on cbc:EndpointID.>

Technical Reference

XPathXSD error cvc-complex-type.4: "Attribute 'X' must appear on element 'Y'." This fires when an element's complex type definition requires an attribute that is not present on the element. Most common in Peppol: missing currencyID on cbc:TaxAmount, cbc:LineExtensionAmount, cbc:TaxExclusiveAmount, or missing schemeID on cbc:EndpointID.
Specxsd

Common Causes

  • ·Amount elements (TaxAmount, LineExtensionAmount) missing currencyID attribute
  • ·EndpointID or PartyIdentification missing schemeID attribute
  • ·UK invoicing software not generating all required XML attributes
  • ·ERP export template missing attribute mappings

Seeing this in production? The API handles cvc-complex-type.4 automatically. See the fix response →

Commonly Seen In

Invoicing software with incomplete XML attribute supportCustom-built invoice generatorsERP systems with outdated Peppol export

Related Errors

Last updated: 12 March 2026

Share this guide:

Detect cvc-complex-type.4 Before Submission

This error involves a financial or legal field that cannot be auto-modified. The compliance engine flags it immediately with a clear diagnosis so your team can fix it at the source.