POST /ext/estimate

request delivery estimates for a new dispatch

application/json

Body Required

to fetch estimated wait times and delivery prices

  • pickup object Required
    Hide pickup attributes Show pickup attributes object
    • ref_id string

      Unique identifier for an address

    • lat number(double) Required
    • lng number(double) Required
    • address_line string
  • destination object Required
    Hide destination attributes Show destination attributes object
    • ref_id string

      Unique identifier for an address

    • lat number(double) Required
    • lng number(double) Required
    • address_line string
  • pickup_wait_time integer

    wait time of a restaurant in minutes

Responses

  • 200 application/json

    Successful operation

    Hide response attribute Show response attribute object
    • data object
      Hide data attributes Show data attributes object
      • pickup_estimated_time integer

        estimated time to a restaurant in minutes

      • destination_estimated_time integer

        estimated time from pickup tp destination in minutes

      • total_estimated_time integer

        total estimated time including pickup wait time in minutes

      • delivery_price number(float)
      • delivery_price_text string

        delivery price including the currency symbol

      • vat_price number(float)
      • vat_price_text string

        vat price including the currency symbol

  • 401 application/json

    Unauthorized if incorrect api_key is given

    Hide response attributes Show response attributes object
    • error string

      generic information about the error

    • error_desc string

      error information for the developer

  • 500 application/json

    any other errors from the server

    Hide response attributes Show response attributes object
    • error string

      generic information about the error

    • error_desc string

      error information for the developer

POST /ext/estimate
curl \
 --request POST 'https://dev.hubz.nyotek.com/ext/estimate' \
 --header "Content-Type: application/json" \
 --data '{"pickup":{"ref_id":"b93d16aa-e34d-4c65-b6ef-acdcca470615","lat":24.712181,"lng":46.679747,"address_line":"ابي البدر الموسوي, As Sulimaniyah, Riyadh 12244, Saudi Arabia"},"destination":{"ref_id":"b93d16aa-e34d-4c65-b6ef-acdcca470615","lat":24.712181,"lng":46.679747,"address_line":"ابي البدر الموسوي, As Sulimaniyah, Riyadh 12244, Saudi Arabia"},"pickup_wait_time":20}'
Request examples
{
  "pickup": {
    "ref_id": "b93d16aa-e34d-4c65-b6ef-acdcca470615",
    "lat": 24.712181,
    "lng": 46.679747,
    "address_line": "ابي البدر الموسوي, As Sulimaniyah, Riyadh 12244, Saudi Arabia"
  },
  "destination": {
    "ref_id": "b93d16aa-e34d-4c65-b6ef-acdcca470615",
    "lat": 24.712181,
    "lng": 46.679747,
    "address_line": "ابي البدر الموسوي, As Sulimaniyah, Riyadh 12244, Saudi Arabia"
  },
  "pickup_wait_time": 20
}
Response examples (200)
{
  "data": {
    "pickup_estimated_time": 20,
    "destination_estimated_time": 20,
    "total_estimated_time": 20,
    "delivery_price": 42.0,
    "delivery_price_text": "string",
    "vat_price": 42.0,
    "vat_price_text": "string"
  }
}
Response examples (401)
{
  "error": "generic error",
  "error_desc": "identifier 45 not found"
}
Response examples (500)
{
  "error": "generic error",
  "error_desc": "identifier 45 not found"
}