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

# 获取订单及其创建时使用的物流商详细信息

> 返回已验证账户范围内的一条订单，以及创建标签时提供的物流商相关详细信息。与仅返回标签文件的 GET /labels/:id 互为补充。



## OpenAPI

````yaml /flex-forward-zh-Hans.yaml get /orders/{orderId}
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://sandbox.flexforwardship.com
    description: Sandbox
security: []
tags:
  - name: Labels
    description: 获取配送标签与标签文件。
  - name: Tracking
    description: 追踪货件状态与检查点。
  - name: Products
    description: 列出可用的配送产品。
  - name: Couriers
    description: 列出可用的物流商。
paths:
  /orders/{orderId}:
    get:
      tags:
        - Orders
      summary: 获取订单及其创建时使用的物流商详细信息
      description: 返回已验证账户范围内的一条订单，以及创建标签时提供的物流商相关详细信息。与仅返回标签文件的 GET /labels/:id 互为补充。
      operationId: getOrder
      parameters:
        - schema:
            format: uuid
            type: string
          example: f47ac10b-58cc-4372-a567-0e02b2c3d479
          in: path
          name: orderId
          required: true
          description: 订单标识符。
      responses:
        '200':
          description: 默认响应
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderDetailResponse'
        '401':
          description: 缺少或无效的 x-rr-apikey / x-rr-apitoken。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: 凭证有效，但没有访问此资源的权限。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 此账户中没有匹配该标识符的订单。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            已超出此账户的请求速率限制。请等待 Retry-After
            标头中给出的秒数后再重试。此处先声明速率限制，以便客户端在正式启用前实现相应处理。
          headers:
            Retry-After:
              schema:
                type: integer
                minimum: 1
              description: 重试前需要等待的秒数。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 意外的服务器错误。请使用指数退避重试。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKey: []
          apiToken: []
