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

# Quote a Delivery

> Price and distance, without creating anything



## OpenAPI

````yaml platforms/api-reference/openapi.json POST /quote
openapi: 3.1.0
info:
  title: UniHop Platform API
  description: >-
    Book and track UniHop last-mile deliveries on behalf of the merchants on
    your platform. Your platform identifier lives in the URL; the merchant's own
    API key authenticates the request.
  version: 1.0.0
servers:
  - url: https://backend.unihop.app/api/v1/{platform}
    description: Production
    variables:
      platform:
        default: your_platform
        description: The platform identifier UniHop issued you at onboarding.
security:
  - apiKeyAuth: []
paths:
  /quote:
    post:
      summary: Quote a delivery
      description: >-
        Prices a delivery without creating one. Takes the same body as `POST
        /deliveries`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DeliveryRequest'
      responses:
        '200':
          description: The quote.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QuoteResponse'
        '401':
          description: The API key is missing, invalid, or not valid for this platform.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The body failed validation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
components:
  schemas:
    DeliveryRequest:
      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.
        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.
        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.
        platform_payload:
          type: object
          description: >-
            An arbitrary object of your own: order IDs, store IDs, anything you
            need to match this delivery back to your system. Stored untouched
            and returned on every read and webhook.
          example:
            store_id: corner-bakery-cambridge
            order_id: '10482'
      required:
        - pickup_address_street
        - pickup_address_city
        - pickup_address_country
        - pickup_name
        - dropoff_address_street
        - dropoff_address_city
        - dropoff_address_country
        - dropoff_name
        - email
      description: A delivery to create. The same body is accepted by POST /quote.
    QuoteResponse:
      type: object
      description: Successful response returned for a delivery quote.
      properties:
        message:
          type: string
          example: Quote created successfully
        data:
          type: object
          properties:
            price:
              type: object
              properties:
                delivery_fee:
                  type: number
                  format: float
                  description: The estimated delivery fee.
                  example: 12.5
                tip:
                  type: number
                  format: float
                  description: The tip amount.
                  example: 23
                currency:
                  type: string
                  description: The currency of the delivery fee.
                  example: USD
              required:
                - delivery_fee
                - tip
                - currency
            distance:
              type: number
              format: float
              description: The delivery distance in miles.
              example: 0.61
          required:
            - price
            - distance
      required:
        - message
        - data
    Error:
      type: object
      properties:
        code:
          type: string
          description: >-
            Machine-readable error code, e.g. `not_found`, `not_cancelable`,
            `invalid_api_key`.
        message:
          type: string
          description: A human-readable description of what went wrong.
      required:
        - code
        - message
    ValidationError:
      type: object
      description: Returned when the body fails validation.
      properties:
        message:
          type: string
          example: The dropoff name field is required.
        errors:
          type: object
          description: Field name to a list of messages.
          additionalProperties:
            type: array
            items:
              type: string
      required:
        - message
  securitySchemes:
    apiKeyAuth:
      type: http
      scheme: bearer
      description: >-
        The merchant's UniHop API key, sent as `Authorization: Bearer <key>`. It
        identifies the merchant and is what their deliveries are billed against.

````