Point of Service API Admin Flow
The admin panel is used to create user accounts for the POS system, create and update dishes, and create and update dish ingredients. To provide the proper experience for the admin panel, you’ll need to provide the following capabilities:- Admin login
- Create ingredients
- Create dishes
Step 1: Admin Login
The admin will log into the POS admin panel using their username and password.Request
The client sends an HTTP request to exchange the user’s username and password for an access token. Endpoint:POST /auth/token
Response
If the request was successful, the server responds with a201 Created status code with the response body containing access token.
Step 2: Create Ingredients
Ingredients are components of dishes. Admins create ingredients and specify their quantity so they can track inventory and ensure patrons cannot order dishes that can’t be made due to insufficient ingredient stock.Request
The client sends an HTTP request to create a new ingredient and specify the in stock quantity. Endpoint:POST /ingredients
Response
If the request was successful, the server responds with a201 Created status code with the response body containing the full resource.
The ingredient object contains the following properties:
Step 3: Create Dishes
Admins create dishes by associated them with the necessary ingredients. The request body for creating dishes should contain the following properties:Request
The client sends an HTTP request to{describe the purpose of the API request}.
Endpoint: POST /dishes
Response
If the request was successful, the server responds with a201 Created status code with the response body containing new resource and the dish_id, which you’ll use in numerous requests in both the patron and staff flows.