POST /ext/dispatch

Create a new dispatch request with a pickup and delivery address

application/json

Body

Create a new dispatch

  • 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
  • user_metadata object Required
    Hide user_metadata attributes Show user_metadata attributes object
    • id string Required

      unique identifier for a user

    • username string
    • firstName string
    • lastName string
    • email string Required
    • phone string Required
  • vendor_logo_url string

    restaurant logo url

  • vendor_id string Required

    Restaurant unique identifier

  • vendor_name object Required

    locale based text objects

    Hide vendor_name attribute Show vendor_name attribute object
    • * string Required Additional properties

      locale based text objects

  • vendor_oid string Required

    unique order identifier

  • vendor_sid string

    unique short readable identifier

  • vendor_bid string Required

    unique restaurant branch identifier

  • vendor_payload object
    Hide vendor_payload attributes Show vendor_payload attributes object
    • pickup_wait_time integer

      wait time in minutes at the pickup/restaurant

    • order_price number(float)
    • currency string

      ISO-4217 three letter currency code

    • payment_type string

      payment type used

      Values are AMEX, CASH, VISA, MASTERCARD, or MASTER.

    • order_details array[object]

      order details of a dispatch

      Hide order_details attributes Show order_details attributes object
      • item_name object

        locale based order item name

        Hide item_name attribute Show item_name attribute object
        • * string Additional properties

          locale based order item name

      • count integer

        quantiy of the order item

      • price number(float)

        price of the order item

Responses

  • 201 application/json

    Successful operation

    Hide response attribute Show response attribute object
    • data object
      Hide data attribute Show data attribute object
      • id string

        unique identifier of a dispatch

  • 400 application/json

    if a dispatch with a an existing order/vendor_oid exists

    Hide response attributes Show response attributes object
    • error string

      generic information about the error

    • error_desc string

      error information for the developer

  • 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/dispatch
curl \
 --request POST 'https://dev.hubz.nyotek.com/ext/dispatch' \
 --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"},"user_metadata":{"id":"15ed2668-f118-40c3-a52c-8ad90fe11ed7","username":"theUser","firstName":"John","lastName":"James","email":"john@email.com","phone":9669876654321},"vendor_logo_url":"https://picsum.photos/200/300","vendor_id":"15ed2668-f118-40c3-a52c-8ad90fe11ed7","vendor_name":{"ar-sa":"جملة عربية","en-us":"English based text"},"vendor_oid":"15ed2668-f118-40c3-a52c-8ad90fe11ed7","vendor_sid":"15EEDFRG","vendor_bid":"15ed2668-f118-40c3-a52c-8ad90fe11ed7","vendor_payload":{"pickup_wait_time":20,"order_price":123.65,"currency":"SAR","payment_type":"AMEX","order_details":[{"item_name":{"ar-sa":"جملة عربية","en-us":"English based text"},"count":2,"price":23.45}]}}'
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"
  },
  "user_metadata": {
    "id": "15ed2668-f118-40c3-a52c-8ad90fe11ed7",
    "username": "theUser",
    "firstName": "John",
    "lastName": "James",
    "email": "john@email.com",
    "phone": 9669876654321
  },
  "vendor_logo_url": "https://picsum.photos/200/300",
  "vendor_id": "15ed2668-f118-40c3-a52c-8ad90fe11ed7",
  "vendor_name": {
    "ar-sa": "جملة عربية",
    "en-us": "English based text"
  },
  "vendor_oid": "15ed2668-f118-40c3-a52c-8ad90fe11ed7",
  "vendor_sid": "15EEDFRG",
  "vendor_bid": "15ed2668-f118-40c3-a52c-8ad90fe11ed7",
  "vendor_payload": {
    "pickup_wait_time": 20,
    "order_price": 123.65,
    "currency": "SAR",
    "payment_type": "AMEX",
    "order_details": [
      {
        "item_name": {
          "ar-sa": "جملة عربية",
          "en-us": "English based text"
        },
        "count": 2,
        "price": 23.45
      }
    ]
  }
}
Response examples (201)
{
  "data": {
    "id": "01HQ0PV32FMRA1XGT609QFV2VJ"
  }
}
Response examples (400)
{
  "error": "generic error",
  "error_desc": "identifier 45 not found"
}
Response examples (401)
{
  "error": "generic error",
  "error_desc": "identifier 45 not found"
}
Response examples (500)
{
  "error": "generic error",
  "error_desc": "identifier 45 not found"
}