Point of Sale Staff API Flow

To provide the proper experience to staff using the Point of Sale (POS) API, you’ll need to build the following capabilities:

  1. View new orders
  2. Prioritize orders
  3. Initiate order preparation
  4. View order prep by stations
  5. View dish ingredients
  6. Ready the order for assembly
  7. Assemble the order

Step 1: View new orders

Once an order is placed, it will appear on the staff expeditor’s terminal.

Request

The client sends an HTTP request to retreive the list of orders in the Received status, sorted by the created_at field so the newest order displays first. Additionally, the terminal should limit the view to 10 orders per page.

Endpoint: GET /orders

curl -X 'GET' \
  'https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders?filter=status.eq~Received&limit=10&offset=0&order=desc&sort=created_date' \
  -H 'accept: application/json'

Response

If the request was successful, the server responds with a 200 okay status code with the response body containing the new orders and their related properties.

Step 2: Prioritize orders

The expeditor may need to adjust the priority of an order. By default, all orders have a priority of 3. The expeditor can increase the priority to 1 or decrease to 5 depending on the situation.

Request

The client sends an HTTP request to increase the order priority to 1. You’ll need the order’s id to make this request as well as the required order properties for the request body.

Endpoint: PUT /orders/{id}

curl -X 'PUT' \
  'https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -d '{
    "name": "Sarah",
    "table_number": 13,
    "status": "Received",
    "priority": 1,
    "dish_ids": [
      "{id}"
      ],
    }'

Response

If the request was successful, the server responds with a 200 OK status code with the response body containing the updated resource.

Step 3: Initiate order preparation

The expeditor can now update the order status to In Progress. This change in status allows the staff at the various stations to see the list of dishes they need to prepare.

Request

The client sends an HTTP request to change the status of an order from Received to In Progress. You’ll need the order’s id to make this request as well as the required order properties for the request body.

Endpoint: PUT /orders/{id}

curl -X 'PUT' \
  'https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -d '{
    "name": "Sarah",
    "table_number": 13,
    "status": "In Progress",
    "priority": 1,
    "dish_ids": [
      "{id}"
      ],
    }'

Response

If the request was successful, the server responds with a 200 OK status code with the response body containing the updated resource.

Step 4: View order prep by station

The staff at their various stations should now be able to see which orders to prepare and which dishes in the order are prepared at their station.

Station values are:

  • hot
  • cold
  • beverage

Request

The client sends an HTTP request to retreive the orders, filtering the response to only include dishes belonging to a specific station. You’ll need the order’s id for this request.

Endpoint: GET /orders/{id}/dishes

curl -X 'GET' \
  'https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}/dishes?filter=station.eq~hot' \
  -H 'accept: application/json'

Response

If the request was successful, the server responds with a 200 OK status code with the response body containing all dishes for the order that belong to the specified station.

The client app stores the dish ids to local storage to use in the next step.

Step 5: View dish ingredients

To prepare the dishes, the staff at each station will need to see the dish’s ingredients.

Request

The client sends an HTTP request to retreive the ingredients for each dish. You’ll need the dish id for this request, which the client app has saved in local storage.

Endpoint: GET /dishes/{id}/ingredients

curl -X 'GET' \
  'https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/dishes/{id}/ingredients' \
  -H 'accept: application/json'

Response

If the request was successful, the server responds with a 200 OK status code with the response body containing an array of the dish’s ingredients.

Step 6: Ready the order for assembly

Once a station has finished preparing their dishes, they will update it as Ready for assembly on their terminal. The expeditor is then notified when all dishes in an order have been marked as ready.

This process is managed within the client app logic and no API calls are required for this step.

Step 7: Assemble the order

The expeditor assembles the dishes from the stations to complete the order. Once assembled, the expeditor updates the order status to On the way for table-side orders or Ready for Pickup for take-away orders.

Request

The client sends an HTTP request to update the status of the order from In Progress to On the way. You’ll need the order id for this request and the required properties for the request body.

Endpoint: PUT /orders/{id}

curl -X 'PUT' \
  'https://reimagined-journey-g45xxv4v6gwhvrrr-80.app.github.dev/orders/{id}' \
  -H 'accept: application/json' \
  -H 'content-type: application/json' \
  -d '{
    "name": "Sarah",
    "table_number": 13,
    "status": "On the way",
    "priority": 1,
    "dish_ids": [
      "{id}"
      ],
    }'

Response

If the request was successful, the server responds with a 200 OK status code with the response body containing the updated resource.