> ## Documentation Index
> Fetch the complete documentation index at: https://help.ship.uniuni.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 追踪

> 使用UniUni合作伙伴API追踪货件

获取货件的当前状态和事件历史记录。

## 请求

```
GET /track?trackingId=<trackingId>
```

| 请求头             | 值                      |
| --------------- | ---------------------- |
| `Authorization` | `Bearer <accessToken>` |

### 查询参数

| 参数           | 类型     | 必填 | 描述                                     |
| ------------ | ------ | -- | -------------------------------------- |
| `trackingId` | string | 是  | 货件追踪ID（格式：`UR` + 17位数字，或`URB` + 16位数字） |

## 响应

```json theme={null}
{
  "success": true,
  "message": "Success",
  "data": {
    "trackingId": "UR12345678901234567",
    "shipmentStatus": "OUT_FOR_DELIVERY",
    "statusCode": 201,
    "orderNumber": "ORD-2026-001",
    "batchId": "URB1234567890123456",
    "note": "",
    "signatureRequired": false,
    "weight": {
      "value": 2.5,
      "weightUnit": "kg"
    },
    "dimensions": {
      "length": 30,
      "width": 20,
      "height": 15,
      "dimensionUnit": "cm"
    },
    "recipient": {
      "fullName": "John Doe",
      "phone": "604-555-0123",
      "email": "john@example.com"
    },
    "destination": {
      "address1": "123 Main St",
      "address2": "Suite 100",
      "city": "Vancouver",
      "province": "BC",
      "postalCode": "V6B 1A1",
      "country": "CA",
      "latitude": 43.6426,
      "longitude": -79.3871
    },
    "events": [
      {
        "status": "OUT_FOR_DELIVERY",
        "statusCode": 201,
        "timestamp": 1773066600000,
        "description": "Package is out for delivery",
        "location": {
          "name": "Toronto Warehouse",
          "lat": 43.7,
          "lng": -79.4
        }
      },
      {
        "status": "RECEIVED",
        "statusCode": 191,
        "timestamp": 1772956800000,
        "description": "Package received at facility",
        "location": {
          "name": "Toronto Warehouse",
          "lat": 43.7,
          "lng": -79.4
        }
      },
      {
        "status": "PENDING",
        "statusCode": 181,
        "timestamp": 1772899200000,
        "description": "",
        "location": null
      }
    ]
  }
}
```

有关`shipmentStatus`和`statusCode`值的完整列表，请参见[货件状态参考](/zh/api/shipment-status-reference)。

## 错误响应

<Tabs>
  <Tab title="令牌已过期">
    ```json theme={null}
    {
      "success": false,
      "message": "TokenExpiredError",
      "errorCode": "TokenExpiredError"
    }
    ```
  </Tab>

  <Tab title="货件未找到">
    ```json theme={null}
    {
      "success": false,
      "message": "Shipment not found",
      "errorCode": "ShipmentNotFoundError"
    }
    ```
  </Tab>
</Tabs>
