Skip to content
AIRO

· 3 min read

Route Optimization API for ERP and WMS: Add Routing Without a TMS

How to add multi-vehicle route optimization to an ERP or WMS with one JSON API call, without buying a TMS. Architecture, payloads, idempotency and webhooks.

Many companies already run an ERP or a WMS: SAP Business One, Odoo, NetSuite, Dynamics, Sage, a custom system. Orders, stock and invoices are handled. Then comes the daily question: which vehicle should deliver which orders, and in what sequence? In practice a dispatcher answers it in a spreadsheet.

The usual advice is to buy a TMS. For a team with 3 to 30 vehicles that is often more than the problem needs: new master data, new screens, a second system to keep in sync. There is a lighter path: keep your ERP or WMS as the system of record and call a route optimization API for the one thing it lacks.

What a route optimization API should do

At minimum, given a day of orders it should:

  1. Validate the data and tell you precisely what is wrong ("orders[17]: the address is incomplete").
  2. Geocode addresses and compute realistic travel times.
  3. Optimize across several vehicles while respecting capacity, service times and time windows.
  4. Return routes you can use: stops in driving order with planned arrival times, KPIs, and the orders that could not be planned, with a reason.
  5. Be safe to automate: idempotent, observable, and predictable.

The integration in one request

Your ERP sends orders, vehicles and a depot as JSON. AIRO answers immediately with an optimization id and does the work asynchronously:

POST /v1/optimizations
Authorization: Bearer airo_sk_…
Idempotency-Key: run-2026-10-14-depot-1

{
  "depot": { "address": "100 King St W, Toronto, ON" },
  "fleet": { "count": 3, "capacity": 60 },
  "orders": [
    { "id": "SO-1001", "address": "255 Bremner Blvd, Toronto", "demand": 12,
      "time_window_start": "09:00", "time_window_end": "12:00" }
  ]
}

The response is 202 Accepted with the optimization id. You then either poll GET /v1/optimizations/{id} or receive a signed webhook when it is completed. The result contains one route per vehicle, each stop with its sequence and arrival time, and a list of unassigned orders with reasons such as an address that could not be located or a time window no vehicle can reach.

The full request schema is in the API documentation.

Design rules that keep integrations reliable

Idempotency on every billable call

Networks fail and ERP jobs retry. If a retry creates a second optimization, you pay twice and your dispatcher sees duplicates. Use a business key (for example your dispatch run id) as the Idempotency-Key. The same key returns the same optimization.

Actionable validation errors

A good API says which order is wrong and how to fix it, so your integration can show the message to a dispatcher instead of a stack trace. That is why validation errors reference the input path.

Webhooks with signatures, plus polling as a fallback

Webhooks save you a polling loop. Verify the HMAC signature on the raw body, reject old timestamps, and treat events as at-least-once. Keep polling as a safety net.

Determinism

The optimization should come from a deterministic solver, not a language model. The same input then produces the same plan, which makes it testable and auditable. AIRO uses Google OR-Tools in the backend; AI assistants such as Claude and ChatGPT can drive the same engine through MCP, but they never perform the optimization.

Where the API fits in your architecture

  • ERP or WMS as the system of record. Orders and vehicles stay there.
  • A small integration job (a scheduled task or a button in your ERP) builds the payload for the day and posts it.
  • Results flow back: write the sequence and ETA onto your delivery documents, or hand drivers an Excel or CSV export.
  • Dispatchers keep a safety valve: the same optimization is visible in the web portal, where it can be reviewed or re-run.

What it costs

Pricing is based on operational usage, never AI tokens: pay as you go at $30 per optimization with no subscription, or a monthly plan with included orders, vehicles and scenarios. See pricing for the current plans. Billing opens after the waitlist phase.

Getting started

Read the API quickstart, then join the waitlist to get API access when billing opens.

Frequently asked questions

Do I need a TMS to optimize routes if I already have an ERP or WMS?

No. If your ERP or WMS already manages orders, stock and invoices, you only need the routing step. A route optimization API adds that step without replacing your system of record.

What data does a route optimization API need from my ERP?

Orders with an address or coordinates, a load quantity, a service time and optional time windows; vehicles with a capacity and shift; and a depot. Most ERPs and WMSs already hold all of it.

How do I avoid creating duplicate optimizations when my integration retries?

Send an idempotency key with each request. A well-designed API returns the same optimization for the same key instead of running, and billing, it twice.

Should my integration poll or use webhooks?

Use webhooks to be notified when a plan is ready and keep polling as a fallback. Verify the webhook signature and treat events as at-least-once.

Turn your spreadsheet into optimized routes

Join the waitlist for early access.