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

# Get label

> Fetch the shipping label for an order as a base64-encoded PDF or ZPL document.



## OpenAPI

````yaml /api-reference/openapi.json get /orders/label/{orderId}
openapi: 3.1.0
info:
  title: Sparqle API
  version: 1.0.0
  description: >-
    Create deliveries, fetch shipping labels, and track orders with Sparqle.


    This specification is a hand-authored starting point derived from the API
    source. Replace or merge it with the spec exported from your previous docs
    as you refine the reference.
servers:
  - url: https://staging-v2.sparqle.tech
    description: Test
  - url: https://v2.sparqle.com
    description: Live
security:
  - apiKey: []
paths:
  /orders/label/{orderId}:
    get:
      tags:
        - Labels
      summary: Get label
      description: >-
        Fetch the shipping label for an order as a base64-encoded PDF or ZPL
        document.
      operationId: getLabel
      parameters:
        - name: orderId
          in: path
          required: true
          schema:
            type: string
          example: SPQ-10293
        - name: format
          in: query
          required: false
          description: >-
            Output format. ZPL is available for Sparqle-generated labels only,
            always A6 at 203 DPI. Use orientation=landscape|portrait; when
            omitted, ZPL follows the company ORIENTATION setting (same as PDF),
            not landscape by default. printSize is not supported for ZPL.
          schema:
            type: string
            enum:
              - pdf
              - zpl
            default: pdf
        - name: orientation
          in: query
          required: false
          description: >-
            Label orientation for PDF and ZPL. When omitted, uses the company
            ORIENTATION setting, then landscape. For ZPL: merchants with
            portrait configured for PDF receive portrait ZPL unless
            orientation=landscape is passed explicitly.
          schema:
            type: string
            enum:
              - landscape
              - portrait
        - name: printSize
          in: query
          required: false
          description: PDF print size only. Not supported with format=zpl.
          schema:
            type: string
            enum:
              - A6
              - A4
      responses:
        '200':
          description: Base64-encoded label document
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Label'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/FormatUnavailable'
components:
  schemas:
    Label:
      type: object
      properties:
        label:
          type: string
          description: Base64-encoded PDF or ZPL label document.
          example: JVBERi0xLjQKJ...
    Error:
      type: object
      properties:
        statusCode:
          type: integer
          example: 400
        message:
          type: array
          items:
            type: string
          example:
            - deliveryName should not be empty
        error:
          type: string
          example: Bad Request
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Unauthorized:
      description: Missing or invalid API key
    NotFound:
      description: Resource not found
    FormatUnavailable:
      description: The requested format is unavailable for this order
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: api-key

````