Skip to content
The Algorithm logoThe Algorithm
Insights›Architecture
ArchitectureLogistics & Supply Chain11 min read · 2026-12-01

TMS Integration: From Emailed Freight Orders to Validated Loads

EX-1048
One fictional order traced from inbox to an acknowledged TMS record
How to get emailed and PDF freight orders into a TMS without duplicate loads or guessed delivery windows: a field map, API vs. EDI vs. import, order identity, amendments, outages, a test matrix and a copyable checklist.

If an order arrives by email and ends up in the TMS, there are two separate jobs: reading what the customer sent and deciding whether it's safe to create a load. Automating the first without the second just creates mistakes faster.

This guide covers the second job. It's written for operations and IT leads at 3PLs, brokers and shippers who want orders to reach the transportation management system (TMS) without retyping, and without the new failure modes that come with automation: duplicate loads, wrong windows and records nobody can trace. The examples use a fictional order, EX-1048, and are illustrative only.

Reading is not the same as booking

Most automated order entry projects start by extracting fields from emails and PDFs. That part is now reliable enough for most layouts. What breaks in production is everything around it: an order that was already booked by phone, an amended order that arrives as a new email, a delivery time written as “Friday AM”, or a TMS that times out halfway through a write.

A safe workflow has four stages, and only the first one involves reading:

  1. Extract the fields, keeping a link to the exact text or PDF line each value came from.
  2. Validate them against your records and rules: customer account, duplicates, required fields, allowed equipment, time windows.
  3. Route anything that fails to a named queue with the reason and the source side by side.
  4. Write and confirm: send the record to the TMS and treat it as created only when the TMS returns a record ID.

The field map

Agree this map before any code is written. Each row needs an owner who can say what happens when the value is missing or doubtful.

FieldTypical sourceValidationIf missing or doubtful
Customer IDSender domain, bill-to name, account number in the PDFExactly one active account matchesCustomer service queue
External referenceSubject line, PO or order numberFormat matches the customer's pattern; not already usedStop: identity is required
Origin and destinationEmail body, PDF address blockMatches a known location or geocodes cleanlyDispatch queue
ContactSignature, PDF headerPhone or email present for the stopDraft with a warning
Time zone and windows“Fri 9 to 11”, appointment notesExplicit start and end in the stop's local timeDispatch queue (EX-1048 stopped here)
Equipment“53 dry van”, “reefer at 34F”Maps to an allowed equipment codeDispatch queue
Weight and unitsPDF line itemsUnit stated; within equipment limitsStop if the unit is unclear
PiecesPDF line items, “12 pallets”Count and handling unit agree across email and PDFDispatch queue
Source linkMessage ID, attachment and pageAlways storedNever optional

API, EDI or approved import

The write path depends on what your TMS and your customers already support. These are integration patterns, not off-the-shelf connectors; each one is scoped against your system's documentation and a test environment.

PatternSystem accessAcknowledgementCorrection path
APIScoped service account with create and update rightsImmediate record ID or a specific errorUpdate the same record by ID; the reason is in the error
EDI (for example a 204 load tender)Trading partner setup, often through a VAN or EDI providerFunctional acknowledgement, then an accept or decline responseSend a change or cancel transaction; partner rules apply
Approved importNone beyond the import your team already runsImport log or a person confirming the batchFix in the TMS by hand; record the change against the order

If a customer already sends structured EDI, don't pass it through an AI model. Map it with rules. Extraction earns its place on the messy inputs: emails, PDFs, portal screenshots and spreadsheets.

Stable order identity

Every order needs an identity that survives retries, forwards and resends. The simplest dependable key is the matched customer account plus the customer's own reference: NHS-204:EX-1048. Store it on the TMS record, or in a lookup table you control if the TMS has no suitable field.

Before each write, and before each retry, look the key up. If a record exists, the workflow treats the incoming email as a possible amendment, not a new order.

Amended orders versus duplicates

The same reference can arrive twice for three different reasons, and each needs a different response:

  • Exact resend (same fields, often a forward or a reply-all): log it against the existing order and do nothing else.
  • Amendment (same reference, changed window, weight or stop): propose the change against the existing load. Whether it applies automatically depends on the field and the load's status. A changed delivery window on a load that has already been tendered to a carrier should go to dispatch.
  • Conflict (same reference, different customer or lane): stop. It's probably a typo or a reused number, and a person needs to decide.

