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

# Get a shipping label

> Returns one shipping label of an order your credential can access, including the label
file, the carrier tracking number and the tracking URLs. Return labels that travel inside
the box for the recipient's later use are not shipping labels of the order and are not
served by this endpoint (the response is the same as for an unknown id).




## OpenAPI

````yaml /openapi.yaml get /shipping-labels/{shipping_label_id}
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:
  /shipping-labels/{shipping_label_id}:
    get:
      tags:
        - Shipping labels
      summary: Get a shipping label
      description: >
        Returns one shipping label of an order your credential can access,
        including the label

        file, the carrier tracking number and the tracking URLs. Return labels
        that travel inside

        the box for the recipient's later use are not shipping labels of the
        order and are not

        served by this endpoint (the response is the same as for an unknown id).
      operationId: getShippingLabel
      parameters:
        - name: shipping_label_id
          in: path
          required: true
          description: >-
            Id of the shipping label, as returned in the order's
            `shipping_labels`
          schema:
            type: integer
            example: 98765
      responses:
        '200':
          description: The shipping label
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShippingLabel'
              example:
                id: 98765
                order_id: 55501
                billing_file: null
                shipping_number: TRACK0000001
                label_file:
                  path: /rails/active_storage/blobs/redirect/<blob-key>/label.pdf
                  url: >-
                    https://api.cubbo.com/rails/active_storage/blobs/redirect/<blob-key>/label.pdf
                  filename: label.pdf
                  byte_size: 48213
                  content_type: application/pdf
                label_type: Shipping
                tracking_url: https://carrier.example.com/track/TRACK0000001
                cubbo_tracking_url: https://tracking.example.com/orders/<encoded-order-id>
        '401':
          description: Missing or invalid token, or no access to the label's order
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedError'
              examples:
                invalidToken:
                  value:
                    error: Unauthorized
                    message: invalid token
                noOrderAccess:
                  value:
                    error: Unauthorized
                    message: not allowed to show? this Order
        '422':
          description: Validation or business error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                invalidId:
                  value:
                    error: '''abc'' is not a valid Integer'
                notFound:
                  value:
                    error: no shipping_label with id 98765 was found.
        '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'
    UnauthorizedError:
      type: object
      description: Body of every 401 response
      properties:
        error:
          type: string
          description: Always `Unauthorized`
          example: Unauthorized
        message:
          type: string
          description: Why the request was refused
          example: invalid token
      required:
        - error
        - message
    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
    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
  responses:
    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.