- Docs
- Techvia TMS overview
- Use cases
- Track stops
Outcome: your telematics, driver app or script reports arrivals and departures, the TMS timeline shows them, and detention is worked out from the two times by your workspace’s detention settings.
- Make a key with
loads.readandloads.write. Store it asTMS_KEY. - Read the load to get each stop’s
id:GET /api/public/v1/loads/{id}returnsstops[]withid,order,type,scheduledLocal,arrivedAtanddepartedAt. - Record the arrival with
PUT /api/public/v1/loads/{id}/stops/{stopId}/arrival. The body{ "at": "2026-12-01T09:05:00" }is optional: left out, it means now. With an offset it is that instant; without one it is the local time at the stop’s facility. More than a day ahead is a422. - Record the departure the same way with
.../departure. A departure before any arrival, or before the arrival, is a422. - Read the load again.
arrivedAtanddepartedAtare filled (UTC), and any detention appears inautoChargesfor a key withbilling.readorloads.rates.
curl -X PUT "https://tms-api.techvia.software/api/public/v1/loads/$LOAD_ID/stops/$STOP_ID/arrival" \ -H "Authorization: Bearer $TMS_KEY" -H "Content-Type: application/json" \ -d '{"at":"2026-12-01T09:05:00"}'
curl -X PUT "https://tms-api.techvia.software/api/public/v1/loads/$LOAD_ID/stops/$STOP_ID/departure" \ -H "Authorization: Bearer $TMS_KEY" -H "Content-Type: application/json" \ -d '{"at":"2026-12-01T11:30:00"}'const base = 'https://tms-api.techvia.software/api/public/v1/loads';const headers = { Authorization: `Bearer ${process.env.TMS_KEY}`, 'Content-Type': 'application/json' };
async function stamp(loadId, stopId, kind, at) { const res = await fetch(`${base}/${loadId}/stops/${stopId}/${kind}`, { method: 'PUT', headers, body: JSON.stringify(at ? { at } : {}), }); if (!res.ok) throw new Error(await res.text()); return res.json(); // the load as GET returns it}
await stamp(loadId, stopId, 'arrival', '2026-12-01T09:05:00');await stamp(loadId, stopId, 'departure', '2026-12-01T11:30:00');import os, requests
BASE = "https://tms-api.techvia.software/api/public/v1/loads"headers = {"Authorization": f"Bearer {os.environ['TMS_KEY']}"}
def stamp(load_id, stop_id, kind, at=None): res = requests.put(f"{BASE}/{load_id}/stops/{stop_id}/{kind}", headers=headers, json={"at": at} if at else {}) res.raise_for_status() return res.json() # the load as GET returns it
stamp(load_id, stop_id, "arrival", "2026-12-01T09:05:00")stamp(load_id, stop_id, "departure", "2026-12-01T11:30:00")Good to know
Section titled “Good to know”- The earliest arrival wins (a later one changes nothing) and a stop has one departure (a second changes nothing), so a repeated call is safe.
- These calls take no
rowVersion. A call that collides with another change of the same load at that moment is a409(“Retry the call”). - An unknown stop or load is
404. The timeline shows “Arrived @ facility (API key: your key name)”.
Next steps
Section titled “Next steps”- Record arrival and record departure in the reference.
- The rules for the rest of a load: Loads guide.
- Let an AI record them: Run dispatch from Claude.