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

# Get label

> Retrieves a shipping or batching label as a Base64-encoded PDF.

<Note>
  When `labelType` is `shipping`, the shipment must have been purchased first.
</Note>

The PDF content is Base64-encoded in the `body` field. To save it as a file:

<Tabs>
  <Tab title="Node.js">
    ```javascript theme={null}
    const fs = require('fs');
    const pdfBuffer = Buffer.from(response.data.body, 'base64');
    fs.writeFileSync('label.pdf', pdfBuffer);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import base64

    pdf_bytes = base64.b64decode(response["data"]["body"])
    with open("label.pdf", "wb") as f:
        f.write(pdf_bytes)
    ```
  </Tab>
</Tabs>


## OpenAPI

````yaml GET /client/label/{id}
openapi: 3.1.0
info:
  title: UniUni Platform Client API
  description: >-
    API for creating shipments, purchasing labels, managing batches, tracking
    deliveries, and receiving webhook notifications.
  version: 1.0.0
  contact:
    name: UniUni Retail Support
    email: retailsupport@uniuni.com
servers:
  - url: https://api.ship.uniuni.com/prod
    description: Production
  - url: https://api-sandbox.ship.uniuni.com
    description: Sandbox
security:
  - bearerAuth: []
tags:
  - name: Shipments
    description: Create, retrieve, list, purchase, refund, and delete shipments.
  - name: Batches
    description: Group purchased shipments into batches for drop-off or pickup.
  - name: Labels
    description: Retrieve shipping and batch labels as Base64-encoded PDFs.
  - name: Tracking
    description: Track shipment status and scan events.
  - name: Webhooks
    description: Receive real-time shipment status updates.
paths:
  /client/label/{id}:
    get:
      tags:
        - Labels
      summary: Get label
      description: Retrieves a shipping or batching label as a Base64-encoded PDF.
      operationId: getLabel
      parameters:
        - name: id
          in: path
          required: true
          description: >-
            The orderNumber (for shipping labels) or batchNumber (for batch
            labels).
          schema:
            type: string
        - name: labelType
          in: query
          required: true
          description: Type of label to retrieve.
          schema:
            type: string
            enum:
              - shipping
              - batching
      responses:
        '200':
          description: Label PDF or error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Additional information about the request status.
                  code:
                    type: integer
                    description: Status code. 0 indicates success.
                  data:
                    $ref: '#/components/schemas/LabelResponseData'
                required:
                  - message
                  - code
              examples:
                success:
                  summary: Label retrieved
                  value:
                    message: Success
                    code: 0
                    data:
                      headers:
                        Content-Type: application/pdf
                        Content-Disposition: >-
                          attachment;
                          filename="UR07240000000004901_shipping_labels_2025-07-31.pdf"
                      body: JVBERi0xLjMKJf////8K...
                notFound:
                  summary: Not found
                  value:
                    message: No batch found for the given batch number
                    code: 1014
                    data: null
components:
  schemas:
    LabelResponseData:
      type: object
      properties:
        headers:
          type: object
          properties:
            Content-Type:
              type: string
              example: application/pdf
            Content-Disposition:
              type: string
              example: attachment; filename="label.pdf"
          required:
            - Content-Type
            - Content-Disposition
        body:
          type: string
          description: Base64-encoded PDF content.
      required:
        - headers
        - body
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API access token generated from the UniUni Platform dashboard.

````