The challenge
A cross-border e-commerce marketplace receives invoices from vendors across several countries and tax regimes. They arrive in English and Arabic and a long tail of other languages, and three in four carry more than one language — frequently two scripts on the same page, with the vendor's details in one and the tax detail in the other. Layouts, currencies, VAT treatment and registration formats all differ by market. A template per vendor does not scale across that spread, and a translation step before extraction loses exactly the structure extraction depends on. The practical consequence was that a shared service centre worked from documents rather than from data, and every market had its own way of being read.
What we built
A pipeline that collects invoices off a secure drop on a schedule, tags the languages present on each document including mixed-script pages, and classifies every document into one of five canonical types before any extraction begins. Only then is the full field set extracted, against the customer's own processing rules rather than a generic per-vendor template. Currency is inferred from the document, amounts are standardised, and tax rates are derived from the values and cross-checked against the rate printed on the page. Every default applied and every exception raised is logged with the document it came from, so a reviewer sees what the pipeline decided as well as what it read.
The result
A shared service centre works from one structure instead of one per market. An invoice in Arabic, an invoice in English and an invoice carrying both produce the same record, with the same fields, in the same currency convention. Because classification runs before extraction, a credit note is never read as an invoice and quietly netted the wrong way. Where the derived tax rate disagrees with the rate printed on the document, the pair is raised as an exception rather than resolved silently in favour of either. Ten currencies and several registration formats are handled inside one flow, with the market-specific rules held as configuration.

