Developer guide

Trellex has a REST API for loads, tracking, documents, carriers and invoices, signed webhooks, X12 EDI for shippers who tender that way, and an MCP server so an AI assistant can read a brokerage's data.

Getting started

The API is REST over HTTPS and speaks JSON. Every request is made for one brokerage, the one the API key belongs to.

https://trellex.net/tms/api/v1

An admin makes keys in Trellex under Admin, API & EDI, API keys. API & EDI has to be part of the company's plan. Then check the key:

curl https://trellex.net/tms/api/v1/me \
  -H "Authorization: Bearer trx_live_…"

/me answers with the company, the key's name and access level, and the list of endpoints. If the short address answers "Not found" on your host, use https://trellex.net/tms/api/v1.php?path=me; it works the same for every path.

Keys and limits

Send the key on every request as Authorization: Bearer trx_live_… or as X-Api-Key: trx_live_…. Keys are never read from the address. A key has one of three access levels:

Access levelWhat it can do
Full accessRead everything and create loads, send locations, temperatures and EDI files.
Read onlyRead everything. Any request that writes is refused with 403.
One customerSees only that customer's loads, their BOLs and PODs, and their invoices. Never sees carrier pay, the carrier's MC or USDOT, or the sales rep. Can create loads for that customer. Made for a customer's own portal or TMS.

Each key can make 120 requests a minute. Past that the API answers 429; wait and retry. Dates and times are ISO 8601. Lists are returned newest pickup first.

Loads

MethodPathWhat it does
GET/loadsLoads, newest pickup first. Filters: status (one or more of open, covered, dispatched, in_transit, delivered, invoiced, comma separated), customer (exact name), since (pickup on or after this date), limit (1 to 200, default 50), offset.
GET/loads/{id}One load, by Trellex ID (L-123) or by your reference / PO. Adds the last five check calls and the arrival forecast.
POST/loadsCreates an open load on the board, waiting for a carrier.

List loads

curl "https://trellex.net/tms/api/v1/loads?status=in_transit&limit=20" \
  -H "Authorization: Bearer trx_live_…"
{
  "data": [ { "id": "L-24191", "reference": "PO-606200", "status": "in_transit", … } ],
  "total": 8, "offset": 0, "limit": 20, "has_more": false
}

The load object

FieldNotes
id, reference, customerTrellex ID, your PO or reference, and the customer's name.
statusopen, covered, dispatched, in_transit, delivered or invoiced.
equipment, temperature, weight_lbs, commodity, milesTemperature is the set point as text, such as 34F.
rate{ amount, currency }: what the customer pays. USD or CAD.
stops[]type (pickup or delivery), facility, address, city, state, zip, appointment, arrived.
tracking{ eta, last_update }.
documents{ bol, pod, invoice } as true or false. The files are under documents.
invoicePresent once invoiced: { number, replaces, credit_note }.
carrier{ id, name, mc, dot }. One-customer keys get the name only.
carrier_pay, sales_repNot sent to one-customer keys.
check_calls[], forecastOnly on a single load. The forecast is { arrival, risk, minutes_late, reasons } with risk ok, watch or late.

Create a load

customer is required, and so are at least two stops: a pickup first and a delivery last, each with a city, a state and an appointment. Everything else is optional. Equipment is one of Dry Van, Reefer, Flatbed, Step Deck or Power Only.

curl -X POST https://trellex.net/tms/api/v1/loads \
  -H "Authorization: Bearer trx_live_…" \
  -H "Content-Type: application/json" \
  -d '{
    "customer": "Acme Foods",
    "reference": "PO-88213",
    "equipment": "Reefer",
    "temperature": "34F",
    "weight_lbs": 42000,
    "commodity": "Frozen chicken",
    "rate": 2450,
    "stops": [
      {"type": "pickup",   "facility": "Acme Plant 4", "city": "Chicago", "state": "IL", "zip": "60609", "appointment": "2026-12-03T08:00:00-06:00"},
      {"type": "delivery", "facility": "FreshMart DC", "city": "Atlanta", "state": "GA", "zip": "30336", "appointment": "2026-12-04T14:00:00-05:00"}
    ]
  }'

