The Problem
A business workflow management startup — operating in partnership with a major telecoms provider — was targeting the UK customs clearance market. Manual broker processes were taking hours per declaration: data gathered from multiple sources, validated by hand, submitted to government systems, and then chased for confirmation. For importers and exporters shipping at volume, this was a structural cost and delay embedded into every shipment.
The client needed automation that could turn a commercial invoice into a compliant customs declaration in seconds, 24 hours a day, without broker availability constraints. The complexity: the UK post-Brexit customs estate spans five separate government systems (CDS, CCS-UK, CNS, MCPIPAFFS, DEFRA) with different APIs, data requirements, submission formats, and response behaviours — none of which were designed to interoperate cleanly.
The Constraints
Five-system government API integration with independent failure modes. Each government system has its own authentication, data schema, submission format, and retry behaviour. Integration had to be reliable and monitored — and able to handle partial failures without producing incomplete or non-compliant submissions, or blocking declarations destined for other systems.
Data completeness as a pre-submission gate. Customs declarations require complete, validated commodity classifications, origin declarations, and valuation data. Commercial invoices provided by users are frequently incomplete. The system had to identify and surface data gaps before attempting submission — not surface rejections from government systems after the fact.
24/7 availability as a product requirement. Manual customs clearance is bounded by broker working hours. Removing that constraint was the core value of the platform. Any downtime translates directly into shipment delays, which are costly for time-sensitive freight. High availability was a product requirement, not an infrastructure preference.
Our Approach
We designed the platform as two integrated products: a business process management layer for internal workflow automation, and an automated customs clearance engine for declaration processing.
The clearance engine accepts commercial invoice data via email or API. Incoming data passes through a library of validation rules — commodity classification, valuation, origin, and completeness — before any attempt to generate a declaration. Incomplete submissions are rejected at this gate with specific gap identification, not passed through to government systems.
Declarations are assembled and submitted through dedicated integration adapters, one per government system. Each adapter handles its target system’s authentication, data transformation, and retry logic independently — isolating failures and preventing a rejection from one system from blocking submissions to others.
The architecture was built for high availability from the start: stateless processing services, message queuing to buffer submission volume spikes, and Kubernetes-managed infrastructure with health checks and automated recovery.
The Outcome
- Declarations processed in under 90 seconds — previously hours, approximately 90% reduction per declaration
- 99.9% uptime in production with 24/7 operation and no broker availability constraints
- 100% data compliance across CDS, CCS-UK, CNS, MCPIPAFFS, and DEFRA
- 30%+ reduction in overall administrative overhead for the client’s customers
Team
Engagement: 8 months, 5 engineers (2 backend, 1 integration, 1 infrastructure, 1 QA).
Stack: Golang, MongoDB, REST APIs, GraphQL, NATS, gRPC, Angular, RxJS, Nx, Kubernetes, AWS