Skip to main content
The CorrectionReason enum represents all correction reasons supported by the FacturaE 3.2.2 XSD specification. These codes are used when issuing corrective or credit invoices to specify why the original invoice is being corrected.

Enum Cases

The following table lists all 22 correction reasons available:
CaseCodeDescription
InvoiceNumber01Invoice number correction
InvoiceSeries02Invoice series correction
IssueDate03Issue date correction
IssuerName04Issuer name/business name correction
RecipientName05Recipient name/business name correction
IssuerTaxId06Issuer tax identification correction
RecipientTaxId07Recipient tax identification correction
IssuerAddress08Issuer address correction
RecipientAddress09Recipient address correction
TransactionDetail10Transaction detail/description correction
TaxRate11Tax rate correction
TaxAmount12Tax amount correction
TaxPeriod13Tax period correction
InvoiceClass14Invoice class/type correction
LegalLiterals15Legal text/literals correction
TaxableBase16Taxable base correction
OutputTaxCalculation80Output tax calculation error
WithheldTaxCalculation81Withheld tax calculation error
BaseModifiedReturns82Base modified due to returns/refunds
BaseModifiedDiscounts83Base modified due to discounts
BaseModifiedCourtOrder84Base modified by court/administrative order
BaseModifiedInsolvency85Base modified due to insolvency proceedings

Methods

description()

Returns the official Spanish description for each correction reason:
public function description(): string

Usage Examples

Correcting Invoice Amount

use PhpFacturae\Enums\CorrectionReason;
use PhpFacturae\Enums\CorrectionMethod;

$creditNote = new Invoice();
$creditNote->setIsCorrective(true);
$creditNote->setCorrectionReason(CorrectionReason::TaxableBase);
$creditNote->setCorrectionMethod(CorrectionMethod::Differences);
$creditNote->addCorrectedInvoice(
    series: 'A',
    number: '12345',
    issueDate: new DateTime('2024-01-15')
);

Correcting Tax Rate Error

use PhpFacturae\Enums\CorrectionReason;
use PhpFacturae\Enums\CorrectionMethod;

$creditNote = new Invoice();
$creditNote->setIsCorrective(true);
$creditNote->setCorrectionReason(CorrectionReason::TaxRate);
$creditNote->setCorrectionMethod(CorrectionMethod::FullReplacement);
$creditNote->addCorrectedInvoice('A', '12345', new DateTime('2024-01-15'));

// Get the Spanish description
echo CorrectionReason::TaxRate->description();
// Output: "Porcentaje impositivo a aplicar"

Correcting Customer Information

use PhpFacturae\Enums\CorrectionReason;
use PhpFacturae\Enums\CorrectionMethod;

$creditNote = new Invoice();
$creditNote->setIsCorrective(true);
$creditNote->setCorrectionReason(CorrectionReason::RecipientTaxId);
$creditNote->setCorrectionMethod(CorrectionMethod::FullReplacement);
$creditNote->addCorrectedInvoice('A', '12345', new DateTime('2024-01-15'));

Product Return/Refund

use PhpFacturae\Enums\CorrectionReason;
use PhpFacturae\Enums\CorrectionMethod;

$creditNote = new Invoice();
$creditNote->setIsCorrective(true);
$creditNote->setCorrectionReason(CorrectionReason::BaseModifiedReturns);
$creditNote->setCorrectionMethod(CorrectionMethod::Differences);
$creditNote->addCorrectedInvoice('A', '12345', new DateTime('2024-01-15'));

Volume Discount Applied

use PhpFacturae\Enums\CorrectionReason;
use PhpFacturae\Enums\CorrectionMethod;

$creditNote = new Invoice();
$creditNote->setIsCorrective(true);
$creditNote->setCorrectionReason(CorrectionReason::BaseModifiedDiscounts);
$creditNote->setCorrectionMethod(CorrectionMethod::VolumeDiscount);
$creditNote->addCorrectedInvoice('A', '12345', new DateTime('2024-01-15'));

When to Use Each Reason

Administrative Corrections (01-16)

Use these codes when correcting clerical or administrative errors:
  • InvoiceNumber/InvoiceSeries - Wrong invoice numbering
  • IssueDate - Incorrect date
  • IssuerName/RecipientName - Misspelled names
  • IssuerTaxId/RecipientTaxId - Wrong tax IDs (NIF/CIF)
  • IssuerAddress/RecipientAddress - Wrong addresses
  • TransactionDetail - Incorrect descriptions
  • InvoiceClass - Wrong invoice type
  • LegalLiterals - Missing or incorrect legal text

Tax Corrections (11-12, 16, 80-81)

Use these codes for tax-related errors:
  • TaxRate - Applied wrong tax percentage
  • TaxAmount - Tax calculation error
  • TaxableBase - Incorrect base amount
  • OutputTaxCalculation - Error in VAT calculation
  • WithheldTaxCalculation - Error in withholding calculation

Base Modifications (82-85)

Use these codes when the invoice amount changes due to external circumstances:
  • BaseModifiedReturns - Customer returned goods
  • BaseModifiedDiscounts - Volume or prompt payment discount
  • BaseModifiedCourtOrder - Court or tax authority decision
  • BaseModifiedInsolvency - Customer insolvency proceedings

Notes

  • All corrective invoices must specify a correction reason
  • The reason code appears in the XML output’s ReasonCode field
  • Multiple corrected invoices can reference the same reason
  • The description() method returns official Spanish text for compliance
  • Correction reasons 80-85 typically require supporting documentation

See Also

Build docs developers (and LLMs) love