Run HMRC's 3-way test before the supervising officer does.
A customs warehouse keeps its authorisation on one thing: the stock account agreeing with the CDS-declared removals and with the goods actually on the floor. This runs those three against each other and returns every break — undeclared removal, quantity mismatch, negative balance, orphan physical — ranked by severity and by the duty riding on it.
Ledger in. Breaks out.
Paste your movement ledger and your stock-take — a WMS export, or the example below. The engine rolls entries minus removals to an expected on-hand per rotation, carries the suspended duty and import VAT with it, and compares that to the count on the floor and to whether each removal actually has a CDS declaration reference against it.
Nothing is stored — the ledger is posted to the reconciliation endpoint and the result returned. Stateless.
What the engine is actually looking for — and why each one hurts.
Undeclared removal
Goods left the warehouse on an out movement with no CDS removal declaration reference against it. Duty may have escaped. Duty at risk = the duty carried on that removal row.
Negative balance
More units removed from a rotation than were ever entered. The stock account is over-drawn — the arithmetic itself doesn't hold, which is the fastest way to lose credibility in an audit.
Quantity mismatch
Physical count differs from the ledger-expected on-hand. Duty at risk is estimated from the per-unit duty on that rotation's entries — indicative, and it points you at which rotation to recount.
Orphan physical
Stock counted on the floor for a rotation with no entry in the stock account at all. No duty figure can be attributed to it, so duty at risk shows as £0 — that is a gap in the evidence, not a clean result.