To receive a price quote for a potential order
Quote Orders: Clients can use this endpoint to receive quotes for their own orders. Couriers can use this endpoint on the behalf of clients to generate prices for orders.
This endpoint allows clients with configured services to receive price quotes for an upcoming order. All service options compatible with the submitted information will be included, along with pricing information.
This endpoint should not be used for clients who are not configured with services.
Name | Type | Description |
---|---|---|
readyBy | number | Required. A timestamp in unix time for the earliest time the task should be completed, in milliseconds precision. |
dueBy | number | A timestamp in unix time for the earliest time the task should be completed, in milliseconds precision. |
quantity | number | Required. Number of pieces included in order. An integer |
weight | object | Required. An object including “value” and “units”, i.e. {“value” : 3, “units”: "lb"} |
pickup | object | Required. An address object consists of components outlined in Create destination. The location array is not required, but can be included. |
dropoff | object | Required. An address object consists of components outlined in Create destination. The location array is not required, but can be included. |
Additionally, the weight
object should include these elements:
Name | Type | Description |
---|---|---|
units | string | This is either a kg or lb . |
value | number | The value of the weight |
curl -X POST "https://onfleet.com/api/v2/deliveryServices/quote?clientId=6n0I3DpPm3ALr*A5RS8MxKL5" \
-u "<api key>:"\
-d '{
"readyBy": 1757941200000,
"dueBy": 1757970000000,
"quantity": 1,
"weight": {
"value": 3,
"units": "lb"
},
"pickup": {
"location": [
-73.96321329999999,
40.6710689
],
"address": {
"number": "200",
"street": "Eastern Parkway",
"city": "Brooklyn",
"state": "New York",
"postalCode": "11238",
"country": "United States",
"apartment": ""
}
},
"dropoff": {
"location": [
-73.96321329999999,
40.6710689
],
"address": {
"number": "200",
"street": "Eastern Parkway",
"city": "Brooklyn",
"state": "New York",
"postalCode": "11238",
"country": "United States",
"apartment": ""
}
}
}'
Example response JSON payload:
[
{
"id": "2dZpt0hCPB9jFfTo8zWKS~iF",
"rateId": "HkEvIDo4TJK9I1AK6Fk3gv~J",
"organization": "id6a7XAWagLC7iMR0NvW1DFM",
"displayName": "NYC Courier",
"dueBy": 1757948400000,
"estimatedCost": 6,
"estimatedCostBreakdown": [
{
"name": "Piece cost",
"ratingType": "piece",
"isBaseRate": true,
"cost": 1
},
{
"name": "Min. price difference",
"ratingType": "minPrice",
"isBaseRate": false,
"cost": 5
}
],
"currency": "USD"
},
{
"id": "rw3Gwt~wRIgTn159so*tIcWa",
"rateId": "HkEvIDo4TJK9I1AK6Fk3gv~J",
"organization": "id6a7XAWagLC7iMR0NvW1DFM",
"displayName": "1 hour morning rush",
"dueBy": 1757944800000,
"estimatedCost": 6,
"estimatedCostBreakdown": [
{
"name": "Piece cost",
"ratingType": "piece",
"isBaseRate": true,
"cost": 1
},
{
"name": "Min. price difference",
"ratingType": "minPrice",
"isBaseRate": false,
"cost": 5
}
],
"currency": "USD"
}
]
After receiving this response, the "id" value may be used as the "deliveryServiceId" in a Create Order request.