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

# 获取标签的追踪事件

> 返回标签的当前追踪状态与检查点历史。可接受标签 UUID 或 customerOrderNumber 作为路径参数。



## OpenAPI

````yaml /flex-forward-zh-Hans.yaml get /tracking/{id}
openapi: 3.1.0
info:
  title: Flex Forward Shipping API
  description: >-
    > **翻译说明：** 此 API
    参考文档由英文翻译而成。[英文版](/api-reference/labels/create-label)为官方权威来源。如翻译内容有任何不一致之处，请以英文版为准。


    Flex Forward 提供统一的 API，用于创建配送标签、获取标签文件，以及追踪多个物流商的货件。
  version: 1.0.0
servers:
  - url: https://api.flexforwardship.com
    description: Production
  - url: https://api-staging.flexforwardship.com
    description: Staging
security: []
tags:
  - name: CreateLabels
    description: 创建配送标签。
  - name: Labels
    description: 获取配送标签与标签文件。
  - name: Tracking
    description: 追踪货件状态与检查点。
  - name: Products
    description: 列出可用的配送产品。
paths:
  /tracking/{id}:
    get:
      tags:
        - Tracking
      summary: 获取标签的追踪事件
      description: 返回标签的当前追踪状态与检查点历史。可接受标签 UUID 或 customerOrderNumber 作为路径参数。
      operationId: getTracking
      parameters:
        - schema:
            minLength: 1
            type: string
          example: f47ac10b-58cc-4372-a567-0e02b2c3d479
          in: path
          name: id
          required: true
          description: 标签 UUID 或客户订单编号。
      responses:
        '200':
          description: 货件的追踪信息。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingResponse'
        '401':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: 当标签已创建但物流商提交失败时返回。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LabelFailedResponse'
        '502':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
        - apiKey: []
          apiToken: []
components:
  schemas:
    TrackingResponse:
      additionalProperties: false
      description: 货件的追踪信息。
      type: object
      required:
        - id
        - trackingNumber
        - tag
        - subtag
        - subtagMessage
        - slug
        - checkpoints
      properties:
        id:
          format: uuid
          description: 标签标识符。
          type: string
          example: f47ac10b-58cc-4372-a567-0e02b2c3d479
        trackingNumber:
          description: 物流商分配的追踪编号，尚未获取时为 null。
          anyOf:
            - type: string
            - type: 'null'
          example: YT2503010001CN
        tag:
          description: >-
            高级追踪状态。可能的值：Pending、InfoReceived、InTransit、Delivered、Exception、Cancelled、Unknown。
          type: string
          example: InTransit
        subtag:
          description: 详细状态子标签。
          type: string
          example: InTransit_001
        subtagMessage:
          description: 子标签的人类可读描述。
          type: string
          example: In transit
        slug:
          description: 物流商代码。
          type: string
          example: yunexpress
        checkpoints:
          description: 按时间顺序排列的追踪事件列表。
          type: array
          items:
            additionalProperties: false
            description: 单一追踪事件检查点。
            type: object
            required:
              - checkpointTime
              - city
              - state
              - countryRegion
              - location
              - message
              - tag
              - subtag
              - subtagMessage
              - slug
            properties:
              checkpointTime:
                description: 追踪事件的时间戳。
                type: string
                example: '2025-03-02T10:30:00.000Z'
              city:
                description: 事件发生的城市。
                anyOf:
                  - type: string
                  - type: 'null'
                example: Shenzhen
              state:
                description: 州或省份。
                anyOf:
                  - type: string
                  - type: 'null'
                example: Guangdong
              countryRegion:
                description: ISO 3166-1 alpha-2 国家代码。
                anyOf:
                  - type: string
                  - type: 'null'
                example: CN
              location:
                description: 详细地点或设施名称。
                anyOf:
                  - type: string
                  - type: 'null'
              message:
                description: 追踪事件的人类可读描述。
                type: string
                example: Shipment departed from sorting center
              tag:
                description: 此检查点时的状态标签。
                type: string
                example: InTransit
              subtag:
                description: 详细子标签。
                type: string
                example: InTransit_001
              subtagMessage:
                description: 人类可读的子标签消息。
                type: string
                example: In transit
              slug:
                description: 物流商代码。
                type: string
                example: yunexpress
    ErrorResponse:
      additionalProperties: false
      type: object
      required:
        - error
      properties:
        error:
          description: 人类可读的错误消息。
          type: string
          example: Shipping account not found
        code:
          description: 机器可读的错误代码。
          type: string
          example: COURIER_ERROR
    LabelFailedResponse:
      additionalProperties: false
      description: 当标签已创建但物流商提交失败时返回。
      type: object
      required:
        - error
      properties:
        error:
          description: 错误摘要。
          type: string
          enum:
            - Label creation failed
        errorCode:
          description: 物流商专属错误代码。
          type: string
          example: COURIER_ERROR
        errorMessage:
          description: 人类可读的错误消息。
          type: string
          example: Address validation failed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
    apiKey:
      type: apiKey
      in: header
      name: x-rr-apikey
    apiToken:
      type: apiKey
      in: header
      name: x-rr-apitoken

````