The answer is 201 with the new load under data. If it looks like a load already in Trellex, the answer also carries possible_duplicates, each with the other load's ID and the reason. Other fields you can send: currency (USD or CAD), miles, sales_rep and notes.

Tracking and documents

MethodPathWhat it does
GET/loads/{id}/trackingStatus, percent_complete (0 to 100), ETA, last update, the arrival forecast, the last check calls and the stops.
GET/loads/{id}/documentsFiles on the load with type, name, size and upload time. One-customer keys see BOLs and PODs only.
GET/documents/{id}Downloads one file.
{
  "data": {
    "id": "L-24191", "status": "in_transit", "percent_complete": 66,
    "eta": "2026-11-12T17:12:37.503Z", "last_update": "2026-11-12T15:31:15.523Z",
    "forecast": { "arrival": "2026-11-12T18:27:14+00:00", "risk": "ok", "minutes_late": -63, "reasons": ["85 mi left (estimated, no GPS yet)"] },
    "check_calls": [ { "at": "2026-11-12T13:00:00.000Z", "source": "Driver", "text": "Loaded & departed Kansas City, MO" } ],
    "stops": [ … ]
  }
}

Carriers and invoices

MethodPathWhat it does
GET/carriersYour carriers: ID, name, MC, USDOT, phone, email, tier, loads hauled, on-time % and whether they're blocked. Not for one-customer keys.
GET/invoicesInvoices with number, load, customer, amount, currency, invoice date, due date and status. Filter with status: open, past_due or paid.

Locations and temperatures

For ELDs, telematics and reefer units. Both need a full-access key. Send one reading as the body, or many under data (up to 500 locations or 2,000 temperatures a request).

MethodPathBody
POST/loads/{id}/locationslat, lng, and optionally speed_mph and at.
POST/loads/{id}/temperaturesat and either temp_f or temp_c.
curl -X POST https://trellex.net/tms/api/v1/loads/L-24191/locations \
  -H "Authorization: Bearer trx_live_…" -H "Content-Type: application/json" \
  -d '{"data": [{"lat": 38.95, "lng": -92.33, "speed_mph": 61, "at": "2026-11-12T16:31:00Z"}]}'

The answer is 201 with { "ok": true, "accepted": 1 }. Locations feed the map, the ETA, the arrival forecast and the GPS checks. Temperatures are compared with the load's set point.

Webhooks

Add a webhook under Admin, API & EDI, Webhooks, for all customers or just one. Trellex posts JSON to your address when something happens to a load.

EventSent when
load.createdA load is added.
load.status_changedThe status changes.
load.picked_upThe load goes in transit.
load.deliveredThe load is delivered.
load.eta_changedThe ETA of a load in transit moves by 15 minutes or more.
document.podA POD arrives.
load.invoicedThe load is invoiced.
invoice.correctedAn invoice is corrected and gets a new number.
{
  "id": "evt_5f0c2a9d1e7b4c3a8d21",
  "event": "load.delivered",
  "created": "2026-11-12T19:41:07+00:00",
  "data": { "id": "L-24191", "status": "delivered", … }
}

Check the signature

Every delivery has the headers X-Trellex-Event and X-Trellex-Signature: t=1794590000,v1=…. Compute HMAC-SHA256 of t + "." + raw body with the webhook's signing secret and compare it with v1. Refuse anything older than five minutes.

// Node.js
const crypto = require('crypto');
function verify(rawBody, header, secret) {
  const p = Object.fromEntries(header.split(',').map(x => x.split('=')));
  const sig = crypto.createHmac('sha256', secret).update(p.t + '.' + rawBody).digest('hex');
  return sig.length === p.v1.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(p.v1)) && Date.now() / 1000 - p.t < 300;
}

Answer with any 2xx status. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours, 12 hours and 24 hours, then marked failed.

EDI

For shippers who tender by X12 4010. Add the customer as a trading partner in Trellex, then have your EDI provider or VAN post files to the API and collect replies from the outbox. Not for one-customer keys.

