Price a delivery
const url = 'https://api.govza.app/v1/partner/quotes';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"pickup":{"latitude":43.342439,"longitude":45.693597},"dropoffs":[{"latitude":43.320872,"longitude":45.691756,"cargo_size":"M"},{"latitude":43.351021,"longitude":45.69154,"cargo_size":"S"}],"routing_mode":"sequential"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.govza.app/v1/partner/quotes \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "pickup": { "latitude": 43.342439, "longitude": 45.693597 }, "dropoffs": [ { "latitude": 43.320872, "longitude": 45.691756, "cargo_size": "M" }, { "latitude": 43.351021, "longitude": 45.69154, "cargo_size": "S" } ], "routing_mode": "sequential" }'Returns the price, distance and duration for a trip without creating
anything. Pass the returned quote_id to POST /orders to lock in
these prices; quotes expire after five minutes, after which the order is
re-priced at the current rate.
Authorizations
Заголовок раздела «Authorizations»Request Bodyrequired
Заголовок раздела «Request Bodyrequired»Pricing needs coordinates and cargo size, and nothing else — no addresses and no contact details. You can price a basket before the customer has typed an address, and you never send us personal data for a call that has no use for it.
object
object
object
Overrides the request-level cargo_size for this stop.
Applies to every dropoff that does not set its own. Cargo size is priced per destination, so it changes the quote.
sequential routes one chained trip through every dropoff in order.
parallel prices each dropoff independently from the pickup.
Example
{ "pickup": { "latitude": 43.342439, "longitude": 45.693597 }, "dropoffs": [ { "latitude": 43.320872, "longitude": 45.691756, "cargo_size": "M" }, { "latitude": 43.351021, "longitude": 45.69154, "cargo_size": "S" } ], "routing_mode": "sequential"}Responses
Заголовок раздела «Responses»The trip was priced.
object
object
Pass to POST /orders to keep these prices.
Sum of every leg, each including its cargo surcharge.
object
Metres.
Seconds.
Route price for this leg plus its cargo surcharge.
Example
{ "data": { "dropoffs": [ { "cargo_size": "S" } ] }}The payload was rejected. error.details is a JSON array of
{ field, message } covering every offending field, not just the
first, so one response is enough to fix the request.
object
object
Example
{ "success": false, "error": { "id": "validation.partner_payload_invalid", "message": "dropoffs.0.address.latitude: latitude is required", "details": "[{\"field\":\"dropoffs.0.address.latitude\",\"message\":\"latitude is required\"}]" }}The key is missing, malformed, revoked, or its account can no longer create orders.
object
object
Example
{ "success": false}