Booking

Check Booking Availability

Checks whether one more order could be fitted in on a given date before you accept the booking. Nothing is created or reserved, and the response is just {"booking": {"available": true|false}}.

Availability is worked out by running the routing engine on the spot. It takes every order already scheduled for date in this depot, adds the order you describe, and plans the whole day from scratch on either the vehicles you list in vehicles or, if you leave that out, all active vehicles. available is true only if every stop, both the existing ones and the new one, fits into a route. Your existing plans and routes for that day are not used. So a day that is already overbooked returns false even when the new order itself would fit.

  • The order's location comes from delivery_* fields for delivery orders and from pickup_* fields otherwise. If you don't send both lat and lng, the address and postcode are geocoded first. If geocoding fails you get 400 GEOCODING_FAILED.
  • Capacity ids that don't belong to the depot are ignored, and so are vehicle ids that don't belong to it. Look up valid capacity ids with GET /capacities.
  • If any vehicle used for the check has no shift on that weekday, the request fails with 400 INVALID_INPUT.

The call waits for the routing engine to finish, so it is much slower than a normal read. It also has a stricter rate limit of 5 / min (see Rate Limits), so call it when a customer is booking, not in bulk.

post/booking/availability

Request

  • Base URL: https://api.smartroutes.io/v2
  • URL: https://api.smartroutes.io/v2/booking/availability
  • Auth: none declared

Request body

datestring date required

Requested date for order collection/delivery.

Response

Successful response

Changes

No recorded changes to this operation across all 1 revision of this API.