MethodPathWhat it does
POST/ediSend an X12 file. The body is the raw file, or JSON { "x12": "…" }.
GET/edi/outboxFiles waiting for the trading partner.
GET/edi/outbox/{id}Downloads one file.
POST/edi/outbox/{id}/ackMarks it collected.
SetDirectionMeaning
204InLoad tender. Becomes an open load. Purpose 00 is new, 01 cancels, 04 changes rate, weight or appointments while the load is still open.
997OutReceipt for every 204, sent right away.
990OutYour accept or decline.
214OutStatus: X3 arrived at pickup, AF picked up, X1 arrived at delivery, D1 delivered, AG new ETA.
210OutInvoice, when the load is invoiced and again if the invoice is corrected.
curl -X POST https://trellex.net/tms/api/v1/edi \
  -H "Authorization: Bearer trx_live_…" \
  -H "Content-Type: application/edi-x12" \
  --data-binary @tender.edi

MCP server

The Model Context Protocol lets an AI assistant call tools on another system. Trellex's MCP server gives an assistant six read-only tools over one brokerage's data, the same ones behind Ask Trellex. Nothing it does can create, change or delete anything.

https://trellex.net/tms/api/mcp
  • Sign in with an API key in a header: Authorization: Bearer trx_live_… or X-Api-Key. Use a read-only key. One-customer keys are refused, because the tools aren't limited to one customer.
  • The same 120 requests a minute as the REST API, shared with it.
  • Streamable HTTP, POST only. It speaks protocol revision 2026-07-28 and also answers older clients that start with initialize (2025-11-25 and earlier). It keeps no sessions.
  • If the short address answers "Not found" on your host, use https://trellex.net/tms/api/mcp.php.

Tools

ToolWhat it answers
find_loadsLoads by status, customer, carrier, lane, equipment, rep, pickup dates, missing POD, running late or hot. Up to 60 at a time.
get_loadOne load by ID or PO: stops, recent check calls and activity, the arrival forecast and recent alerts.
load_totalsLoads, revenue, margin, rate per mile and on-time %, grouped by customer, carrier, lane, rep, equipment, week or month.
list_carriersCarriers with tier, on-time %, health score and insurance expiry, including "expiring within N days".
list_invoicesInvoices that are open, past due or paid, with the total.
list_alertsRecent fraud, payment, late-load and paperwork alerts.

Connect an assistant

Any MCP client that can send a request header works. Claude Code:

claude mcp add --transport http trellex https://trellex.net/tms/api/mcp \
  --header "Authorization: Bearer trx_live_…"

Clients that take a JSON entry for a remote server, such as Cursor (the key names differ a little between clients):

{
  "mcpServers": {
    "trellex": {
      "url": "https://trellex.net/tms/api/mcp",
      "headers": { "Authorization": "Bearer trx_live_…" }
    }
  }
}

Desktop apps that only start local servers can reach it through the mcp-remote bridge:

{
  "mcpServers": {
    "trellex": {
      "command": "npx",
      "args": ["mcp-remote", "https://trellex.net/tms/api/mcp", "--header", "Authorization: Bearer trx_live_…"]
    }
  }
}

Sign-in is by API key only for now. Connector screens that expect an OAuth sign-in, with no place to enter a request header, can't connect yet.

Then ask in plain words: "Which loads are running late?", "Margin by customer this month", "Carriers whose insurance expires in the next 30 days".

Errors

The REST API answers errors as JSON with a message a person can read:

{ "error": { "message": "Load not found.", "status": 404 } }
StatusMeaning
400The request couldn't be read. Send a JSON body with Content-Type: application/json.
401The key is missing, malformed or revoked.
403The key isn't allowed to do this (read only, or one customer), or API & EDI isn't in the company's plan.
404No such load, document or path.
413The body is too large.
422The request was understood but can't be done. The message says what to fix, such as "Each stop needs a city and state."
429More than 120 requests in a minute.
500Something failed on Trellex's side. Try again.

The MCP server answers in JSON-RPC, as the protocol defines.