USER

USER MANAGEMENT

Endpoint Method Description Parameters Authorization Status Code Response
/api/users/registration POST User registration String, in Body 201 User created
/api/users/login POST User Login String, in Body 200 OK User login Successfully
/api/users/reset-password POST User reset-password String, in Body 200 OK Rest password successfully
/api/users/profile/:userId GET Retrieve user profile information. userId (String, in URL) User Token 200 OK User profile object.
/api/users/profile PUT Update user profile information. String, in Body User Token 200 OK Updated user profile object.
/api/users/profile/:userId DELETE Delete user account. userId (String, in URL) User Token 204 No Content No response

PRODUCTS MANAGEMENT

Endpoint Method Description Parameters Authorization Status Code Response
/api/products GET Retrieve all product’s details String, in Body User Token 200 OK Product objects containing details.
/api/products/:productId GET Retrieve product details String, in Body User Token 200 OK Object details of the specified product
/api/products/:productId/reviews POST Submit a review for a product productId (String, in URL), review data (in Body) User Token 201 Created JSON object containing details of the submitted review
/api/products/reviews GET Get reviews for a product String, in Body User Token 200 OK JSON array containing reviews for the specified product

ORDER MANAGEMENT

Endpoint Method Description Parameters Authorization Status Code Response
/api/products/orders/:userId POST User send order userId (String, in URL), order data (in Body) User Token 200 OK Message confirming the order submission.
/api/products/orders/:userId GET User order List userId (String, in URL) User Token 200 OK • A JSON object containing the status of the order.
/api/products/orders/:orderId PUT Update an existing order orderId (String, in URL), updated order data (in Body) User Token 200 OK Message confirming the order update.
/api/products/orders/:orderId DELETE Delete an order orderId (String, in URL) User Token 204 No Content ——

PAYMENT MANAGEMENT

Endpoint Method Description Parameters Authorization Status Code Response
/api/payments/:userId GET User payment list userId (String, in URL) User Token 200 OK JSON object containing user's payment list
/api/payments/:userId POST User payment products userId (String, in URL), payment data (in Body) User Token 200 OK JSON object confirming successful payment
/api/payments/success GET User payment success String, in Body User Token 200 OK JSON object indicating successful payment
/api/payments/cancel GET User payment cancel String, in Body User Token JSON object indicating cancellation success

SUPPLIER

SUPPLIER MANAGEMENT

Endpoint Method Description Parameters Authorization Status Code Response
/api/suppliers/register POST Register a new supplier String, in Body —— 201 Supplier created
/api/suppliers/login POST Log in an existing supplier String, in Body —— 200 OK Supplier login Successfully
/api/suppliers/reset-password POST Reset supplier's password email (String) None 200 OK Rest password successfully
/api/suppliers/profile/:supplierId GET Retrieve profile information supplierId(String, in URL) Supplier Token 200 OK User profile object.
/api/suppliers/profile PUT Update profile information String, in Body Supplier Token 200 OK Updated supplier profile object.
/api/attendance/:supplierId GET Attendance records of all supplier supplierId(String, in URL) Supplier Token 200 OK Attendance records of all supplier