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

# Create order

> Create a delivery order. Returns the created order including its `orderId`, `barcode`, and `trackingUrl`.



## OpenAPI

````yaml /api-reference/openapi.json post /orders
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:
    post:
      tags:
        - Orders
      summary: Create order
      description: >-
        Create a delivery order. Returns the created order including its
        `orderId`, `barcode`, and `trackingUrl`.
      operationId: createOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOrder'
      responses:
        '201':
          description: Order created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Order'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    CreateOrder:
      type: object
      required:
        - locationId
        - orderRef
        - deliveryName
        - deliveryAddress
      properties:
        locationId:
          type: string
          maxLength: 20
          example: ABC123
          description: Pickup location the order is dispatched from.
        orderRef:
          type: string
          maxLength: 100
          example: PADE3JWEA
          description: Your own reference for the order. Keep it unique.
        name:
          type: string
          example: iPod
        description:
          type: string
          maxLength: 100
          example: ABC
        deliveryName:
          type: string
          maxLength: 100
          example: Jane Doe
        deliveryEmail:
          type: string
          format: email
          example: jane@example.com
        deliveryPhone:
          type: string
          maxLength: 30
          example: '+31612345678'
        deliveryAddress:
          $ref: '#/components/schemas/Address'
        deliveryDate:
          type: string
          format: date
          example: '2026-08-13'
          description: Optional requested delivery date (must be in the future).
        deliveryNote:
          type: string
          maxLength: 100
          example: Please leave the package at the door when I am not home.
        isBusiness:
          type: boolean
          example: false
        barcode:
          type: string
          maxLength: 25
          description: Barcode of the collo.
          example: '0123456789'
        height:
          type: number
          description: Height of the collo (mm).
          maximum: 1000
          example: 120.5
        length:
          type: number
          description: Length of the collo (mm).
          maximum: 1000
          example: 200
        width:
          type: number
          description: Width of the collo (mm).
          maximum: 1000
          example: 75.5
        weight:
          type: number
          description: Weight of the collo (g).
          maximum: 20000
          example: 22.5
        deliverAtPickupPoint:
          type: boolean
          description: Only if pickup points are enabled.
          example: false
        pickupPoint:
          type: string
          description: Only if pickup points are enabled.
          example: '161427'
    Order:
      type: object
      properties:
        id:
          type: integer
          example: 1
        orderId:
          type: string
          example: SPQ-10293
        orderRef:
          type: string
          example: PADE3JWEA
        status:
          $ref: '#/components/schemas/OrderStatus'
        name:
          type: string
          example: iPod
        barcode:
          type: string
          example: 3STBXX123456789
        trackingUrl:
          type: string
          example: https://tracking.sparqle.com/barcode/3STBXX123456789
        deliveryName:
          type: string
          example: Jane Doe
        deliveryEmail:
          type: string
          example: jane@example.com
        deliveryAddress:
          type: string
          example: Gustav Mahlerlaan 320, 1082 ME Amsterdam
        deliveryEta:
          type: string
          example: 12:40 - 13:00
        deliveryEtaDate:
          type: string
          format: date
          example: '2026-08-13'
        deliveryDate:
          type: string
          example: '2026-08-13'
        locationId:
          type: integer
          example: 1
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
    Address:
      type: object
      required:
        - street
        - houseNumber
        - postalCode
        - city
      properties:
        street:
          type: string
          example: Gustav Mahlerlaan
        houseNumber:
          type: string
          example: '320'
        suffix:
          type: string
          example: ''
        postalCode:
          type: string
          example: 1082 ME
        city:
          type: string
          example: Amsterdam
        countryCode:
          type: string
          example: NL
    OrderStatus:
      type: string
      enum:
        - draft
        - expected
        - in_transit
        - out_for_delivery
        - awaiting_next_attempt
        - at_pickup_point
        - completed
        - failed
        - in_return_transit
        - returned
        - cancelled
        - rejected
        - address_not_found
        - inactive
        - missing
        - lost
        - error
      example: draft
    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
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: api-key

````