← Back to blog

Logistics technology

API and TMS integration: how to create a logistics workflow without retyping

Learn how to connect a TMS and logistics operation through an API, define data sources, handle failures, and measure an integration pilot.

By Time Genne

A transport operation does not happen in a single system. An order may originate in the ERP, move to the TMS, pass through route planning, and end with delivery tracking. When these points do not communicate, the team becomes the bridge: copying data, checking spreadsheets, correcting records, and updating statuses manually.

Integration between an API and a TMS changes this design. Instead of carrying information by hand, systems exchange structured data. The goal is not just speed. It is to keep orders, routes, drivers, documents, and operational events aligned throughout the journey.

Why integration matters in Brazilian transport

Logistics involves different electronic documents. Brazil's Federal Revenue Service lists NF-e, CT-e, and MDF-e, among others, in the national digital tax document ecosystem. The CT-e Portal shows the scale of this infrastructure: billions of authorized transport documents and more than one hundred thousand issuers.

The Ministry of Transport also clarifies that sector integration initiatives do not, by themselves, eliminate NF-e, CT-e, or MDF-e. Depending on the case, these documents are still required. This makes a practical point: digitizing one isolated step does not solve the entire workflow.

A good integration must respect this reality. It connects operational data without promising to erase obligations that remain in force.

What an API can connect to the TMS

An API acts as a contract between systems. It defines what data goes in, what responses come out, and how each failure will be communicated. In a logistics operation, this connection can organize workflows such as:

  • sending orders and stops for planning;
  • updating addresses and delivery windows;
  • associating vehicles and drivers;
  • publishing routes;
  • returning execution statuses;
  • recording incidents;
  • querying documents and proofs of delivery.

Not every integration must start with all these events. The best first scope is usually the one that currently generates the most rework or delay. If the team types the same order in two places, that is a clear candidate. If customer service depends on asking an operator for status, returning events may bring more value.

Four decisions before integrating

1. Define the source of each piece of data

Each field should have a responsible system. The TMS may be the source of the transport order, while the execution platform maintains the arrival or completion event. Two systems editing the same data without an authority rule create conflict, not integration.

2. Model states, not just fields

“In route,” “not delivered,” and “completed” need a common meaning. Before writing code, build a table mapping the two systems' states and define which transitions are accepted.

3. Plan for failures and retries

Connections fluctuate. A request may be sent and its response lost. The integration therefore needs to allow safe retries, record errors, and support reprocessing. Without this, a temporary failure can become a duplicate order or a missing event.

4. Start with observability

The team should be able to answer: was the data sent, received, rejected, or is it awaiting a retry? Technical logs help, but operations also need a clear view of what requires human action.

A simple path beyond the pilot

Start with a bounded workflow, known volume, and defined owners. Choose the minimum fields, document the contract, and test real examples, including incomplete addresses, canceled orders, and duplicate attempts.

Then track a few indicators:

  • manually entered records;
  • synchronization failures;
  • time between order creation and availability;
  • incidents not returned to the source system;
  • human interventions per batch of orders.

These measures help decide whether the pilot should be expanded. They also prevent a common mistake: considering the integration ready merely because the first call worked.

Integration is operational design

An API is not an end in itself. It is a way for systems to participate in the same process with clear responsibilities. The benefit appears when the operation stops reconciling screens and starts handling exceptions that really require a human decision.

Genne offers a public API/TMS integration option to connect transport management to the platform's operational workflow. To assess fit, start with three questions: which system creates demand, which events need to return, and who acts when a failure occurs.

With that scope, the technical conversation starts with the right problem and can progress in stages without interrupting the current operation.

Sources

To apply this guide to your work, see how to plan delivery routes and explore the Genne delivery route planner.