components:
  schemas:
    OrderDetailResponse:
      additionalProperties: false
      type: object
      required:
        - order
        - carrierDetails
      properties:
        order:
          $ref: '#/components/schemas/Order'
        carrierDetails:
          $ref: '#/components/schemas/OrderCarrierDetails'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          description: 人类可读的错误消息。
          type: string
          example: Shipping account not found
        code:
          description: 机器可读的错误代码。
          type: string
          example: COURIER_ERROR
    Order:
      additionalProperties: false
      description: 订单及其货件状态。
      type: object
      required:
        - id
        - status
        - exceptionState
        - exceptionStateAt
        - exceptionReason
        - courier
        - customerOrderNumber
        - courierOrderNumber
        - courierTrackingNumber
        - serviceProductCode
        - shipToCountryCode
        - shipToPostalCode
        - shipFromCountryCode
        - parcelMeasurements
        - maskedRecipientName
        - error
        - createdAt
      properties:
        id:
          format: uuid
          description: 订单标识符。
          type: string
          example: f47ac10b-58cc-4372-a567-0e02b2c3d479
        status:
          description: >-
            货件的运输阶段，按进程顺序排列。当前的值：created、fetched、first_mile_received、transit_to_consolidation、arrive_consolidation、in_transit_last_mile、shipping_to_destination、delivered、failed。未来可能新增其他值。
          type: string
          example: created
        exceptionState:
          description: 一般情况下为 null，表示当前没有任何例外状态。
          anyOf:
            - description: >-
                订单的商业状态，与 `status`
                无关。当前的值：trashed、hold、carrier_hold、refund_requested、returned、refund_rejected。未来可能新增其他值。
              type: string
            - type: 'null'
          example: null
        exceptionStateAt:
          description: '`exceptionState` 最后变更的时间。当 `exceptionState` 为 null 时为 null。'
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
        exceptionReason:
          description: 当前例外状态的原因，由客户提供或由系统生成。
          anyOf:
            - type: string
            - type: 'null'
        courier:
          description: 此订单使用的配送账户物流商。
          type: string
          example: yunexpress-tw
        customerOrderNumber:
          minLength: 1
          description: 客户订单编号：如果提供了 order.customerOrderNumber，则使用该值；如果未提供，则使用系统生成的值。
          type: string
          example: N2026-05-13-TEST-01
        courierOrderNumber:
          description: 物流商自身的订单编号（分配后）。
          anyOf:
            - type: string
            - type: 'null'
        courierTrackingNumber:
          description: 最后一公里配送的追踪编号（分配后）。
          anyOf:
            - type: string
            - type: 'null'
        serviceProductCode:
          description: 物流商服务产品代码。
          anyOf:
            - type: string
            - type: 'null'
        shipToCountryCode:
          description: 目的地国家代码（ISO 3166-1 alpha-2）。
          anyOf:
            - type: string
            - type: 'null'
        shipToPostalCode:
          description: 目的地邮政编码。
          anyOf:
            - type: string
            - type: 'null'
        shipFromCountryCode:
          description: 出发地国家代码（ISO 3166-1 alpha-2）。
          anyOf:
            - type: string
            - type: 'null'
        parcelMeasurements:
          description: 创建标签时申报的包裹重量与尺寸。
          anyOf:
            - additionalProperties: false
              type: object
              required:
                - weightUnit
                - dimensionUnit
                - parcels
              properties:
                weightUnit:
                  anyOf:
                    - type: string
                    - type: 'null'
                dimensionUnit:
                  anyOf:
                    - type: string
                    - type: 'null'
                parcels:
                  type: array
                  items:
                    additionalProperties: false
                    type: object
                    required:
                      - parcelId
                      - weight
                      - dimension
                    properties:
                      parcelId:
                        anyOf:
                          - type: string
                          - type: 'null'
                      weight:
                        type: number
                      dimension:
                        anyOf:
                          - additionalProperties: false
                            type: object
                            required:
                              - length
                              - width
                              - height
                            properties:
                              length:
                                type: number
                              width:
                                type: number
                              height:
                                type: number
                          - type: 'null'
            - type: 'null'
        maskedRecipientName:
          description: 收件人姓名（部分脱敏）。
          anyOf:
            - type: string
            - type: 'null'
        error:
          description: 当向物流商提交订单失败时才会出现。`message` 为物流商的原始文字，原样返回。
          anyOf:
            - additionalProperties: false
              type: object
              required:
                - code
                - message
              properties:
                code:
                  type: string
                message:
                  type: string
            - type: 'null'
        createdAt:
          format: date-time
          description: 订单创建的时间。
          type: string
    OrderCarrierDetails:
      additionalProperties: false
      type: object
      required:
        - integration
        - orderNumbers
        - customs
        - iossApplied
        - serviceOptions
        - courierOptions
      properties:
        integration:
          type: string
          enum:
            - yunexpress
        orderNumbers:
          additionalProperties: false
          description: 创建标签时提供的订单标识符。
          type: object
          required:
            - platformOrderNumber
            - trackingNumber
            - referenceNumbers
          properties:
            platformOrderNumber:
              anyOf:
                - type: string
                - type: 'null'
            trackingNumber:
              anyOf:
                - type: string
                - type: 'null'
            referenceNumbers:
              type: array
              items:
                type: string
        customs:
          additionalProperties: false
          description: 由客户提供的报关标识符。
          type: object
          required:
            - taxNumber
            - ioss
            - vat
            - eori
          properties:
            taxNumber:
              anyOf:
                - type: string
                - type: 'null'
            ioss:
              anyOf:
                - type: string
                - type: 'null'
            vat:
              anyOf:
                - type: string
                - type: 'null'
            eori:
              anyOf:
                - type: string
                - type: 'null'
        iossApplied:
          anyOf:
            - type: string
            - type: 'null'
        serviceOptions:
          type: array
          items:
            additionalProperties: false
            type: object
            required:
              - code
              - value
              - cost
            properties:
              code:
                type: string
              value:
                anyOf:
                  - type: string
                  - type: 'null'
              cost:
                anyOf:
                  - type: number
                  - type: 'null'
        courierOptions:
          additionalProperties: false
          description: 由客户提供的物流商专属选项。
          type: object
          required:
            - sourceCode
            - platformAccountCode
            - sensitiveType
            - signatureService
            - houseNumber
            - packageCount
            - senderUsci
            - platformName
            - platformState
            - platformAddress
            - platformPostalCode
            - platformPhone
            - platformEmail
            - platformSalesUrl
            - cargoType
            - paymentPlatform
            - paymentPlatformAccount
            - paymentTransactionNumber
            - labelUrl
          properties:
            sourceCode:
              anyOf:
                - type: string
                - type: 'null'
            platformAccountCode:
              anyOf:
                - type: string
                - type: 'null'
            sensitiveType:
              anyOf:
                - type: string
                - type: 'null'
            signatureService:
              anyOf:
                - type: string
                - type: 'null'
            houseNumber:
              anyOf:
                - type: string
                - type: 'null'
            packageCount:
              anyOf:
                - type: integer
                - type: 'null'
            senderUsci:
              anyOf:
                - type: string
                - type: 'null'
            platformName:
              anyOf:
                - type: string
                - type: 'null'
            platformState:
              anyOf:
                - type: string
                - type: 'null'
            platformAddress:
              anyOf:
                - type: string
                - type: 'null'
            platformPostalCode:
              anyOf:
                - type: string
                - type: 'null'
            platformPhone:
              anyOf:
                - type: string
                - type: 'null'
            platformEmail:
              anyOf:
                - type: string
                - type: 'null'
            platformSalesUrl:
              anyOf:
                - type: string
                - type: 'null'
            cargoType:
              anyOf:
                - type: string
                - type: 'null'
            paymentPlatform:
              anyOf:
                - type: string
                - type: 'null'
            paymentPlatformAccount:
              anyOf:
                - type: string
                - type: 'null'
            paymentTransactionNumber:
              anyOf:
                - type: string
                - type: 'null'
            labelUrl:
              anyOf:
                - type: string
                - type: 'null'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-rr-apikey
    apiToken:
      type: apiKey
      in: header
      name: x-rr-apitoken

````