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

# Create a batch

> Creates a new batch. You can optionally include purchased shipments at creation time, or create an empty batch and add shipments later.

<Warning>
  Only purchased (paid) shipments can be added to a batch. Draft shipments will cause a `1002` error.
</Warning>


## OpenAPI

````yaml POST /client/batch/create
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/batch/create:
    post:
      tags:
        - Batches
      summary: Create a batch
      description: >-
        Creates a new batch. You can optionally include purchased shipments at
        creation time, or create an empty batch and add shipments later.
      operationId: createBatch
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateBatchRequest'
              example:
                batchName: test-111
                shipments:
                  - UNI02947917E
            example:
              batchName: Monday Dropoff
              shipments:
                - UNI02947917E
      responses:
        '200':
          description: Batch created 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/Batch'
                required:
                  - message
                  - code
              examples:
                success:
                  summary: Batch created
                  value:
                    message: Success
                    code: 0
                    data:
                      batchNumber: URB0717000000000837
                      batchName: Monday Dropoff
                      status: PENDING
                      printedLabel: false
                      createdAt: '2025-07-17T21:55:05.526Z'
                      updatedAt: '2025-07-17T21:55:05.697Z'
                      shipmentCount: 1
                unpaidShipments:
                  summary: Unpaid shipments
                  value:
                    message: Unpaid shipments are found
                    code: 1002
                    data: null
components:
  schemas:
    CreateBatchRequest:
      type: object
      properties:
        batchName:
          type: string
          description: Name for the batch.
        shipments:
          type: array
          items:
            type: string
          description: >-
            List of order numbers to include. Only purchased shipments can be
            added.
    Batch:
      type: object
      properties:
        batchNumber:
          type: string
          description: Unique batch identifier.
        batchName:
          type: string
          description: Batch name.
        status:
          type: string
          enum:
            - PENDING
            - PICKUP_REQUESTED
            - PICKUP_CANCELLED
            - PARTNER_RECEIVED
            - PICKED_UP
            - RECEIVED
          description: Batch status.
        printedLabel:
          type: boolean
          description: Whether the batch label has been printed.
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        shipmentCount:
          type: integer
          description: Number of shipments in the batch.
        shipments:
          type: array
          items:
            type: string
          description: List of shipment order numbers.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: API access token generated from the UniUni Platform dashboard.

````