OpenChainGraph Suite · OCG v0.8.7 · E-Invoicing · Cluster ㉑

E-Invoice Validation Pipeline

Gated four-step e-invoice validation pipeline. Checks a supplied e-invoice extract against version-pinned Factur-X, XRechnung, PINT-AE, or MyInvois format rules, recomputes VAT arithmetic against the document-asserted amounts, routes the transaction to its applicable jurisdiction mandate, and composes a hash-anchored transmission receipt. Exits immediately on a format-conformance failure or a VAT-arithmetic mismatch, so the receipt is only ever built for a document that passed both gates.

OpenChainGraph · 4 Steps compliance mandate · §21.4 Gates Hash-Anchored §4 chain_depth:4 Client-Side · Zero PII
Not legal or tax advice. The pipeline proves the transmitted document was format-validated and its VAT arithmetic checked; it does not certify tax compliance, legal validity, or clearance-platform acceptance. Consult qualified counsel before relying on any result for invoice production decisions.
⚡ §21.4 Decision Gates active: Step 1 exits chain on structural_completeness=false; Step 2 exits on consistent=false. Skipped steps appear as skipped_by_gate in the run artifact.
Chain Topology (§21.4 gated) — Format Validator [GATE] → VAT Verifier [GATE] → Mandate Router → Transmission Receipt
§4 Execution Hash · Chain Definition Anchor
execution_hash:computing…
Chain Stages · 4 Steps · 2 Decision Gates (§21.4)
1 ROOT / GATE node §21.4 gate
E-Invoice Format Validator art-293-einvoice-format-validator
structural_completeness feeds Stage 2 VAT verification; a format failure stops the chain
△ Gate: if /structural_completeness == false → END  |  else → Step 2
MCP Call · validate_einvoice_format
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "validate_einvoice_format",
    "arguments": {
      "document": {
        "format": "xrechnung",
        "fields": {"invoice_number": "INV-1", "invoice_date": "2026-09-15", "currency_code": "EUR", "seller_name": "Acme GmbH", "seller_vat_id": "DE123456789", "buyer_name": "Buyer SAS", "leitweg_id": "04011000-12345-67"},
        "line_items": [{"line_id": 1, "net_amount": 1000, "vat_category": "S", "vat_rate_pct": 19}]
      }
    }
  },
  "id": 1
}
2 GATE node §21.4 gate
E-Invoice VAT Calculation Verifier art-294-einvoice-vat-calc-verifier
consistent feeds Stage 3 mandate routing; a VAT-arithmetic mismatch stops the chain
△ Gate: if /consistent == false → END  |  else → Step 3
MCP Call · verify_einvoice_vat_calc
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "verify_einvoice_vat_calc",
    "arguments": {
      "document": {
        "line_items": [{"line_id": 1, "net_amount": 1000, "vat_category": "S", "vat_rate_pct": 19}],
        "tax_subtotals_asserted": [{"vat_category": "S", "vat_rate_pct": 19, "taxable_amount": 1000, "tax_amount": 190}],
        "grand_total_asserted": 1190,
        "tax_total_asserted": 190
      },
      "rounding": {"method": "half-up", "granularity": "per-line"}
    }
  },
  "id": 2
}
3 STEP node
E-Invoice Jurisdiction Mandate Router art-295-einvoice-jurisdiction-mandate-router
routed_mandate feeds the terminal transmission receipt
MCP Call · route_einvoice_jurisdiction_mandate
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "route_einvoice_jurisdiction_mandate",
    "arguments": {
      "supplier_country": "DE",
      "buyer_country": "FR",
      "transaction_type": "B2B",
      "transaction_date": "2026-09-15"
    }
  },
  "id": 3
}
4 TERMINAL node
E-Invoice Transmission Receipt Builder art-296-einvoice-transmission-receipt-builder
Composes the hash-anchored transmission receipt — final stage (only reached if gates 1 and 2 pass)
MCP Call · build_einvoice_transmission_receipt
{
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "name": "build_einvoice_transmission_receipt",
    "arguments": {
      "document": {"document_sha256": "", "format": "xrechnung"},
      "format_validation": {"structural_completeness": true},
      "vat_verification": {"consistent": true},
      "routed_mandate": {"regime_country": "FR", "applicable_format": "factur-x_or_ubl", "mandatory_from": "2026-09-01", "phase_status": "mandatory", "transmission_channel": "PDP"}
    }
  },
  "id": 4
}
Export Chain Artifact
Download the §4 chain definition artifact (hash-anchored JSON). The artifact encodes the complete chain definition including gate rules. Available after hash computation.