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

# Quote a merchant delivery fee that is honoured for 15 minutes

> Prices the road route between the two points with the merchant's current tariff, exactly as shipment creation does, and returns a quoteId valid until expiresAt (15 minutes). A shipment created with that quoteId before it expires, for the same pickup and destination points, is charged this price even if the tariff changes in between. A quote prices at most one shipment. Without a quoteId, creation prices the shipment again. To quote a shipment that will be created with pickup.savedLocationCode, quote with that location's merchantId, branchId and pickupLocationId (from GET /api/v2/external/pickup-locations); a quote priced from a different pickup point is refused at creation with QUOTE_MISMATCH. No reservation of driver capacity is made; check availability with /api/v2/external/serviceability.



## OpenAPI

````yaml /openapi.yaml post /api/v2/external/quotes
openapi: 3.1.0
info:
  title: DropHub External API
  version: v2
  description: The public machine-to-machine integration surface of DropHub.
servers:
  - url: https://api-test.drop-hub.com
    description: Sandbox. Isolated data and credentials.
  - url: https://api.drop-hub.com
    description: Production. Production credentials only.
security: []
tags:
  - name: Authentication
    description: >-
      Authentication, sessions, the company a principal is, and merchant API
      credentials
  - name: External Shipments
    description: OAuth-scoped Merchant shipment creation, lookup, and cancellation
  - name: External Tracking
    description: Merchant-authenticated and privacy-minimized public tracking projections
  - name: External Webhooks
  - name: Sandbox
    description: >-
      Tenant-bound self-service fixture lifecycle, available only on the
      isolated sandbox deployment
paths:
  /api/v2/external/quotes:
    post:
      tags:
        - External Shipments
      summary: Quote a merchant delivery fee that is honoured for 15 minutes
      description: >-
        Prices the road route between the two points with the merchant's current
        tariff, exactly as shipment creation does, and returns a quoteId valid
        until expiresAt (15 minutes). A shipment created with that quoteId
        before it expires, for the same pickup and destination points, is
        charged this price even if the tariff changes in between. A quote prices
        at most one shipment. Without a quoteId, creation prices the shipment
        again. To quote a shipment that will be created with
        pickup.savedLocationCode, quote with that location's merchantId,
        branchId and pickupLocationId (from GET
        /api/v2/external/pickup-locations); a quote priced from a different
        pickup point is refused at creation with QUOTE_MISMATCH. No reservation
        of driver capacity is made; check availability with
        /api/v2/external/serviceability.
      operationId: createExternalShipmentQuote
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ShipmentPriceEstimateRequest'
      responses:
        '200':
          description: Current quote
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ShipmentPriceEstimate'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/AuthenticationFailed'
        '403':
          $ref: '#/components/responses/AccessDenied'
        '422':
          $ref: '#/components/responses/ValidationFailed'
        '429':
          $ref: '#/components/responses/RateLimited'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - oauthClientCredentials:
            - quotes:write
