Day 6: Fix Invalid TaxCategory or TaxScheme in IRB XML #taxtotal #irbvalidation

SEO Title: Day 6: Fix Invalid TaxCategory or TaxScheme in IRB XML #taxtotal #irbvalidation
Focus Keyphrase: IRB tax category error
Meta Description: Fix IRB e-invoice tax category errors in UBL XML. Ensure correct structure for cac:TaxTotal, cac:TaxSubtotal, and cac:TaxScheme with valid SST settings.

IRBM Tax Error: Invalid TaxCategory or TaxScheme

You may get this IRBM response when submitting your invoice:


"Invalid or missing TaxCategory/TaxScheme in TaxTotal block"

What This Error Means

Your UBL must contain a valid structure like this inside each cac:InvoiceLine and in the summary totals:


<cac:TaxTotal>
  <cbc:TaxAmount>24.00</cbc:TaxAmount>
  <cac:TaxSubtotal>
    <cbc:TaxableAmount>300.00</cbc:TaxableAmount>
    <cbc:TaxAmount>24.00</cbc:TaxAmount>
    <cac:TaxCategory>
      <cbc:Percent>8.00</cbc:Percent>
      <cac:TaxScheme>
        <cbc:ID>SST</cbc:ID>
      </cac:TaxScheme>
    </cac:TaxCategory>
  </cac:TaxSubtotal>
</cac:TaxTotal>

Common Laravel Mistakes

  • ❌ Forgetting to wrap TaxScheme inside TaxCategory
  • ❌ Leaving out cbc:Percent or using the wrong format
  • ❌ Using an invalid TaxScheme ID (IRBM accepts only “SST”)

Fix It in Laravel

Inside each item or total block:


$taxCategory = $doc->createElementNS($cac, 'cac:TaxCategory');
$taxCategory->appendChild($doc->createElementNS($cbc, 'cbc:Percent', number_format($item['tax_percent'], 2, '.', '')));

$taxScheme = $doc->createElementNS($cac, 'cac:TaxScheme');
$taxScheme->appendChild($doc->createElementNS($cbc, 'cbc:ID', 'SST'));
$taxCategory->appendChild($taxScheme);

$taxSubtotal = $doc->createElementNS($cac, 'cac:TaxSubtotal');
$taxSubtotal->appendChild($doc->createElementNS($cbc, 'cbc:TaxableAmount', number_format($lineTotal, 2, '.', '')));
$taxSubtotal->appendChild($doc->createElementNS($cbc, 'cbc:TaxAmount', number_format($taxAmount, 2, '.', '')));
$taxSubtotal->appendChild($taxCategory);

$taxTotal = $doc->createElementNS($cac, 'cac:TaxTotal');
$taxTotal->appendChild($taxSubtotal);
$taxTotal->appendChild($doc->createElementNS($cbc, 'cbc:TaxAmount', number_format($taxAmount, 2, '.', '')));

$invoice->appendChild($taxTotal);

Validation Tips

  • ✔ Use 2 decimal precision for cbc:Percent
  • ✔ Use string “SST” for cbc:ID in TaxScheme
  • ✔ Don’t skip TaxableAmount or TaxAmount in TaxSubtotal

Coming Up in Day 7

We’ll fix the IRBM error: “Invalid InvoiceTypeCode” — which occurs when submitting unknown or unsupported types like “02” or forgetting to include the tag.


Tags: #UBLTax #IRBIntegration #TaxCategoryError #MyInvoisFix #LaravelUBL

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.