Case Study
TRADACOMS EDI Invoicing
Automated invoice generation in the UK retail supply chain standard — transmitted via Lobster/TrueCommerce to major builders' merchants.
The Problem
Miranda supplies building and fencing products to Huws Gray, one of the UK's largest builders' merchants (including the Buildbase division). Huws Gray requires all invoices in TRADACOMS EDI format — the UK retail supply chain standard that has been in use since the 1980s.
This is not a modern API. TRADACOMS is a flat-file EDI format with strict segment ordering, COBOL-style implied decimal encoding for monetary values, GS1 Global Location Numbers for party identification, and zero tolerance for formatting errors. A malformed file is rejected, and the supplier does not get paid.
Files are transmitted through Lobster/TrueCommerce, an enterprise EDI Value Added Network.
What We Built
A Go library that takes structured invoice data and generates fully compliant TRADACOMS 0700 INVOICES flat files:
Sales Data → Go Structs → TRADACOMS EDI Flat File → Lobster/TrueCommerce → Huws Gray
The library handles the full invoice lifecycle in strict segment order:
- STX — Transmission header with sender/receiver GLN codes
- Supplier and customer identification — GLNs, names, addresses, VAT numbers
- Invoice lines — EAN-13 product barcodes, quantities, unit costs, VAT bands, MSRPs
- Settlement terms — Payment discount percentages and days
- VAT summaries — Per-band sub-totals at invoice and file level
- File totals — Grand totals before and after VAT and settlement discount
- END — End of transmission
Technical Challenges
Implied decimal encoding. TRADACOMS represents monetary values as integers where the decimal point position is defined by a COBOL-style format string like 9(10)V9(4) (10 integer digits, 4 fractional digits). We use precise decimal arithmetic to avoid floating-point errors on invoice amounts.
Character escaping. Four reserved characters (=, :, +, ') must be escaped with ? prefix. We use Go reflection to recursively walk all string fields in the request struct.
GLN and EAN-13 identification. Supplier, customer, and delivery locations identified by GS1 Global Location Numbers. Products identified by EAN-13 barcodes.
Strict segment ordering. 22 segments in exact order. Any deviation results in file rejection.
Why This Matters
TRADACOMS is the backbone of the UK retail supply chain. It is used by every major UK retailer and builders' merchant — Tesco, Sainsbury's, B&Q, Huws Gray, Travis Perkins, Jewson, and hundreds more.
Most developers have never heard of it. Even fewer can generate compliant files. This is the kind of deep supply chain integration that sits behind every product on every shelf in the UK — and we have built it.
Takeaway
If your business needs to exchange electronic documents with UK retailers or merchants, we can build it. TRADACOMS, EDIFACT, or any other EDI standard. We understand the formats, the VANs, and the zero-tolerance error handling.
If supply chain automation is on your roadmap, we can help.