The purpose of this project is to provide API endpoints that will handle these scenarios:
- An endpoint to search products based on
- Product name
- Product category
- Seller name
- An endpoint to get the details of a product.
- An endpoint to update the name of the product
- An endpoint to create a product
- An endpoint to delete a product
- An endpoint to bulk delete categories
- An endpoint to allow admin to blacklist a seller
- An endpoint to search sellers based on
- Seller name
- Product name
# | URL | HTTP Methods | Payload Samples | Description |
---|---|---|---|---|
1 | /v1/products | GET | Example query: /v1/products?q=Samsung&category=Phone&seller=Samsung | An endpoint to search products based on product name, product category, seller name. |
2 | /v1/products/1 | GET | An endpoint to get the details of a product. | |
3 | /v1/products/1 | PATCH | Example data: { name: "Samsung S10" } | An endpoint to update the name of the product |
4 | /v1/products | POST | Example data: { name: "Samsung S10", categories: ["Phones", "Mobile Devices"], seller: "Samsung" } | An endpoint to create a product |
5 | /v1/products/1 | DELETE | Example data: { productId: 1 } | An endpoint to delete a product |
6 | /v1/categories | POST | Example data: { categoryIds: [1, 2, 3, 4, 5] } | An endpoint to bulk delete categories |
7 | /sellers/2 | PATCH | Example data: { sellerId: 2, blacklisted: true } | An endpoint to allow admin to blacklist a seller |
8 | /sellers | POST | Example data: { seller: "Samsung" } | An endpoint to search sellers based on seller name and product name |
This repository provide bad example of REST API implementation which is part of training assessment by Software Seni training. Do not use this as example for a project development