TrustColdDevelopers
Trips›Live status

Live status

Keep the partner screen in sync with no full page reload. Poll, or push webhooks into the same UI.

Run this from your browser — add your free test keys.
curl -i https://trustcoldeg.com/api/v1/b2b/trips/10025/status \
  -H "Authorization: Bearer CLIENT_KEY" \
  -H "Accept: application/json" \
  -H "If-None-Match: \"etag-from-last-response\""

Trip status (headers: ETag, X-Poll-After-Ms)

{
  "data": {
    "id": 10025,
    "code": "TRUST10025",
    "status": "en_route",
    "deposit_status": "paid",
    "collected": true,
    "driver_name": "Mahmoud A.",
    "revenue": 4800.0,
    "updated_at": "2026-12-20T11:42:10+02:00",
    "poll_after_ms": 4000,
    "etag": "9b0f1c6a2d…"
  }
}

Nothing changed since your If-None-Match

(empty body)

GET /trips/updates

{
  "data": [ { "id": 10025, "status": "en_route", "poll_after_ms": 4000, "…": "…" } ],
  "meta": {
    "since": "2026-12-20T11:00:00+02:00",
    "count": 1,
    "poll_after_ms": 5000,
    "server_time": "2026-12-20T11:42:12+02:00"
  }
}

Key points

  • One trip — GET /trips/{id}/status + If-None-Match. 304 means nothing changed.
  • poll_after_ms — Wait that many ms. 0 means the trip is finished (completed, cancelled, or deleted) — stop.
  • List screen — GET /trips/updates?since= for every row that changed.
  • Never reload — Patch data-trip-status in the DOM. Preferred: webhook → your backend → websocket/SSE.

Update the trip status on the partner screen automatically. Do not reload the page. Poll a small status payload, or push webhook events into the same UI.

Compact fields only. Send the previous ETag as If-None-Match. Unchanged trips return 304 with an empty body. Wait poll_after_ms (also in X-Poll-After-Ms) before the next call. When that value is 0 the trip is finished — stop polling.

FieldDescription
statusSame as the trip object. Paint this in the UI when it changes
deposit_statuspending, paid, or none
driver_nameSet when TrustCold assigns a driver
collectedWhether the load was collected
updated_atPass this as since on the list endpoint below
poll_after_msDelay until the next poll. 0 = stop
etagSend back in If-None-Match

All trips that changed

GET

/trips/updates?since=

Use this on a list screen. Keep meta.server_time and pass it as the next since. Empty data means nothing changed — still wait meta.poll_after_ms and call again.

curl "https://trustcoldeg.com/api/v1/b2b/trips/updates?since=2026-12-08T03:00:00+00:00" \
  -H "Authorization: Bearer CLIENT_KEY" \
  -H "Accept: application/json"

Partner UI (no reload)

async function watchTrip(id, key) {
  let etag = "";
  async function tick() {
    const res = await fetch("https://trustcoldeg.com/api/v1/b2b/trips/" + id + "/status", {
      headers: {
        Authorization: "Bearer " + key,
        Accept: "application/json",
        "If-None-Match": etag
      }
    });
    if (res.status !== 304) {
      const body = await res.json();
      etag = res.headers.get("ETag") || body.data.etag;
      document.querySelector("[data-trip-status]").textContent = body.data.status;
      if (body.data.poll_after_ms === 0) return;
      setTimeout(tick, body.data.poll_after_ms);
      return;
    }
    const wait = Number(res.headers.get("X-Poll-After-Ms") || 5000);
    setTimeout(tick, wait);
  }
  tick();
}
Keep the client key on your server. Preferred live path: TrustCold webhook → your backend → websocket or SSE to the open page. Polling from the browser is only for a private admin tool.

Webhooks still fire on status change. Use them so you do not wait for the next poll. The open page should apply the new status in place — never location.reload().