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

# List an order's shipping labels

> Returns the valid shipping labels (carrier guides) generated for an order, including the label
PDF, the tracking number and tracking URLs. Use it to print labels or to look up tracking numbers
after the order has been packed.

- Only labels that are still valid are returned; labels that were cancelled or replaced are excluded.
- The prepaid return label that travels inside the package is never included. Other return-type
  labels (`Return`, `Return By Carrier`) are included when they exist.
- Returns an empty array when the order has no labels yet (for example before packing).
- `label_file` is `{}` (an empty object) when the label PDF is not available; `billing_file` is `null`.




## OpenAPI

````yaml /openapi.yaml get /orders/{order_id}/shipping-labels
openapi: 3.1.0
info:
  title: Cubbo Clients API
  version: '1.0'
  summary: >-
    Orders, inventory, replenishments, returns, shipping and webhooks for Cubbo
    fulfillment.
  description: >
    The Cubbo Clients API connects your store, ERP or marketplace with Cubbo's
    fulfillment network.

    All endpoints except `POST /auth/token` require a bearer token; see the
    Authentication guide.

    Request and response bodies are JSON. Errors are JSON objects with an
    `error` key.
  contact:
    name: Cubbo integrations
    email: integraciones@cubbo.com
servers:
  - url: https://api.cubbo.com/v1
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Exchange client credentials for a bearer token.
  - name: Orders
    description: Create, update, hold, cancel and read sales orders.
  - name: Shipping labels
    description: Read the shipping labels generated for an order.
  - name: Inventory
    description: Products and stock per store.
  - name: Lots
    description: Lot-level inventory for products with expiration or batch tracking.
  - name: Reports
    description: Bulk reports for reconciliation.
  - name: Replenishments
    description: Inbound shipments to the warehouse.
  - name: Returns
    description: Returns and exchanges.
  - name: Stores
    description: Store provisioning and settings.
  - name: Shipping methods
    description: Available shipping methods, coverage and quotes.
  - name: Click and collect
    description: Pickup points and in-store pickup orders.
paths:
  /orders/{order_id}/shipping-labels:
    get:
      tags:
        - Shipping labels
      summary: List an order's shipping labels
      description: >
        Returns the valid shipping labels (carrier guides) generated for an
        order, including the label

        PDF, the tracking number and tracking URLs. Use it to print labels or to
        look up tracking numbers

        after the order has been packed.


        - Only labels that are still valid are returned; labels that were
        cancelled or replaced are excluded.

        - The prepaid return label that travels inside the package is never
        included. Other return-type
          labels (`Return`, `Return By Carrier`) are included when they exist.
        - Returns an empty array when the order has no labels yet (for example
        before packing).

        - `label_file` is `{}` (an empty object) when the label PDF is not
        available; `billing_file` is `null`.
      operationId: listOrderShippingLabels
      parameters:
        - name: order_id
          in: path
          required: true
          schema:
            type: integer
          description: >-
            Cubbo ID of the order (the `id` field of `Order`, not the order
            number).
          example: 987654
      responses:
        '200':
          description: Shipping labels of the order.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ShippingLabel'
              example:
                - id: 4401
                  order_id: 987654
                  shipping_number: TRK000000001
                  label_type: Shipping
                  tracking_url: https://carrier.example.com/track/TRK000000001
                  cubbo_tracking_url: https://tracking.example.com/orders/abc123
                  billing_file: null
                  label_file:
                    path: /rails/active_storage/blobs/redirect/example/label.pdf
                    url: >-
                      https://api.cubbo.com/rails/active_storage/blobs/redirect/example/label.pdf
                    filename: label.pdf
                    byte_size: 48213
                    content_type: application/pdf
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          description: The order does not exist or the parameter is invalid.
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  code:
                    type:
                      - string
                      - 'null'
                  context:
                    type:
                      - object
                      - 'null'
              examples:
                notFound:
                  value:
                    error: Couldn't find Order with 'id'=0
                    code: null
                    context: null
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    ShippingLabel:
      type: object
      description: >-
        A carrier label (guide) generated for an order, as returned by `GET
        /orders/{order_id}/shipping-labels`.
      properties:
        id:
          type: integer
          description: Shipping label ID.
          example: 4401
        order_id:
          type: integer
          description: Order ID.
          example: 987654
        shipping_number:
          type:
            - string
            - 'null'
          description: Carrier tracking number.
          example: TRK000000001
        label_type:
          type: string
          description: >-
            Purpose of the label. `Return Prepaid` labels are never returned by
            this endpoint.
          enum:
            - Shipping
            - Cash On Delivery
            - Return
            - Return By Carrier
            - Pickup
          example: Shipping
        tracking_url:
          type:
            - string
            - 'null'
          description: Carrier tracking page.
          example: https://carrier.example.com/track/TRK000000001
        cubbo_tracking_url:
          type: string
          description: Cubbo tracking page for the order.
          example: https://tracking.example.com/orders/abc123
        label_file:
          description: The label PDF, or an empty object when no file is attached.
          oneOf:
            - $ref: '#/components/schemas/ShippingLabelFile'
            - type: object
              additionalProperties: false
        billing_file:
          description: Billing document attached to the label, or null.
          oneOf:
            - $ref: '#/components/schemas/ShippingLabelFile'
            - type: 'null'
    ShippingLabelFile:
      type: object
      description: A downloadable label file.
      properties:
        path:
          type: string
          description: Relative download path.
          example: /rails/active_storage/blobs/redirect/example/label.pdf
        url:
          type: string
          description: Absolute download URL.
          example: >-
            https://api.cubbo.com/rails/active_storage/blobs/redirect/example/label.pdf
        filename:
          type: string
          description: File name.
          example: label.pdf
        byte_size:
          type: integer
          description: Size in bytes.
          example: 48213
        content_type:
          type: string
          description: MIME type.
          example: application/pdf
    Error:
      type: object
      description: Error body returned by every failed request.
      required:
        - error
      properties:
        error:
          type: string
          description: >-
            Human-readable description of the failure. For `401` responses it is
            always `Unauthorized`.
          example: Parameter store_id is required
        message:
          type: string
          description: >-
            Present on `401` responses only; the reason the request was
            rejected.
          example: invalid token
        code:
          type:
            - string
            - 'null'
          description: >-
            Stable machine-readable code, present on some order, return and
            replenishment errors.
          example: ORDER_ALREADY_EXISTS
        context:
          type:
            - object
            - 'null'
          description: >-
            Extra data about the failure when available, for example the id of
            the conflicting order.
          additionalProperties: true
          example:
            order_id: 987654
  responses:
    Unauthorized:
      description: >-
        Missing or invalid token, wrong credentials, or no access to the
        requested store.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalidToken:
              value:
                error: Unauthorized
                message: invalid token
            noHeader:
              value:
                error: Unauthorized
                message: no authorization header found
            storeNotAllowed:
              value:
                error: Unauthorized
                message: not allowed to show? this Store
    InternalServerError:
      description: >-
        Unexpected error. Retry with backoff; if it persists, send the timestamp
        to Cubbo support.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: 'unexpected error, timestamp: 1760000000'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Token returned by `POST /auth/token`, sent as `Authorization: Bearer
        <token>`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.