SAP S/4HANA and SAP ERP e-invoicing integration
Map billing documents, business partners, tax codes and output management to country profiles; separate source mapping from provider transport.
Recommended architecture
- 1Canonical invoice data model
Extract stable business concepts from SAP S/4HANA and SAP ERP without losing source identifiers or accounting references.
- 2Country/profile adapter
Map source values to a neutral model so new countries do not require rewriting the accounting core.
- 3Versioned validation stage
Apply versioned country/profile transformations and deterministic validation before transport.
- 4Provider or authority transport adapter
Keep authentication, signing, endpoint behavior and retries in isolated provider adapters.
- 5Response, retry and audit store
Persist source hashes, requests, responses, state transitions and corrections as one audit chain.
Minimum canonical invoice model
| Domain | Fields to preserve | Why it matters |
|---|---|---|
| Document | type, number, issue/tax/due dates, currency, references | Profile selection, duplicate prevention and lifecycle |
| Parties | legal name, address, tax IDs, endpoints, buyer reference | Identity, routing and tax responsibility |
| Lines | quantity, unit, price, allowances, item IDs, tax category | Semantic validation and accurate totals |
| Tax | category, rate, exemption reason, taxable base, amount | Country business rules and reporting |
| Payment | means, account, remittance reference, terms | Settlement and recipient automation |
| Evidence | source hash, schema release, request IDs, receipts, status history | Auditability and support resolution |
Backend controls
Use a stable business key and provider request ID so retries never create accidental duplicates.
Every output must record the target profile, schema, rule and code-list release.
Separate user requests from slow or unavailable authority endpoints and apply controlled retry policies.
Store normalized states for application logic while preserving the original signed or authoritative response.
Keep certificates, API keys and signing material outside the browser and rotate them through a managed secret store.
Testing matrix
- Valid invoice, credit note and cancellation scenarios
- Missing identifiers, invalid tax category and rounding edge cases
- Schema-version transition and deprecated endpoint tests
- Duplicate, timeout, retry, webhook replay and out-of-order status events
- Cross-border, exempt, reverse-charge and multi-rate tax cases
- Human-readable rendering compared with the original accounting document
Tools for SAP S/4HANA and SAP ERP
E-invoice API payload checker
Parse JSON payloads and check common invoice, party, line and total fields before sandbox submission.
CSV to e-invoice field mapper
Map spreadsheet or CSV column names to canonical invoice business terms and export a reusable mapping.
Invoice status webhook payload builder
Build test webhook events with correlation, status, timestamp and signature-header guidance.
Validation stack builder
Build the ordered syntax, semantic, national, security and authority checks needed for a selected country.