# OnTrac (LaserShip) Tracking API & MCP

URL: https://docs.lastscanned.com/carriers/ontrac

Query live **OnTrac** and **LaserShip** (`ontrac`) package status and scan history in a single synchronous `GET` request or MCP tool call. Following the OnTrac–LaserShip merger, both networks share one tracking system: `lastscanned` auto-detects legacy OnTrac `C…`/`D…` barcodes as well as LaserShip `1LS…` and `L[AEHINX]…` numbers, returning a normalized `TrackingResult` JSON payload—with zero enterprise shipper contract gating.

## Overview & Quick Facts

| Property | Value |
|---|---|
| **Carrier slug (`?carrier=`)** | `ontrac` |
| **Brand & service aliases** | OnTrac, LaserShip, OnTrac Ground, LaserShip Residential |
| **Category** | US coast-to-coast regional last-mile parcel carrier (Detection precedence **#6 of 31**) |
| **Single-package REST endpoint** | `GET https://api.lastscanned.com/v1/track/{trackingNumber}` |
| **Batch REST endpoint** | `GET https://api.lastscanned.com/v1/track?numbers=1LS...,D100...` (up to 35 numbers per carrier in a 100-number call) |
| **MCP server (`https://mcp.lastscanned.com`)** | `track_package`, `track_packages`, `list_carriers` (`claude mcp add --transport http lastscanned https://mcp.lastscanned.com`) |
| **Authentication & pricing** | `Authorization: Bearer lsk_live_...` · **1 free keyless lookup/day per IP** · **Free tier** (5 unique numbers/day, $0) · **Pro** ($4.99/mo for 1,000 unique numbers, unlimited re-polls, $0.015/extra) · **HTTP 402 Stripe MPP** ($0.50 for 25-number `lsk_pack_` key or $0.02/number in USDC on Tempo) |

## Why developers use `lastscanned` for OnTrac / LaserShip

- **No enterprise shipper account or EDI/webhook contract**: Official OnTrac / LaserShip API credentials are restricted to contracted high-volume shippers. `lastscanned` lets any merchant, 3PL dashboard, or WISMO AI agent query OnTrac and LaserShip numbers synchronously via `GET /v1/track/:number`.
- **Clean event code normalization**: OnTrac's raw payload mixes dozens of 2- to 4-letter internal event codes (`OFDL`, `FOTO`, `NFRP`, `CUPT`, `CUDM`, `DLAY`) and labels routine transit delays as `"Pending"`. `lastscanned` maps every OnTrac event code into the 7 standard statuses while preserving the full event description in `message`.

## Tracking Number Formats & Auto-Detection (`matches` vs `mayMatch`)

OnTrac is evaluated **sixth (#6)** in `lastscanned`'s two-pass detector:

| Pass | Rule / Regex | Check Digit | Examples |
|---|---|---|---|
| **Pass 1 (`matches`) — OnTrac `C`/`D`** | `/^[CD]\d{14}$/i` (`C` or `D` + 14 digits = 15 chars) | — | `D10012345678901`, `C10987654321098` |
| **Pass 1 (`matches`) — LaserShip `1LS`** | `/^1LS[A-Z0-9]{12,15}(-\d)?$/i` (`1LS` + 12–15 alphanumeric chars, optional `-N` piece suffix) | — | `1LS729108273411`, `1LSCYNV001D4HGY`, `1LSCXLNA060523159-1` |
| **Pass 1 (`matches`) — Legacy LaserShip** | `/^L[AEHINX]\d{8}$/i` (`LA`, `LE`, `LH`, `LI`, `LN`, or `LX` + 8 digits) | — | `LX12345678`, `LA98765432` |
| **Pass 2 (`mayMatch`)** | *None* | — | — |

### When is `?carrier=ontrac` optional vs required?

- **Optional (auto-detected)**: All `C`/`D` + 14-digit OnTrac numbers, `1LS…` LaserShip numbers, and `L[AEHINX]` + 8-digit legacy LaserShip numbers auto-detect in Pass 1 with zero collisions against UPS, USPS, DHL, or FedEx.
- **Required (`?carrier=ontrac`)**: Custom merchant reference numbers or numeric-only shipper order IDs inducted into OnTrac without a standard `C`/`D` or `1LS` prefix.

## Synchronous `GET` Request & Normalized JSON Response

### `curl`

```bash
curl -s "https://api.lastscanned.com/v1/track/1LS729108273411" \
  -H "Authorization: Bearer $LASTSCANNED_API_KEY"
```

### JavaScript / TypeScript (`fetch`)

```ts
const res = await fetch("https://api.lastscanned.com/v1/track/1LS729108273411", {
  headers: { Authorization: `Bearer ${process.env.LASTSCANNED_API_KEY}` },
});
const pkg = await res.json();
console.log(pkg.status, pkg.statusDescription, pkg.deliveredAtLocal);
```

### MCP `track_package` tool call

```json
{
  "tool": "track_package",
  "arguments": {
    "tracking_number": "1LS729108273411"
  }
}
```

### Normalized `TrackingResult` JSON response

```json
{
  "carrier": "ontrac",
  "trackingNumber": "1LS729108273411",
  "status": "delivered",
  "statusDescription": "Delivered",
  "service": "Ground",
  "deliveredAt": "2026-10-23T22:25:19Z",
  "deliveredAtLocal": "2026-10-23T15:25:19",
  "signedBy": null,
  "destination": {
    "city": "PHOENIX",
    "state": "AZ",
    "country": "US"
  },
  "estimatedDelivery": "2026-10-23T00:00:00",
  "message": "Your package was delivered to the front door.",
  "events": [
    {
      "timestamp": "2026-10-23T22:25:19Z",
      "localTime": "2026-10-23T15:25:19",
      "status": "delivered",
      "description": "Delivered",
      "location": "PHOENIX, AZ, US",
      "code": "FOTO"
    },
    {
      "timestamp": "2026-10-23T14:10:04Z",
      "localTime": "2026-10-23T07:10:04",
      "status": "out_for_delivery",
      "description": "Out for Delivery",
      "location": "PHOENIX, AZ, US",
      "code": "OFDL"
    },
    {
      "timestamp": "2026-10-23T09:42:51Z",
      "localTime": "2026-10-23T02:42:51",
      "status": "in_transit",
      "description": "Arrived at Facility",
      "location": "PHOENIX, AZ, US",
      "code": "AR"
    },
    {
      "timestamp": "2026-10-21T18:00:12Z",
      "localTime": "2026-10-21T11:00:12",
      "status": "label_created",
      "description": "Shipping Label Created - OnTrac awaits item",
      "location": "ONTARIO, CA, US",
      "code": "OE"
    }
  ]
}
```

> **Raw status & scan codes**: `statusDescription` carries OnTrac's `EventShortDescription`, top-level `message` carries `EventLongDescription`, and `events[].code` preserves the raw OnTrac event code (`OE`, `CUPT`, `OFDL`, `OD`, `FOTO`, `DLVD`, `DN`, `RETN`, etc.).

## Carrier-Specific Status & Integration Notes

- **Exact UTC (`timestamp`) and scan-local (`localTime`) clocks**: OnTrac provides both `UtcEventDateTime` and `ZonedEventDateTime` on every scan, so both `timestamp` and `localTime` are populated with second-level precision.
- **Estimated delivery behavior**: While a package is still in `label_created` (before OnTrac receives the physical parcel), `estimatedDelivery` is `null` (matching the OnTrac tracker's *"Pending"* state). Once inducted, `estimatedDelivery` reflects `ExpectedDeliveryDate`.

## Related Resources

- **Live browser lookup tool**: [Track an OnTrac / LaserShip package live on lastscanned.com/lookup/ontrac](https://lastscanned.com/lookup/ontrac)
- **Carrier hub**: [All 31 supported carriers](/carriers)
- **Regex & check digits**: [Tracking number formats & auto-detection](/formats)
- **AI support workflows**: [WISMO AI agents & synchronous tracking](/wismo)
