orders

Create a new order

Changed on

Places a new order with burgers (requires userId). French fries are included as a side for every burger order.

Limitations:

  • Maximum 5 active orders per user
  • Maximum 50 burgers total per order
post/orders

Request

  • Base URL
    <BURGER_API_HOST>/api (relative, and the document was published on a file host, not at the API’s origin)
  • URL
    <BURGER_API_HOST>/api/orders
  • Auth
    none declared

Request body

userIdstring required
nicknamestring

Optional nickname for the order (only first 10 chars displayed)

Example request

{
  "userId": "user123",
  "nickname": "John",
  "items": [
    {
      "burgerId": "burger-1",
      "quantity": 1,
      "extraToppingIds": [
        "topping-1",
        "topping-2"
      ]
    }
  ]
}

Response

Order created successfully

idstring required
createdAtstring date-time required
estimatedCompletionAtstring date-time required
completedAtstring date-time

ISO date string for when the order was completed (undefined until completed)

nicknamestring

Optional nickname for the order

totalPricenumber float required
status'pending' | 'in-preparation' | 'ready' | 'completed' | 'cancelled' required
  • pending: Order has been created but not yet started - in-preparation: Order is being prepared - ready: Order is ready for pickup - completed: Order has been picked up - cancelled: Order has been cancelled

Example response

{
  "items": [
    {
      "burgerId": "burger-1",
      "quantity": 1,
      "extraToppingIds": [
        "topping-1",
        "topping-2"
      ]
    }
  ]
}

Changes

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status

    • warning

      removed the request property

    • warning

      removed the optional property from the response with the status