Skip to content

Cross-Subsidiary ERP Document Transfer

Saves 10–15 hours per week by automating cross-subsidiary ERP document transfer and synchronization — with end-to-end data integrity checks, custom business logic, and rollback on error.

Part of the same FastAPI portal as the email dispatch service — shared session manager, logging, dashboard infrastructure, and admin UI.

Python FastAPI SQL Server REST API ERP Integration

The Problem

The company runs multiple separate ERP instances — one domestic, several international. Every purchase order, delivery note, invoice, repair or return-goods quote that crossed subsidiary boundaries had to be manually re-entered: create the document on one end, email it to the receiving subsidiary, then re-type every header field and line item into the target system. To verify correctness, staff had to compare source and target documents field by field. With dozens of cross-border documents per day, this consumed hours of staff time and introduced copy-paste errors — wrong amounts, missed positions, mismatched mappings.

Find out which of your manual processes are ready for automation.

Take the 2-minute process audit

The Approach

Pipeline core

Pooled sessions
To avoid managing separate logins per ERP instance, a session manager maintains persistent authenticated connections to all ERP REST APIs with automatic keepalive, relogin on token expiry, and idle suspension.
Document transfer
The pipeline fetches the source document and positions, applies field mapping, POSTs to the target ERP, and verifies every field against the source. Any mismatch triggers an automatic rollback.
Document conversion
Because each document crossing a subsidiary boundary requires a different target document type with different field semantics, the pipeline creates the target document and links each position back to its predecessor through the ERP's document-chain. This keeps the native order processing chain intact across systems and prevents double-processing — the ERP's own reporting can trace every position back to its origin. The same base pipeline handles all conversion types through type-specific mapping modules.
Bidirectional synchronization
Because return-goods quotes can be modified on either side after initial transfer, they are synchronized bidirectionally between headquarters and subsidiaries. Positions are matched by unique identifiers, quantities and prices are diffed, and any mismatch triggers a revert of only the changes made in that sync run.

Automation and triggers

Cron-driven auto-transfer
To remove the human from routine transfers entirely, a background scheduler picks up flagged documents on a cron schedule and runs them through the same pipeline as manual transfers.
One-click trigger
For ad-hoc transfers that don't justify opening the web portal, a PowerShell script embedded in the ERP desktop client lets staff transfer and optionally email or print a document in one click without leaving their ERP window.

Observability and quality control

Supervisor dashboard
Automated checks flag inconsistencies and surface them in a review dashboard. Staff can inspect each document line by line, add comments, and revert any transfer — with bidirectional stamp cleanup in both source and target ERP.
Operations dashboard
A real-time monitoring dashboard displays KPI cards, daily activity charts, and per-route distribution breakdowns. Data older than 90 days rolls up from detail rows into pre-aggregated monthly statistics, so the same view covers daily operations and long-term trends.
Comprehensive logging
Every layer of the pipeline writes to its own dedicated log table. High-frequency entries are buffered and flushed asynchronously. Sensitive fields are sanitized before storage. A 90-day retention policy rolls detail rows into monthly aggregates — the database stays small but the statistics survive for the dashboard.

Extensibility

Modularity and settings
To make adding a new transfer route a config change rather than a code change, each route is a self-contained module with its own field mappings, business logic, cron schedule, and role-based permissions — all editable at runtime through a central settings interface. Per-route adjustments to validation rules or scheduling take effect immediately without redeploying the pipeline.

Architecture

The Result

Time saved

~10–15 hours/week across all subsidiaries

Error reduction

Copy-paste errors eliminated — every transfer is verified field by field with automatic rollback on mismatch

Scale

10+ active transfer routes, 30+ active users, thousands of documents transferred monthly

Reliability

~600 automated tests, audited for code quality, performance, and security

Adoption

Production since March 2026, adopted across all subsidiaries