errorcountryPRTubl-2.1

PT-R-002:AT document codes required

Fix: Use AT-specific document type codes. Provide the required value in the free validator.

Portuguese invoices need AT (Autoridade Tributaria) document codes.

Severity
Fatal
Rule set
ubl-2.1
Country
PRT
Fix type
INPUT REQUIRED

Engine Classification

Business data required · Explicit input workflow · No assumptions made

Required input: AT Document Type Code

What is PT-R-002?

PT-R-002 is a fatal validation rule defined in the ubl-2.1 specification (PRT national rules). It validates the InvoiceTypeCode and extensions element in the UBL invoice XML.

When this rule fires, the invoice is rejected by Peppol access points and never reaches the buyer.

Target path: XPath: //cbc:InvoiceTypeCode and extensions

Why This Error Matters

AT requires specific document classification codes.

PT-R-002 is a hard failure — the invoice must be corrected and re-sent before it can reach the recipient.

Validator Behavior

  • ·Causes invoice rejection
  • ·Fails UBL schema validation
  • ·Error returned: PT-R-002
  • ·Specification: ubl-2.1

How to Fix It

1.

Map document type

FT=Fatura, NC=Nota de Credito, etc.

2.

Add AT code

In DocumentTypeCode or extension

XML Example

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

Before
<!-- Missing or empty element triggers cbc:InvoiceTypeCode and extensions error -->
<cbc:InvoiceTypeCode and extensions></cbc:InvoiceTypeCode and extensions>
After
<!-- Provide the required value -->
<cbc:InvoiceTypeCode and extensions>VALID_VALUE</cbc:InvoiceTypeCode and extensions>

Technical Reference

XPathXPath: //cbc:InvoiceTypeCode and extensions
Specubl-2.1

Common Causes

  • ·Using international codes only
  • ·Missing AT code

Seeing this in production? The API handles PT-R-002 automatically. See the fix response →

Frequently Asked Questions

Portuguese invoices need AT (Autoridade Tributaria) document codes.

Use AT-specific document type codes. Invoice Navigator detects this error and prompts for the required business data before applying a safe fix.

Yes, PT-R-002 is a critical error that will cause invoice rejection. It must be fixed before submission.

Related Errors

Related Content

Last updated: 3 March 2026

Share this guide:

Validate your invoice

Drop your XML here to check for PT-R-002

Fix PT-R-002 with guided input

Upload your invoice and we'll ask for the missing data, then apply a safe, auditable fix.