> ## 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-ja.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

````