← Back to docs

Inbound Invoice Processing

Inbound Invoice Processing

When an email arrives at your Postscale-managed domain, the inbound processor automatically scans for embedded e-invoices. If a structured invoice is detected — as an XML attachment or embedded ZUGFeRD PDF — the invoice data is extracted and delivered to your webhook alongside the standard inbound email payload.

How It Works

  1. Email arrives at your domain via Postscale's inbound pipeline
  2. Attachment scan checks for XML files matching UBL/CII schemas and PDFs with embedded ZUGFeRD data
  3. Validation runs the detected invoice through EN 16931 / XRechnung rules
  4. Webhook delivery includes the original email payload plus an invoice object with structured data

Enabling Invoice Detection

Invoice detection is enabled per-domain in your dashboard:

  1. Go to Dashboard > Domains > [your domain]
  2. Under Inbound Settings, toggle E-Invoice Detection on
  3. Configure your webhook URL if not already set

No API changes are needed — the invoice data is appended to your existing inbound webhook payload.

Webhook Payload

When an e-invoice is detected, your inbound webhook receives an additional invoice field:

{
  "event": "inbound.received",
  "email": {
    "from": "supplier@example.de",
    "to": ["billing@yourdomain.com"],
    "subject": "Invoice #2026-0042",
    "attachments": [
      {
        "filename": "invoice-2026-0042.xml",
        "content_type": "application/xml",
        "size": 8432
      }
    ]
  },
  "invoice": {
    "detected": true,
    "format": "xrechnung-ubl",
    "valid": true,
    "data": {
      "invoice_number": "2026-0042",
      "issue_date": "2026-03-15",
      "due_date": "2026-04-14",
      "currency": "EUR",
      "total_net": "1250.00",
      "total_tax": "237.50",
      "total_gross": "1487.50",
      "seller": {
        "name": "Supplier GmbH",
        "tax_id": "DE123456789",
        "address": "Musterstr. 1, 10115 Berlin, DE"
      },
      "buyer": {
        "name": "Your Company GmbH",
        "leitweg_id": "991-12345-67"
      },
      "line_items": [
        {
          "description": "Consulting services Q1 2026",
          "quantity": 50,
          "unit": "HUR",
          "unit_price": "25.00",
          "net_amount": "1250.00",
          "tax_rate": "19.00"
        }
      ]
    },
    "validation": {
      "errors": [],
      "warnings": []
    }
  }
}

Supported Formats

FormatDetection Method
XRechnung (UBL 2.1)XML attachment with urn:oasis:names:specification:ubl:schema:xsd:Invoice-2 namespace
XRechnung (CII)XML attachment with urn:un:unece:uncefact:data:standard:CrossIndustryInvoice namespace
ZUGFeRD / Factur-XPDF attachment with embedded XML in XMP metadata

Non-Invoice Emails

If no e-invoice is detected, the webhook payload is delivered normally without the invoice field. Your existing inbound processing logic is unaffected.