Time zones and windows

“Friday AM” is not a window, and “9:00” means nothing without a place. Store windows in the local time of the stop they belong to, derived from the stop's address, and convert only for display. Text that can't be turned into an explicit start and end time goes to review. In the EX-1048 example the dispatcher confirmed 09:00 to 11:00 local time with the customer before approving.

Who owns each queue

Exceptions only help if somebody works them. Name an owner and a target time for each queue before go-live:

  • Customer service: unknown sender, ambiguous account, reference conflicts.
  • Dispatch: missing or impossible windows, equipment, stops, piece counts.
  • Integration support: TMS rejections that aren't about the order itself (permissions, validation rules, outages).

When the TMS is unavailable

Assume the TMS will time out or go down for maintenance. Validated orders should wait in a durable queue in arrival order. When the TMS returns, each order runs the duplicate lookup again before its write, because a request that timed out may still have succeeded. Operations should be able to see the queue and its oldest item at any time, so that a quiet inbox is never mistaken for a quiet day.

Sample test matrix

CaseInputExpected result
CleanEX-1048 with explicit window, known customerDraft created; TMS returns a record ID; source link stored
Missing windowEX-1048 with “Friday AM”Dispatch queue; nothing written until approved
Exact resendSame email forwarded an hour laterLogged against existing order; no second load
AmendedEX-1048 with weight changed to 15,000 lbChange proposed against the existing load; applied or queued by rule
ConflictEX-1048 from a different customerCustomer service queue; no write
RejectedTMS rejects an equipment codeIntegration support queue with the TMS error and the source
TimeoutTMS times out during the writeLookup before retry; exactly one load exists afterwards
Bad scanUnreadable PDF pageReview queue; nothing guessed

Pre-production checklist

Copy this into your project notes and work through it with operations and whoever administers the TMS.

Pre-production checklist: emailed orders to TMS loads

[ ] Destination record named (order, load or shipment) and who owns it
[ ] Write path agreed: API, EDI or approved import, with a test environment
[ ] Service account scoped to create and update only the record types needed
[ ] Field map signed off, including required fields and allowed values
[ ] Customer account matching rules written down (sender domain, bill-to, reference format)
[ ] Order identity defined: customer + customer reference (+ revision if they send one)
[ ] Amendment rule: which fields may change after a load exists, and who approves
[ ] Time zone rule: windows stored in the stop's local time, ambiguous text goes to review
[ ] Duplicate check runs before every write and before every retry
[ ] Acknowledgement captured: record ID, timestamp and reviewer kept with the order
[ ] Rejection path: TMS error text and the source document go to a named queue
[ ] Outage path: orders queue safely when the TMS is down, nothing is double posted on recovery
[ ] Queue owners named for dispatch, customer service and billing exceptions
[ ] Sample set tested: clean, amended, duplicate, rejected, bad scan
[ ] Parallel run agreed, with what counts as a correct result

We build this kind of workflow around existing TMS, WMS and ERP systems. See the logistics automation overview, or read the companion guide on freight invoice processing.

Bring us one manual workflow →

Related Articles
Architecture

What Happens to Your HIPAA BAAs When You Migrate to Cloud

Read →
Architecture

HL7 FHIR R4 to R5: The Migration Nobody Budgeted For

Read →
Architecture

Zero-Trust Architecture for HIPAA: Beyond the Marketing Slide

Read →
Facing This?

The engineering behind this article is available as a service.

We have done this work — not advised on it, not reviewed documentation about it. If the problem in this article is your problem, the first call is with a senior engineer who has solved it.

Talk to an EngineerSee Case Studies →
Related Reading
Architecture
What Happens to Your HIPAA BAAs When You Migrate to Cloud
Architecture
HL7 FHIR R4 to R5: The Migration Nobody Budgeted For
Architecture
Zero-Trust Architecture for HIPAA: Beyond the Marketing Slide
Service
Agentic AI Engineering
Service
Data Engineering & Analytics
Engage Us