Resources
Find what you need here

Quotes API

Generate and manage quotes programmatically through our Quotes API endpoints.

Generate Quote

Create a new quote based on market rates and your pricing strategy.

Endpoint

POST /api/v1/quotes

Request Body Parameters

ParameterTypeRequiredDescription
originstringYesOrigin city or zip code
destinationstringYesDestination city or zip code
equipment_typestringYesType of equipment (e.g., 'dryvan', 'reefer')
pickup_datestringYesRequested pickup date (YYYY-MM-DD)
special_requirementsarrayNoArray of special requirements
customer_referencestringNoCustomer's reference number

Example Request

curl -X POST 'https://api.drayrates.ai/api/v1/quotes' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '{
    "origin": "USLAX",
    "destination": "USCHI",
    "equipment_type": "dryvan",
    "pickup_date": "2024-04-01",
    "special_requirements": ["liftgate", "inside_delivery"],
    "customer_reference": "PO-123456"
  }'

Example Response

{
  "quote": {
    "quote_id": "Q-2024-123456",
    "status": "active",
    "expiry_date": "2024-03-27T23:59:59Z",
    "pricing": {
      "base_rate": 2850.0,
      "fuel_surcharge": 425.0,
      "accessorial_charges": {
        "liftgate": 75.0,
        "inside_delivery": 100.0
      },
      "total_rate": 3450.0,
      "currency": "USD"
    },
    "service_details": {
      "estimated_transit_days": 3,
      "guaranteed_service": false,
      "pickup_date": "2024-04-01",
      "estimated_delivery_date": "2024-04-04"
    }
  }
}

Retrieve Quote

Get details of an existing quote.

Endpoint

GET /api/v1/quotes/{quote_id}

Path Parameters

ParameterTypeRequiredDescription
quote_idstringYesUnique quote identifier

Example Request

curl -X GET 'https://api.drayrates.ai/api/v1/quotes/Q-2024-123456' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Example Response

{
  "quote": {
    "quote_id": "Q-2024-123456",
    "status": "active",
    "created_at": "2024-03-20T15:30:00Z",
    "expiry_date": "2024-03-27T23:59:59Z",
    "pricing": {
      "base_rate": 2850.0,
      "fuel_surcharge": 425.0,
      "accessorial_charges": {
        "liftgate": 75.0,
        "inside_delivery": 100.0
      },
      "total_rate": 3450.0,
      "currency": "USD"
    },
    "service_details": {
      "estimated_transit_days": 3,
      "guaranteed_service": false,
      "pickup_date": "2024-04-01",
      "estimated_delivery_date": "2024-04-04"
    },
    "customer_reference": "PO-123456"
  }
}

List Quotes

Retrieve a list of quotes with optional filtering.

Endpoint

GET /api/v1/quotes

Query Parameters

ParameterTypeRequiredDescription
statusstringNoFilter by quote status ('active', 'expired', 'converted')
start_datestringNoFilter by creation date range start (YYYY-MM-DD)
end_datestringNoFilter by creation date range end (YYYY-MM-DD)
limitintegerNoNumber of quotes to return (default: 20, max: 100)
offsetintegerNoNumber of quotes to skip (default: 0)

Example Request

curl -X GET 'https://api.drayrates.ai/api/v1/quotes?status=active&start_date=2024-03-01' \
  -H 'Authorization: Bearer YOUR_API_KEY'

Example Response

{
  "quotes": [
    {
      "quote_id": "Q-2024-123456",
      "status": "active",
      "created_at": "2024-03-20T15:30:00Z",
      "total_rate": 3450.0,
      "currency": "USD",
      "route": {
        "origin": "USLAX",
        "destination": "USCHI"
      }
    }
  ],
  "pagination": {
    "total_count": 45,
    "limit": 20,
    "offset": 0
  }
}

Error Responses

Status CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
404Not Found - Quote not found
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Error Response Example

{
  "error": {
    "code": "QUOTE_NOT_FOUND",
    "message": "The requested quote could not be found",
    "details": {
      "quote_id": "Q-2024-INVALID"
    }
  }
}