components:
  schemas:
    ShipmentPriceEstimateRequest:
      type: object
      additionalProperties: false
      description: >-
        The pickup is a saved branch and pickup location, or an exact pickup
        point; a point, when given, is what the route is measured from.
      required:
        - merchantId
        - destinationLatitude
        - destinationLongitude
      properties:
        merchantId:
          type: string
          format: uuid
        branchId:
          type:
            - string
            - 'null'
          format: uuid
        pickupLocationId:
          type:
            - string
            - 'null'
          format: uuid
        destinationLatitude:
          type: number
          minimum: -90
          maximum: 90
        destinationLongitude:
          type: number
          minimum: -180
          maximum: 180
        pickupLatitude:
          type:
            - number
            - 'null'
          minimum: -90
          maximum: 90
          description: >-
            The exact pickup point, when one was chosen; the location's own
            otherwise.
        pickupLongitude:
          type:
            - number
            - 'null'
          minimum: -180
          maximum: 180
    ShipmentPriceEstimate:
      type: object
      additionalProperties: false
      required:
        - distanceMetres
        - durationSeconds
        - price
        - routeGeometry
        - routeGeometryFormat
      properties:
        distanceMetres:
          type: integer
          format: int64
          minimum: 0
        durationSeconds:
          type: integer
          format: int64
          minimum: 0
        price:
          type: object
          additionalProperties: false
          required:
            - amount
            - currency
          properties:
            amount:
              type: number
            currency:
              type: string
              example: SAR
        routeGeometry:
          type: string
        routeGeometryFormat:
          type: string
        quoteId:
          description: >-
            Present only on POST /api/v2/external/quotes; null on non-binding
            estimates.
          oneOf:
            - $ref: '#/components/schemas/Uuid'
            - type: 'null'
        expiresAt:
          description: When the quoteId stops being accepted at shipment creation.
          oneOf:
            - $ref: '#/components/schemas/InstantUtc'
            - type: 'null'
    Uuid:
      type: string
      format: uuid
    InstantUtc:
      type: string
      format: date-time
    Problem:
      type: object
      description: RFC 9457 Problem Details with stable DropHub extensions
      additionalProperties: true
      required:
        - type
        - title
        - status
        - code
        - timestamp
        - correlationId
        - requestId
      properties:
        type:
          type: string
          format: uri
        title:
          type: string
          maxLength: 128
        status:
          type: integer
          format: int32
          minimum: 400
          maximum: 599
        detail:
          type: string
          maxLength: 512
        instance:
          type: string
          format: uri-reference
        code:
          type: string
          pattern: ^[A-Z][A-Z0-9_]{1,63}$
        timestamp:
          type: string
          format: date-time
        correlationId:
          type: string
          format: uuid
        requestId:
          type: string
          format: uuid
        violations:
          type: array
          maxItems: 20
          items:
            $ref: '#/components/schemas/Violation'
      example:
        type: https://api.drophub.example/problems/access-denied
        title: Access denied
        status: 403
        detail: Access to this resource is denied.
        instance: /api/v2/external/shipments/018f2d8a-1f00-7000-8000-000000000206
        code: ACCESS_DENIED
        timestamp: '2026-08-22T18:30:00Z'
        correlationId: 018f2d8a-1f00-7000-8000-000000000207
        requestId: 018f2d8a-1f00-7000-8000-000000000208
    Violation:
      type: object
      additionalProperties: false
      required:
        - field
        - code
        - message
      properties:
        field:
          type: string
          maxLength: 128
        code:
          type: string
          maxLength: 64
        message:
          type: string
          maxLength: 256
  responses:
    BadRequest:
      description: >-
        The request syntax, path parameter, query parameter, or JSON document is
        malformed.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    AuthenticationFailed:
      description: Authentication failed without account, token, or tenant enumeration.
      headers:
        WWW-Authenticate:
          $ref: '#/components/headers/WwwAuthenticate'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          example:
            type: https://api.drophub.example/problems/authentication-required
            title: Authentication required
            status: 401
            detail: Authentication is required for this resource.
            instance: /api/v2/external/shipments/018f2d8a-1f00-7000-8000-000000000206
            code: AUTHENTICATION_REQUIRED
            timestamp: '2026-08-22T18:30:00Z'
            correlationId: 018f2d8a-1f00-7000-8000-000000000207
            requestId: 018f2d8a-1f00-7000-8000-000000000208
    AccessDenied:
      description: >-
        Access denied without exposing internal policy or resource ownership. No
        operation requires a second factor or a fresher live session.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    ValidationFailed:
      description: The request fails strict syntax or semantic validation.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    RateLimited:
      description: The security operation is temporarily rate limited.
      headers:
        Retry-After:
          description: Suggested delay in seconds when available.
          schema:
            type: integer
            minimum: 1
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
    ServiceUnavailable:
      description: A required qualified external provider is not configured or available.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
  headers:
    WwwAuthenticate:
      description: Bearer challenge for an unauthenticated or invalid-token request.
      schema:
        type: string
        example: Bearer
  securitySchemes:
    oauthClientCredentials:
      type: oauth2
      description: >-
        OAuth 2.0 client-credentials flow for external machine-to-machine
        integrations.
      flows:
        clientCredentials:
          tokenUrl: /api/v2/oauth/token
          scopes:
            quotes:write: Calculate shipment quotes without creating shipments
            shipments:read: Read Merchant-owned shipments
            shipments:write: Create and cancel Merchant-owned shipments
            tracking:read: Read merchant-owned shipment tracking projections
            webhooks:manage: Configure and rotate the merchant's single signed shipment webhook

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.