The Customer is the self-service role in Ordervista, designed for end-users who interact with the restaurant through the online storefront. Accounts withDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/ytabeloved/ordervista/llms.txt
Use this file to discover all available pages before exploring further.
id_rol: 3 are created through public self-registration — no administrator action is required to onboard a new customer. Once registered and logged in, a customer can browse the full active menu, build a cart, choose between delivery and takeaway order types, provide a delivery address where applicable, confirm their order, and return at any time to check the current status of past orders. Customers have no visibility into administrative, catalog-management, or operational screens.
Registration
Customers create their own accounts without any administrator involvement. The registration endpoint is publicly accessible — no JWT is required.id_rol: 3 automatically to every account created through this endpoint. After registration, the customer can log in via POST /api/auth/login to receive a JWT and begin placing orders.
Accessible Frontend Routes
After logging in, a Customer is directed to the customer-facing storefront. The following frontend routes are available to this role.| Route | Page | Purpose |
|---|---|---|
/menu | Menu | Browse all active products organised by category. |
/cart | Cart | Review selected items, adjust quantities, and proceed to checkout. |
/addresses | Addresses | Manage saved delivery addresses for use in delivery orders. |
/orders | Orders | View personal order history and track current order statuses. |
API Endpoints Accessible
All routes below require a valid JWT (Authorization: Bearer <token>). Routes marked authorizeRoles(3) are exclusive to Customers; routes marked verifyToken only are available to any authenticated user regardless of role.
Orders — authorizeRoles(3)
| Method | Endpoint | Action |
|---|---|---|
GET | /api/orders | List all orders placed by the logged-in customer. |
GET | /api/orders/:id | Get the full detail of one of the customer’s orders. |
POST | /api/orders | Place a new online order. |
Menu — verifyToken only (any authenticated user)
| Method | Endpoint | Action |
|---|---|---|
GET | /api/menu | Retrieve all active products available on the menu. |
Addresses — verifyToken only (any authenticated user)
| Method | Endpoint | Action |
|---|---|---|
GET | /api/addresses | List all saved addresses. |
POST | /api/addresses | Save a new delivery address. |
PUT | /api/addresses/:id | Update an existing saved address. |
DELETE | /api/addresses/:id | Remove a saved address. |
Workflow
Register or log in
New customers navigate to
/register and submit their details. The backend creates the account with id_rol: 3 automatically. Returning customers go to /login. Either path results in a JWT being stored in localStorage that authorises all subsequent requests.Browse the menu
Navigate to
/menu to see the full active product catalog returned by GET /api/menu. Products are organised by category so customers can quickly find what they are looking for.Add items to the cart
Select products and adjust quantities. The cart is managed client-side until the customer is ready to check out.
Select order type and address
Before confirming, the customer chooses an order type (
id_tipo_pedido) — Delivery, Retiro, or Consumo Local. For Delivery orders, the customer selects a saved address from /addresses or adds a new one via POST /api/addresses.Confirm the order
Submit the cart as a new order via
POST /api/orders. The request body includes the selected products, quantities, and the chosen id_tipo_pedido. The backend creates the order with an initial status of Pending (status ID 1).Order Types
Every order carries anid_tipo_pedido field that references the TIPOS_PEDIDO table. Customers select the appropriate type at checkout.
| Type ID | Name | Description |
|---|---|---|
1 | Delivery | Order is dispatched to a customer-provided address. |
2 | Retiro | Customer picks up the order at the restaurant. |
3 | Consumo Local | Order is prepared for consumption inside the restaurant. |
Delivery orders (
id_tipo_pedido: 1) require a valid saved address. Customers can manage their saved addresses at any time from the /addresses page before or during checkout.