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

# Create Order

> Creates a new order in the system



## OpenAPI

````yaml POST /orders
openapi: 3.1.0
info:
  title: OpenAPI UniHop Api
  description: >-
    A sample API that uses a plant store as an example to demonstrate features
    in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://backend.unihop.app/api/v1
security:
  - bearerAuth: []
paths:
  /orders:
    post:
      description: Creates a new order in the system
      requestBody:
        description: Order to add to the system
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderRequest'
      responses:
        '201':
          description: Order created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrderCreated'
        '400':
          description: unexpected error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    OrderRequest:
      type: object
      properties:
        pickup_address_street:
          type: string
          description: Street name of the pickup address.
        pickup_address_city:
          type: string
          description: City of the pickup address.
        pickup_address_country:
          type: string
          description: Country of the pickup address.
        pickup_address_number:
          type: string
          description: Street number of the pickup address.
        pickup_address_secondary_number:
          type: string
          description: Apartment or suite number for the pickup address.
        pickup_address_county:
          type: string
          description: County of the pickup address.
        pickup_address_state:
          type: string
          description: State of the pickup address.
        pickup_address_postal_code:
          type: string
          description: Postal or ZIP code of the pickup address.
        pickup_address_latitude:
          type: number
          description: Latitude coordinate of the pickup address.
        pickup_address_longitude:
          type: number
          description: Longitude coordinate of the pickup address.
        pickup_name:
          type: string
          description: Name of the contact person at the pickup location.
        pickup_phone_number:
          type: string
          maxLength: 15
          description: Phone number of the pickup contact person.
        pickup_instructions:
          type: string
          maxLength: 512
          description: Additional instructions for the pickup.
        dropoff_start_time:
          type: string
          format: date-time
          description: >-
            Start of the dropoff window as an ISO 8601 UTC datetime with a
            trailing `Z` (YYYY-MM-DDTHH:MM:SSZ). Numeric offsets (e.g. +01:00)
            are not accepted. Required unless `package_delivery_mode` is `NOW`.
        pickup_start_time:
          type: string
          format: date-time
          description: >-
            Start of the pickup window as an ISO 8601 UTC datetime with a
            trailing `Z` (YYYY-MM-DDTHH:MM:SSZ). Numeric offsets (e.g. +01:00)
            are not accepted.
        weight:
          type: number
          minimum: 0
          description: Weight of the package in lbs.
        dimensions:
          type: object
          properties:
            length:
              type: number
              minimum: 0
              description: Length of the package in inches.
            width:
              type: number
              minimum: 0
              description: Width of the package in inches.
            height:
              type: number
              minimum: 0
              description: Height of the package in inches.
          required:
            - length
            - width
            - height
          description: Dimensions of the package.
        dropoff_address_street:
          type: string
          description: Street name of the dropoff address.
        dropoff_address_city:
          type: string
          description: City of the dropoff address.
        dropoff_address_country:
          type: string
          description: Country of the dropoff address.
        dropoff_address_number:
          type: string
          description: Street number of the dropoff address.
        dropoff_address_secondary_number:
          type: string
          description: Apartment or suite number for the dropoff address.
        dropoff_address_county:
          type: string
          description: County of the dropoff address.
        dropoff_address_state:
          type: string
          description: State of the dropoff address.
        dropoff_address_postal_code:
          type: string
          description: Postal or ZIP code of the dropoff address.
        dropoff_address_latitude:
          type: number
          description: Latitude coordinate of the dropoff address.
        dropoff_address_longitude:
          type: number
          description: Longitude coordinate of the dropoff address.
        dropoff_name:
          type: string
          description: Name of the contact person at the dropoff location.
        dropoff_phone_number:
          type: string
          maxLength: 15
          description: Phone number of the dropoff contact person.
        dropoff_instructions:
          type: string
          maxLength: 512
          description: Additional instructions for the dropoff.
        dropoff_email:
          type: string
          format: email
          description: Email address of the dropoff contact person.
        package_minimum_vehicle_size:
          type: string
          enum:
            - SEDAN
            - CAR
            - SUV
            - PICKUP_TRUCK
            - VAN
            - TRUCK
            - LARGE_VAN
            - EXTRA_LARGE_VAN
            - PICKUP
          description: Minimum vehicle type required to transport the package.
        package_delivery_mode:
          type: string
          enum:
            - NOW
            - SCHEDULED
          description: Mode of delivery (NOW or SCHEDULED).
        package_description:
          type: string
          maxLength: 512
          description: Description of the package contents.
        package_requirements:
          type: array
          items:
            type: string
            enum:
              - PHOTO_PROOF_OF_DELIVERY
              - SIGNATURE_PROOF_OF_DELIVERY
              - TWO_PERSON_TEAM
          description: Special delivery or pickup requirements.
        items:
          type: array
          items:
            type: object
            properties:
              name:
                type: string
              description:
                type: string
              quantity:
                type: integer
              external_id:
                type: string
              external_instance_id:
                type: string
              price:
                type: number
                format: float
              barcode:
                type: string
            required:
              - name
              - quantity
          description: List of items included in the delivery.
        items_count:
          type: integer
          description: Total count of items.
        email:
          type: string
          format: email
          description: Customer email address for notifications.
        delivery_date:
          type: string
          format: date
          description: >-
            Delivery date (YYYY-MM-DD). Required unless `package_delivery_mode`
            is `NOW`. If a time component is included it is honoured; otherwise
            `dropoff_start_time` is used to determine the scheduled moment.
        delivery_start_time:
          type: string
          format: time
          description: Start time of the delivery window (HH:MM:SS).
        delivery_end_time:
          type: string
          format: time
          description: End time of the delivery window (HH:MM:SS).
        package_value:
          type: number
          format: float
          minimum: 0
          description: Monetary value of the package.
        tip:
          type: number
          format: float
          minimum: 0
          description: Optional tip for the delivery.
        currency:
          type: string
          maxLength: 3
          description: The intended currency.
        partner_reference:
          type: string
          maxLength: 256
          description: Custom reference provided by the partner.
        partner_payload:
          type: object
          format: json
          description: Optional custom payload for partner systems.
        delivery_style:
          type: string
          nullable: true
          enum:
            - Standard
            - Special Handling
          description: >-
            The delivery style. Can be Standard or Special Handling. Please
            contact us to unlock more delivery styles and associated features.
      required:
        - pickup_address_city
        - pickup_address_country
        - pickup_address_street
        - pickup_name
        - dropoff_address
        - dropoff_name
        - email
        - currency
    OrderCreated:
      type: object
      description: Successful response returned after an order is created.
      properties:
        message:
          type: string
          example: Order created successfully
        uid:
          type: string
          description: Unique identifier of the created order
          example: ord_123456
        data:
          type: object
          properties:
            status:
              type: string
              example: created
            partner_reference:
              type:
                - string
                - 'null'
              example: partner_xyz_001
          required:
            - status
        tracking_url:
          type: string
          format: uri
          description: A URL to track the delivery in real time.
          example: https://track.unihop.app/ord_123456
      required:
        - message
        - uid
        - data
    Error:
      required:
        - error
        - message
      type: object
      properties:
        error:
          type: string
          description: A string error code identifying the type of error.
        message:
          type: string
          description: A human-readable message describing the error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````