{"id":30117362,"url":"https://github.com/jmr85/store-api-node","last_synced_at":"2026-04-09T07:02:34.184Z","repository":{"id":303670089,"uuid":"1015786476","full_name":"jmr85/store-api-node","owner":"jmr85","description":"Store Api Node is an online fake REST API that you can use whenever you need Pseudo-real data for your shopping or e-commerce website without running any server-side code and also for doing API Testing with Postman, RestAssured, etc.","archived":false,"fork":false,"pushed_at":"2025-07-31T22:24:28.000Z","size":154,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-01T00:49:09.334Z","etag":null,"topics":["express-js","mongodb","nodejs","postman","postman-collection","postman-environment"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jmr85.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-08T03:29:41.000Z","updated_at":"2025-07-31T22:24:31.000Z","dependencies_parsed_at":"2025-07-16T13:42:34.120Z","dependency_job_id":"d86b773c-a4d1-482d-bb89-a5e82a01ff6e","html_url":"https://github.com/jmr85/store-api-node","commit_stats":null,"previous_names":["jmr85/fake-store-api-nodejs","jmr85/store-api-node"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jmr85/store-api-node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmr85%2Fstore-api-node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmr85%2Fstore-api-node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmr85%2Fstore-api-node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmr85%2Fstore-api-node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jmr85","download_url":"https://codeload.github.com/jmr85/store-api-node/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jmr85%2Fstore-api-node/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269712872,"owners_count":24463216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["express-js","mongodb","nodejs","postman","postman-collection","postman-environment"],"created_at":"2025-08-10T10:41:48.372Z","updated_at":"2025-12-30T21:48:06.656Z","avatar_url":"https://github.com/jmr85.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ecommerce Software Requirements\n\nStore Api Node is an online fake REST API that you can use whenever you need Pseudo-real data for your shopping or e-commerce website without running any server-side code and also for doing API Testing with Postman, RestAssured, etc.\n\n## The features in the API :\n\n- ✅ Signing Up, signing in and signing out of users\n- ✅ Authentication using JSON Web tokens (JWT).\n- ✅ Advance searching, sorting, pagination and filtering\n- ✅ Schema validation using Express-Validator\n- ✅ single/multiple Image upload and image processing\n- ✅ All CRUD Operations\n- ✅ Star rating system\n- ✅ Discount coupon code\n- ✅ Add to wishlist\n- ✅ Add to cart\n\n## EndPoints\n\n\u003c!--ts--\u003e\n\n- [Authentication](#authentication)\n  - [Login](#login)\n  - [Sign Up](#sign-up)\n- [Users ](#users--access--admin-)\n  - [Get all users](#get-all-users)\n  - [Get a single user](#get-a-single-user)\n  - [Create a user](#create-a-user)\n  - [Update a user](#update-a-user)\n  - [Delete a user](#delete-a-user)\n  - [Change Password](#change-password)\n  - [Schema User](#schema-user)\n- [Logged Users](#logged-users)\n  - [Get Logged User](#get-logged-user)\n  - [Update Logged User](#update-logged-user)\n  - [Deactivate Logged Users](#deactivate-logged-users)\n  - [Activate Logged Users](#activate-logged-users)\n- [Categories](#categories)\n  - [Create a category](#create-a-category)\n  - [Update a category](#update-a-category)\n  - [Delete a category](#delete-a-category)\n  - [Get a single category](#get-a-single-category)\n  - [Get all categories](#get-all-categories)\n  - [Get all products by category](#get-all-products-by-category)\n  - [Schema Category](#schema-category)\n- [Subcategories](#subcategories)\n  - [Create Sub-Category](#create-sub-category)\n  - [Update a Sub-Category ](#update-a-sub-category)\n  - [Delete a sub-Category ](#delete-a-sub-category)\n  - [Get all Sub-Categories ](#get-all-sub-categories)\n  - [Get a single sub-Category ](#get-a-single-sub-category)\n  - [Get All Subcategories for Specific Category ](#get-all-subcategories-for-specific-category)\n  - [Create Subcategory on Category ](#create-subcategory-on-category)\n  - [Schema Sub-Category ](#schema-sub-category)\n- [Brands](#brands)\n  - [Add new Brand](#add-new-brand)\n  - [Update specific Brand ](#update-specific-brand)\n  - [Delete specific Brand ](#delete-specific-brand)\n  - [Get specific Brand ](#get-specific-brand)\n  - [Schema Brand ](#schema-brand)\n- [product](#products)\n  - [Create a product](#create-a-product)\n  - [Update a product ](#update-a-product)\n  - [Delete a product ](#delete-a-product)\n  - [Get a single product ](#get-a-single-product)\n  - [Get all products ](#get-all-products)\n  - [Get Related Products ](#get-related-products)\n  - [Search for a product by price ](#search-for-a-product-by-price)\n  - [Search by title or description ](#search-by-title-or-description)\n  - [Filter results ](#filter-results)\n  - [Field Limiting ](#field-limiting)\n  - [Product Schema ](#product-schema)\n- [Reviews](#reviews)\n  - [Add new Review ](#add-new-review)\n  - [Update a Review ](#update-a-review)\n  - [Delete specific review ](#delete-specific-review)\n  - [Get specific review ](#get-specific-review)\n  - [Get List of reviews ](#get-list-of-reviews)\n  - [Get all reviews on specifique products ](#get-all-reviews-on-specifique-products)\n  - [Review Schema ](#review-schema)\n- [Wishlist](#wishlist)\n  - [Add Product To Wishlist ](#add-product-to-wishlist)\n  - [Remove Product From Wishlist ](#remove-product-from-wishlist)\n  - [Get Logged User Wishlist ](#get-logged-user-wishlist)\n- [Addresses](#addresses)\n  - [Add address to user addresses list ](#add-address-to-user-addresses-list)\n  - [Remove address from user addresses list ](#remove-address-from-user-addresses-list)\n  - [Get logged user addresses list ](#get-logged-user-addresses-list)\n- [Coupon](#coupon)\n  - [Create Coupon ](#create-coupon)\n  - [Update specific coupon ](#update-specific-coupon)\n  - [Delete specific coupon ](#delete-specific-coupon)\n  - [Get list of coupons ](#get-list-of-coupons)\n  - [Get specific coupon ](#get-specific-coupon)\n  - [Coupon Schema ](#coupon-schema)\n- [Cart](#cart)\n  - [Add product to cart ](#add-product-to-cart)\n  - [Get logged user cart ](#get-logged-user-cart)\n  - [Update specific cart ](#delete-specific-cart)\n  - [Remove specific cart item ](#remove-specific-cart-item)\n  - [Clear logged user cart ](#clear-logged-user-cart)\n  - [Apply Coupon On Shopping Cart ](#apply-coupon-on-shopping-cart)\n  - [Cart Schema ](#cart-schema)\n\n## Run Locally\n\nClone the project\n\n```bash\n  git clone https://link-to-project\n```\n\nGo to the project directory\n\n```bash\n  cd my-project\n```\n\nInstall dependencies\n\n```bash\n  npm install\n```\n\nStart the server\n\n```bash\n  node index.js\n```\n\n## Environment Variables\n\nTo run this project, you will need to add the following environment variables to your .env file\n\n`MONGO_URI`\n`JWT_SECRET`\n\n##### BASE_URL = `https://store-api-node-bklk.onrender.com`\n\n## API Authentication\n\nSome endpoints may require authentication for example To create a create/delete/update category, you need to register your API users and obtain an access token.\n\nThe endpoints that require authentication expect a bearer token sent in the `Authorization header`.\n\n**Example**:\n\n`Authorization: Bearer YOUR TOKEN`\n\n\u003c!--te--\u003e\n\n\u003c!--\n\n## ToDo:\n\n- Password forgot/reset, confirmation email on signup\n- Credit card payment with stripe\n- Cash on delivery (no online payment required)\n\n## Database\n\nAll the models can be found in the models directory created using mongoose.\n\n\n\n\n\n\n## Route\n\nProduct Routes:\n\n\n\n\n\n\n\n\n\n## Validation Layer\n\nCategory:\n\n| Attribute name | Notes                      |\n| -------------- | -------------------------- |\n| name \\*        | String,min 3,max 32,unique |\n| slug           | String,lowercase           |\n\nSubCategory:\n\n| Attribute name | Notes                                         |\n| -------------- | --------------------------------------------- |\n| name \\*        | String,min 3,max 32,unique                    |\n| slug           | String,lowercase                              |\n| category \\*    | subCategory must be belong to parent category |\n\nBrand:\n\n| Attribute name | Notes                      |\n| -------------- | -------------------------- |\n| name \\*        | String,min 3,max 32,unique |\n| image          | String                     |\n\nProduct:\n\n| Attribute name     | Notes                                                               |\n| ------------------ | ------------------------------------------------------------------- |\n| title \\*           | String,min 3,max 100                                                |\n| slug \\*            | String,lowercase                                                    |\n| description \\*     | String , min 20                                                     |\n| quantity \\*        | Number                                                              |\n| sold               | Number , default: 0                                                 |\n| price \\*           | Number, max: 200000                                                 |\n| priceAfterDiscount | Number , priceAfterDiscount must be lower than price                |\n| colors             | [String]                                                            |\n| imageCover \\*      | String                                                              |\n| images             | [String]                                                            |\n| category           | Valid MongoDB ObjectId ,Validate Category Existence in The DB       |\n| subcategories      | Valid MongoDB ObjectId , Validate Subcategories Existence in Our DB |\n| ratingsAverage     | Number min 1,max 5                                                  |\n| ratingsQuantity    | Number default: 0                                                   |\n| shipping           | boolean                                                             |\n\nReview:\n\n| Attribute name | Notes                                  |\n| -------------- | -------------------------------------- |\n| title          | String                                 |\n| ratings        | Number,min 1,max 5,required            |\n| user           | ObjectId (User) ,required              |\n| product        | ObjectId (Product) ,isMongoId,required |\n\n## Technology\n\nI use Express on NodeJs for the server, MongoDB to store data as document in JSON format and Mongoose for modeling.\n\nThe application is built with:\n\n- express 4.18.2\n- mongoose 6.6.5\n- dotenv 16.0.3\n- bcrypt 5.1.0\n- body-parser 1.20.1\n- cookie-parser 1.4.6\n- express-jwt 7.7.7\n- joi 17.6.3\n- jsonwebtoken 8.5.1\n- uuid 9.0.0\n- multer 1.4.5-lts.1\n- slugify 1.6.5\n- colors 1.4.0\n- express-async-handler 1.2.0\n- express-validator 6.14.2\n- lodash 4.17.21\n- sharp 0.31.2\n\n## Run\n\nTo run this application, you have to set your own environmental variables. For security reasons, Below are the variables that you need to set in order to run the application:\n\n- MONGO_URI\n- JWT_SECRET\n  --\u003e\n\n---\n\n## Users { @access : Admin }\n\n#### Endpoints for Users\n\n---\n\nUser Routes:\n\n| @Route                           | @Type  | @access       | @desc             |\n| -------------------------------- | ------ | ------------- | ----------------- |\n| /api/users                       | GET    | Private/Admin | Get all users     |\n| /api/users/{id}                  | GET    | Private/Admin | Get a single user |\n| /api/users                       | POST   | Private/Admin | Create a user     |\n| /api/users/{id}                  | PUT    | Private/Admin | Update a user     |\n| /api/users/{id}                  | DELETE | Private/Admin | Delete a user     |\n| /api/users/changeMyPassword/{id} | PUT    | Private/Admin | Change Password   |\n\n## Get all users\n\nYou can access the list of users by using the `/api/users` endpoint.\n\n```\n[GET] https://store-api-node-bklk.onrender.com/api/users\n```\n\n```json\n[\n  {\n    \"_id\": \"63bc7cb13e721990a8cc4ff5\",\n    \"name\": \"Jhon\",\n    \"email\": \"john@mail.com\",\n    \"password\": \"$2a$12$ZZuflASgU6q.hZ0PsoqtL.tGocZZtBUAxHsvP/jvz3APY70/8BU2y\",\n    \"role\": \"user\",\n    \"active\": true,\n    \"wishlist\": [],\n    \"addresses\": [],\n    \"createdAt\": \"2023-01-09T20:44:33.095Z\",\n    \"updatedAt\": \"2023-01-09T20:44:33.095Z\"\n  }\n  // ...\n]\n```\n\n## Get a single user\n\nYou can get a single user by adding the `id` as a parameter: `/api/users/{userId}`\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/users/63bc7cb13e721990a8cc4ff5\n```\n\n```json\n{\n  \"data\": {\n    \"_id\": \"63bc7cb13e721990a8cc4ff5\",\n    \"name\": \"Jhon\",\n    \"email\": \"john@mail.com\",\n    \"password\": \"$2a$12$ZZuflASgU6q.hZ0PsoqtL.tGocZZtBUAxHsvP/jvz3APY70/8BU2y\",\n    \"role\": \"user\",\n    \"active\": true,\n    \"wishlist\": [],\n    \"addresses\": [],\n    \"createdAt\": \"2023-01-09T20:44:33.095Z\",\n    \"updatedAt\": \"2023-01-09T20:44:33.095Z\",\n    \"__v\": 0\n  }\n}\n```\n\n## Create a user\n\nYou can create a new user by sending an object like the following to `/api/users/`\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/users/\n```\n\n```json\n{\n  \"name\": \"Oscar\",\n  \"email\": \"oscar@mail.com\",\n  \"password\": \"123456\",\n  \"passwordConfirm\": \"123456\"\n}\n```\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/summary\u003e\n\u003cbr/\u003e\n\n```javascript\n{\n    \"data\": {\n        \"name\": \"Oscar\",\n        \"slug\": \"oscar\",\n        \"email\": \"oscar@mail.com\",\n        \"password\": \"$2a$12$LhfBZCCTvsKgSmBKS9brN.tRKSVKuWJYVc1Kr1fh65hMuBWU3N12O\",\n        \"role\": \"user\",\n        \"active\": true,\n        \"wishlist\": [],\n        \"_id\": \"63bc81973e721990a8cc501f\",\n        \"addresses\": [],\n        \"createdAt\": \"2023-01-09T21:05:27.441Z\",\n        \"updatedAt\": \"2023-01-09T21:05:27.441Z\",\n        \"__v\": 0\n    }\n}\n```\n\n\u003c/details\u003e\n\n\u003e Note that the password will be encrypted.\n\n## Update a user\n\nYou can update a user exists by sending an object like the following and adding the `id` as a parameter: `/api/users/{userId}`\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/users/63bc81973e721990a8cc501f\n```\n\n```json\n{\n  \"name\": \"Billy\",\n  \"email\": \"billy@mail.com\"\n}\n```\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/summary\u003e\n\u003cbr/\u003e\n\n```javascript\n{\n    \"data\": {\n        \"_id\": \"63bc81973e721990a8cc501f\",\n        \"name\": \"Billy\",\n        \"slug\": \"billy\",\n        \"email\": \"billy@mail.com\",\n        \"password\": \"$2a$12$LhfBZCCTvsKgSmBKS9brN.tRKSVKuWJYVc1Kr1fh65hMuBWU3N12O\",\n        \"role\": \"user\",\n        \"active\": true,\n        \"wishlist\": [],\n        \"addresses\": [],\n        \"createdAt\": \"2023-01-09T21:05:27.441Z\",\n        \"updatedAt\": \"2023-01-09T21:07:22.679Z\",\n        \"__v\": 0\n    }\n}\n```\n\n\u003c/details\u003e\n\n\u003e Note that it is not necessary to send all user attributes, just send the attributes that want to update.\n\n## Delete a user\n\nYou can delete a user exists by adding the `id` as a parameter: `/api/users/{userId}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/users/63bc81973e721990a8cc501f\n```\n\n```json\nstatus : 204 No Content\n```\n\n## Change Password\n\nYou can change password of any user exists by sending an object like the following and adding the `id` as a parameter: `/api/users/changePassword/{userId}`\n\n\u003c!--  changeMyPassword/{userId --\u003e\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/users/changePassword/63bc802d3e721990a8cc5005\n```\n\n```json\n{\n  \"currentPassword\": \"123456\",\n  \"password\": \"1234\",\n  \"passwordConfirm\": \"1234\"\n}\n```\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/summary\u003e\n\u003cbr/\u003e\n\n```javascript\n{\n    \"data\": {\n        \"_id\": \"63bc802d3e721990a8cc5005\",\n        \"name\": \"Admin\",\n        \"email\": \"admin@mail.com\",\n        \"password\": \"$2a$12$TfmUC4p.eR8HVDyXBGn4y.9EiO.54W5J78rBDxl9PWMuRQN0iMvwy\",\n        \"role\": \"admin\",\n        \"active\": true,\n        \"wishlist\": [],\n        \"addresses\": [],\n        \"createdAt\": \"2023-01-09T20:59:25.738Z\",\n        \"updatedAt\": \"2023-01-09T21:17:11.214Z\",\n        \"__v\": 0,\n        \"passwordChangedAt\": \"2023-01-09T21:17:11.214Z\"\n    }\n}\n```\n\n\u003c/details\u003e\n\n## Schema User\n\n| Attribute | Type    |\n| --------- | ------- |\n| name      | string  |\n| role      | string  |\n| email     | string  |\n| password  | string  |\n| active    | boolean |\n| Addresses | array   |\n\n---\n\n---\n\n## Logged Users\n\n#### Endpoints for Logged Users\n\n---\n\n| @Route              | @Type  | @access         | @desc                   |\n| ------------------- | ------ | --------------- | ----------------------- |\n| /api/users/getMe    | GET    | Private/Protect | Get Logged User         |\n| /api/users/updateMe | PUT    | Private/Protect | Update Logged User      |\n| /api/users/deleteMe | DELETE | Private/Protect | Deactivate Logged Users |\n| /api/users/activeMe | PUT    | Private/Protect | Activate Logged Users   |\n\n## Get Logged User\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/users/getMe\n```\n\n```json\n{\n  \"data\": {\n    \"_id\": \"63bc7cf53e721990a8cc4ff8\",\n    \"name\": \"Ruby\",\n    \"email\": \"ruby@mail.com\",\n    \"password\": \"$2a$12$vJ1Yf9Jkj700doCaSZBlgudPTOLlzpkGgOlB4fUzOwaKcYyQGfGJS\",\n    \"role\": \"user\",\n    \"active\": true,\n    \"wishlist\": [],\n    \"addresses\": [],\n    \"createdAt\": \"2023-01-09T20:45:41.648Z\",\n    \"updatedAt\": \"2023-01-09T20:45:41.648Z\",\n    \"__v\": 0\n  }\n}\n```\n\n## Update Logged User\n\nYou can update logged user by sending an object like the following\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/users/updateMe\n```\n\n```json\n{\n  \"name\": \"Ruby\",\n  \"email\": \"ruby@mail.com\"\n}\n```\n\n## Deactivate Logged Users\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/users/deleteMe\n```\n\n## Activate Logged Users\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/users/activeMe\n```\n\n## Authentication\n\n#### Endpoints for Authentication\n\n---\n\nAuth Routes:\n\n| @Route           | @Type | @access | @desc                       |\n| ---------------- | ----- | ------- | --------------------------- |\n| /api/auth/signup | POST  | Public  | Create a new user in db     |\n| /api/auth/login  | POST  | Public  | Authenticate a current user |\n\n## Login\n\nYou can do login by sending an object like the following to `/auth/login/`\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/auth/login\n```\n\n```json\n{\n  \"email\": \"ruby@mail.com\",\n  \"password\": \"123456\"\n}\n```\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/summary\u003e\n\u003cbr/\u003e\n\n```javascript\n{\n    \"data\": {\n        \"_id\": \"63bc7cf53e721990a8cc4ff8\",\n        \"name\": \"Ruby\",\n        \"email\": \"ruby@mail.com\",\n        \"role\": \"user\",\n        \"active\": true,\n        \"wishlist\": [],\n        \"addresses\": [],\n        \"createdAt\": \"2023-01-09T20:45:41.648Z\",\n        \"updatedAt\": \"2023-01-09T20:45:41.648Z\",\n        \"__v\": 0\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2M2JjN2NmNTNlNzIxOTkwYThjYzRmZjgiLCJpYXQiOjE2NzMyOTczOTYsImV4cCI6MTY4MTA3MzM5Nn0.cHnKhOCIYvWkEvS2yNYKYDrTvvUOV5GaxddTzbqYSLA\"\n}\n```\n\n\u003c/details\u003e\n\n## Sign Up\n\nCreate a user by sending user's credentials (in JSON format) in the Body of the HTTP Request. The content of the Body should look like the following:\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/auth/signup\n```\n\n```json\n{\n  \"name\": \"Ruby\",\n  \"email\": \"ruby@mail.com\",\n  \"password\": \"123456\",\n  \"passwordConfirm\": \"123456\"\n}\n```\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/summary\u003e\n\u003cbr/\u003e\n\n```javascript\n{\n    \"data\": {\n        \"name\": \"Ruby\",\n        \"email\": \"ruby@mail.com\",\n        \"password\": \"$2a$12$vJ1Yf9Jkj700doCaSZBlgudPTOLlzpkGgOlB4fUzOwaKcYyQGfGJS\",\n        \"role\": \"user\",\n        \"active\": true,\n        \"wishlist\": [],\n        \"_id\": \"63bc7cf53e721990a8cc4ff8\",\n        \"addresses\": [],\n        \"createdAt\": \"2023-01-09T20:45:41.648Z\",\n        \"updatedAt\": \"2023-01-09T20:45:41.648Z\",\n        \"__v\": 0\n    },\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiI2M2JjN2NmNTNlNzIxOTkwYThjYzRmZjgiLCJpYXQiOjE2NzMyOTcxNDQsImV4cCI6MTY4MTA3MzE0NH0.FpBunPGtHG88Xi2fvJ4k-q7t3vW_ARPBpmAH-eMAmzQ\"\n}\n```\n\n\u003c/details\u003e\n\n---\n\n## Categories\n\n#### Endpoints for Categories\n\n---\n\nCategory Routes:\n\n| @Route                               | @Type  | @access       | @desc                        |\n| ------------------------------------ | ------ | ------------- | ---------------------------- |\n| /api/categories/                     | POST   | Private/Admin | Create a category            |\n| /api/categories/:categoryId/         | PUT    | Private/Admin | Update a category            |\n| /api/categories/:categoryId/         | DELETE | Private/Admin | Delete a category            |\n| /api/categories/:categoryId          | GET    | Public        | Get a single category        |\n| /api/categories/?page=2\u0026limit=1      | GET    | Public        | Get List of Categories       |\n| /api/categories/:categoryId/products | GET    | Public        | Get all products by category |\n\n## Create a category\n\nYou can create a new category by sending an object like the following to `/categories/`\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/categories/\n```\n\n```json\n{\n  \"name\": \"Dog Food\",\n  \"image\": \"https://store-api-node-bklk.onrender.com//categories/category-bc9c91b0-0602-4679-a90a-ec2d35dcc895-1673300203174.jpeg\"\n}\n```\n\n\u003cdetails\u003e\u003csummary\u003e\u003cb\u003eOutput\u003c/b\u003e\u003c/summary\u003e\n\u003cbr/\u003e\n\n```javascript\n{\n    \"data\": {\n        \"name\": \"Dog Food\",\n        \"slug\": \"dog-food\",\n        \"image\": \"https://store-api-node-bklk.onrender.com//categories/category-bc9c91b0-0602-4679-a90a-ec2d35dcc895-1673300203174.jpeg\",\n        \"_id\": \"63bc88ec3e721990a8cc5064\",\n        \"createdAt\": \"2023-01-09T21:36:44.017Z\",\n        \"updatedAt\": \"2023-01-09T21:36:44.017Z\",\n        \"__v\": 0\n    }\n}\n```\n\n\u003c/details\u003e\n\n## Update a category\n\nYou can update a category exists by sending an object like the following and adding the id as a parameter: `/categories/{categoryId}`\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/categories/63bc88ec3e721990a8cc5064\n```\n\n```json\n{\n  \"name\": \"Change name\"\n}\n```\n\n\u003e Note that it is not necessary to send all user attributes, just send the attributes that want to update.\n\n## Delete a category\n\nYou can delete a category exists by adding the `id`as a parameter: `/api/users/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/categories/{categoryId}\n```\n\n```json\nstatus : 204 No Content\n```\n\n## Get a single category\n\nYou can get a single category by adding the `id` as a parameter: `/categories/{categoryId}`\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/categories/63bc88ec3e721990a8cc5064\n```\n\n```json\n{\n  \"data\": {\n    \"_id\": \"63bc88ec3e721990a8cc5064\",\n    \"name\": \"Dog Food\",\n    \"slug\": \"dog-food\",\n    \"image\": \"https://store-api-node-bklk.onrender.com//categories/category-bc9c91b0-0602-4679-a90a-ec2d35dcc895-1673300203174.jpeg\",\n    \"createdAt\": \"2023-01-09T21:36:44.017Z\",\n    \"updatedAt\": \"2023-01-09T21:36:44.017Z\",\n    \"__v\": 0\n  }\n}\n```\n\n## Get all categories\n\nYou can access the list of categories by using the `/categories` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/categories/\n```\n\n```json\n{\n  \"data\": [\n    {\n      \"_id\": \"63bc88ec3e721990a8cc5064\",\n      \"name\": \"Dog Food\",\n      \"slug\": \"dog-food\",\n      \"image\": \"https://store-api-node-bklk.onrender.com//categories/category-bc9c91b0-0602-4679-a90a-ec2d35dcc895-1673300203174.jpeg\",\n      \"createdAt\": \"2023-01-09T21:36:44.017Z\",\n      \"updatedAt\": \"2023-01-09T21:36:44.017Z\"\n    }\n    // ...\n  ]\n}\n```\n\n## Get all products by category\n\nYou can access the list of products by using the `/categories/{categoryId}/products` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/categories/{categoryId}/products\n```\n\n```json\n{\n  \"page\": 1,\n  \"result\": 5,\n  \"data\": [\n    {\n      \"_id\": \"636e6bef6c34aa33724e6cd9\",\n      \"title\": \"Mens Cotton Jacket\",\n      \"slug\": \"mens-cotton-jacket\",\n      \"description\": \"great outerwear jackets ...........\",\n      \"quantity\": 20,\n      \"sold\": 75,\n      \"price\": 55.99,\n      \"colors\": [],\n      \"category\": {\n        \"_id\": \"636e61a8aa2719937c3cf0dc\",\n        \"name\": \"Men's Clothing\"\n      },\n      \"subcategories\": [],\n      \"ratingsAverage\": 4,\n      \"ratingsQuantity\": 70,\n      \"createdAt\": \"2022-11-11T15:36:15.688Z\",\n      \"updatedAt\": \"2022-11-11T15:36:15.688Z\"\n    }\n    // ...\n  ]\n}\n```\n\n## Schema Category\n\n| Attribute | Type   |\n| --------- | ------ |\n| name      | string |\n| slug      | string |\n| image     | string |\n\n---\n\n## Subcategories\n\n#### Endpoints for Subcategories\n\n---\n\nSub-Category Routes:\n\n| @Route                             | @Type  | @access       | @desc                                       |\n| ---------------------------------- | ------ | ------------- | ------------------------------------------- |\n| /api/subcategories/                | POST   | Private/Admin | Add New Sub-Category                        |\n| /api/subcategories/:id             | PUT    | Private/Admin | Update specific subCategory                 |\n| /api/subcategories/:id             | DELETE | Private/Admin | Delete specific subCategory                 |\n| /api/subcategories/?page=2\u0026limit=1 | GET    | Public        | Get List of subCategories                   |\n| /api/subcategories/:id             | GET    | Public        | Get specific subCategory                    |\n| /api/categories/:id/subcategories  | GET    | Public        | Get All Subcategories for Specific Category |\n| /api/categories/:id/subcategories  | POST   | Public        | Create Subcategory on Category              |\n\n## Create Sub-Category\n\nYou can create a new subcategory by sending an object like the following to `/subcategories/`\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/categories/\n```\n\n```json\n{\n  \"name\": \"test\",\n  \"category\": \"636e61cbaa2719937c3cf0e0\"\n}\n```\n\n## Update a Sub-Category\n\nYou can update a Sub-category exists by sending an object like the following and adding the id as a parameter: `/subcategories/{id}`\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/subcategories/{subCategoryId}\n```\n\n```json\n{\n  \"name\": \"Change name\",\n  \"category\": \"99999999999\"\n}\n```\n\n\u003e Note that it is not necessary to send all user attributes, just send the attributes that want to update.\n\n## Delete a sub-Category\n\nYou can delete a subcategory exists by adding the `id`as a parameter: `/api/subcategories/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/subcategories/{categoryId}\n```\n\n```json\nstatus : 204 No Content\n```\n\n## Get all Sub-Categories\n\nYou can access the list of subcategories by using the `/subcategories` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/subcategories/\n```\n\n```json\n{\n  \"page\": 1,\n  \"subcategories\": [\n    {\n      \"_id\": \"63ac8c42e7a0e5ce49dce1bd\",\n      \"name\": \"Travel \u0026 Outdoor\",\n      \"category\": \"636e61cbaa2719937c3cf0e0\",\n      \"createdAt\": \"2022-12-28T18:34:42.494Z\",\n      \"updatedAt\": \"2022-12-28T18:34:42.494Z\",\n      \"__v\": 0\n    }\n    // ...\n  ]\n}\n```\n\n## Get a single sub-Category\n\nYou can get a single subcategory by adding the `id` as a parameter: `/subcategories/{id}`\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/categories/${id}\n```\n\n```json\n{\n  \"subcategory\": {\n    \"_id\": \"63ac901625fabe4f633c4be4\",\n    \"name\": \"Travel \u0026 Outdoor\",\n    \"category\": \"636e61cbaa2719937c3cf0e0\",\n    \"createdAt\": \"2022-12-28T18:51:02.581Z\",\n    \"updatedAt\": \"2022-12-28T18:51:02.581Z\"\n  }\n}\n```\n\n## Get All Subcategories for Specific Category\n\nYou can get All Subcategories for Specific Category by adding the `categoryId` as a parameter: `categories/${categoryId}/subcategories`\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/categories/${categoryId}/subcategories\n```\n\n```json\n\"page\": 1,\n    \"subcategories\": [\n        {\n            \"_id\": \"63ad3d03304ec94eb416f2f9\",\n            \"name\": \"Shirts\",\n            \"slug\": \"shirts\",\n            \"category\": \"636e61a8aa2719937c3cf0dc\",\n            \"createdAt\": \"2022-12-29T07:08:51.708Z\",\n            \"updatedAt\": \"2022-12-29T07:08:51.708Z\",\n            \"__v\": 0\n        },\n        // ...\n    ]\n```\n\n## Create Subcategory on Category\n\nYou can create a new subcategory by sending an object like the following to `/categories/${categoryId}/subcategories/`\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/categories/${categoryId}/subcategories/\n```\n\n```json\n{\n  \"name\": \"test\"\n}\n```\n\n## Schema Sub-Category\n\n| Attribute | Type     |\n| --------- | -------- |\n| title     | string   |\n| slug      | string   |\n| category  | ObjectId |\n\n---\n\n## Brands\n\n#### Endpoints for Brands\n\n---\n\nBrand Routes:\n\n| @Route                     | @Type  | @access       | @desc                 |\n| -------------------------- | ------ | ------------- | --------------------- |\n| /api/brand/                | POST   | Private/Admin | Add new Brand         |\n| /api/brand/:brandId/       | PUT    | Private/Admin | Update specific Brand |\n| /api/brand/:brandId/       | DELETE | Private/Admin | Delete specific Brand |\n| /api/brand/?page=2\u0026limit=1 | GET    | Public        | Get List of Brands    |\n| /api/brand/:brandId        | GET    | Public        | Get specific Brand    |\n\n## Add new Brand\n\nYou can create a new brand by sending an object like the following to `/brands/`\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/brands/\n```\n\n```json\n{\n  \"name\": \"BMW\",\n  \"image\": \"http://localhost:3000/brands/brand-4c6dc1a5-c156-409a-8774-1d47b71f3f6d-1672313914144.jpeg\"\n}\n```\n\n## Update specific Brand\n\nYou can update a brand exists by sending an object like the following and adding the `id` as a parameter: `/brands/{id}`\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/subcategories/{brandId}\n```\n\n```json\n{\n  \"name\": \"Change name\"\n}\n```\n\n\u003e Note that it is not necessary to send all brand attributes, just send the attributes that want to update.\n\n## Delete specific Brand\n\nYou can delete brand exists by adding the `id`as a parameter: `/api/brands/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/brands/{brandId}\n```\n\n```json\nstatus : 204 No Content\n```\n\n## Get List of Brands\n\nYou can access the list of brands by using the `/brands` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/brands/\n```\n\n```json\n{\n  \"page\": 1,\n  \"result\": 13,\n  \"data\": [\n    {\n      \"_id\": \"63ad7c3aa9e90aed3fac800e\",\n      \"name\": \"brand name\",\n      \"image\": \"http://localhost:3000/brands/brand-4c6dc1a5-c156-409a-8774-1d47b71f3f6d-1672313914144.jpeg\",\n      \"createdAt\": \"2022-12-29T11:38:34.244Z\",\n      \"updatedAt\": \"2022-12-29T11:38:34.244Z\"\n    }\n    // ...\n  ]\n}\n```\n\n## Get specific Brand\n\nYou can get a single brand by adding the `id` as a parameter: `/brands/{id}`\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/categories/${id}\n```\n\n```json\n{\n  \"data\": {\n    \"_id\": \"63ad7c3aa9e90aed3fac800e\",\n    \"name\": \"brand name\",\n    \"image\": \"http://localhost:3000/brands/brand-4c6dc1a5-c156-409a-8774-1d47b71f3f6d-1672313914144.jpeg\",\n    \"createdAt\": \"2022-12-29T11:38:34.244Z\",\n    \"updatedAt\": \"2022-12-29T11:38:34.244Z\",\n    \"__v\": 0\n  }\n}\n```\n\n## Schema Brand\n\n| Attribute | Type   |\n| --------- | ------ |\n| title     | string |\n| image     | string |\n\n## Products\n\n#### Endpoints for Products\n\n---\n\nProduct Routes:\n\n| @Route                                 | @Type  | @access       | @desc                          |\n| -------------------------------------- | ------ | ------------- | ------------------------------ |\n| /api/products/                         | POST   | Private/Admin | Create a product               |\n| /api/products/:productId               | PUT    | Private/Admin | Update a product               |\n| /api/products/:productId               | DELETE | Private/Admin | Delete a product               |\n| /api/products/:productId               | GET    | Public        | Get a single product           |\n| /api/products/                         | GET    | Public        | Get all products               |\n| /api/products/related/:productId/      | GET    | Public        | Get related products           |\n| /api/products/search                   | POST   | Public        | Search for a product by price  |\n| /api/products?sortedBy=price           | GET    | Public        | Sort results                   |\n| /api/products?keyword=Clark,Olsen      | GET    | Public        | Search by title or description |\n| /api/products?ratingsAverage[gte]=1.6  | GET    | Public        | Filter results                 |\n| /api/products?fields=title,description | GET    | Public        | Field Limiting                 |\n\n## Create a product\n\nYou can create a new product by sending an object like the following to `/api/products/` endpoint.\n\n```\n[GET] https://store-api-node-bklk.onrender.com/api/products\n```\n\n```json\n{\n  \"data\": {\n    \"title\": \"Pedigree Complete Nutrition Grilled Steak \u0026 Vegetable Flavor Dog Kibble Adult Dry Dog Food\",\n    \"slug\": \"pedigree-complete-nutrition-grilled-steak-and-vegetable-flavor-dog-kibble-adult-dry-dog-food\",\n    \"description\": \"Give your furry friend a taste of the good life with the Pedigree Complete Nutrition Grilled Steak \u0026 Vegetable Flavor Dog Kibble Adult Dry Dog Food. With a succulent steak flavor accented with hearty vegetables, this food has everything you need to keep your dog feeling his best. It’s prepared with whole grains for healthy digestion, plus essential nutrients and omega-6 fatty acids to promote a healthy skin and luxurious coat. And perhaps best of all, the crunchy texture of the kibble helps clean his teeth, so he’s always ready for his close up. It’s the easy way to combine great-tasting food plus nutrition that promotes health and vitality into a single bowl.\",\n    \"quantity\": 12,\n    \"sold\": 0,\n    \"price\": 27.78,\n    \"priceAfterDiscount\": 16.99,\n    \"colors\": [],\n    \"imageCover\": \"https://store-api-node-bklk.onrender.com//products/product-f720ed78-f7ae-4b97-984e-724fd649b526-1673301241065-cover.jpeg\",\n    \"images\": [\n      \"https://store-api-node-bklk.onrender.com//products/product-75dda5a2-05c8-4ece-9e93-56cd68629d9b-1673301243414-3.jpeg\",\n      \"https://store-api-node-bklk.onrender.com//products/product-6265568d-907a-4c00-a8da-3461ffd0f9d9-1673301243413-1.jpeg\",\n      \"https://store-api-node-bklk.onrender.com//products/product-c1abe725-affd-4db1-b223-fe3a397f8551-1673301243414-2.jpeg\",\n      \"https://store-api-node-bklk.onrender.com//products/product-5a1e1cc9-37ad-438f-ab25-fec0ecf2596d-1673301243415-4.jpeg\"\n    ],\n    \"category\": \"63bc88ec3e721990a8cc5064\",\n    \"subcategories\": [],\n    \"ratingsQuantity\": 0,\n    \"_id\": \"63bc8d063e721990a8cc5085\",\n    \"createdAt\": \"2023-01-09T21:54:14.049Z\",\n    \"updatedAt\": \"2023-01-09T21:54:14.049Z\",\n    \"__v\": 0,\n    \"id\": \"63bc8d063e721990a8cc5085\"\n  }\n}\n```\n\n## Update a product\n\nyou can update a product exists by sending an object like the following and adding the `id` as a parameter: `/api/products/{id}`\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/products/63bc8d063e721990a8cc5085\n```\n\n```json\n{\n  \"title\": \"Change title\",\n  \"price\": 100\n}\n```\n\n\u003e Note that it is not necessary to send all product attributes, just send the attributes that want to update.\n\n## Delete a product\n\nYou can delete a product exists by adding the `id` as a parameter: `/api/products/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/products/63bc8e693e721990a8cc508d\n```\n\n```json\nstatus : 204 No Content\n```\n\n## Get a single product\n\nYou can get a single product by adding the `id` as a parameter: `/api/products/{id}`\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/products/63bc8e4b3e721990a8cc5089\n```\n\n```json\n{\n  \"data\": {\n    \"_id\": \"63bc8e4b3e721990a8cc5089\",\n    \"title\": \"Kibbles 'n Bits Original Savory Beef \u0026 Chicken Flavors Dry Dog Food\",\n    \"slug\": \"kibbles-'n-bits-original-savory-beef-and-chicken-flavors-dry-dog-food\",\n    \"description\": \"Give your pup the nutrition and flavor he loves with the Kibbles 'n Bits Original Savory Beef \u0026 Chicken Flavors Dry Dog Food. This formula packs plenty of meaty taste into a blend of crunchy kibble and soft meaty bits made with the flavors of beef and chicken. It’s loaded with high-quality protein to help support strong muscles, plus vitamins, minerals and antioxidants so it’s a complete and balanced diet for adults. Plus, it’s proudly made in the USA so it’s a satisfying meal you can feel good about serving your dog every day!\\n\\n\",\n    \"quantity\": 80,\n    \"sold\": 0,\n    \"price\": 26.83,\n    \"priceAfterDiscount\": 25.49,\n    \"colors\": [],\n    \"imageCover\": \"https://store-api-node-bklk.onrender.com//products/product-843c9047-6b04-41ef-8006-c649a9717976-1673301569183-cover.jpeg\",\n    \"images\": [\n      \"https://store-api-node-bklk.onrender.com//products/product-0cfe07c8-2f7e-460c-9ce0-3f405e6fea95-1673301571031-4.jpeg\",\n      \"https://store-api-node-bklk.onrender.com//products/product-86670577-2138-4e16-b405-0b4757a67293-1673301571030-1.jpeg\",\n      \"https://store-api-node-bklk.onrender.com//products/product-0d83e714-47b7-4b01-8126-8d9be261f7fe-1673301571031-3.jpeg\",\n      \"https://store-api-node-bklk.onrender.com//products/product-998a7b86-fb60-4299-a5ca-895906919a58-1673301571030-2.jpeg\"\n    ],\n    \"category\": {\n      \"name\": \"Dog Food\"\n    },\n    \"subcategories\": [],\n    \"ratingsQuantity\": 0,\n    \"createdAt\": \"2023-01-09T21:59:39.954Z\",\n    \"updatedAt\": \"2023-01-09T21:59:39.954Z\",\n    \"__v\": 0,\n    \"reviews\": [],\n    \"id\": \"63bc8e4b3e721990a8cc5089\"\n  }\n}\n```\n\n## Get all products\n\nYou can access the list of 200 products by using the `/api/products` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/products\n```\n\n```json\n{\n  \"results\": 2,\n  \"paginationResult\": {\n    \"currentPage\": 1,\n    \"limit\": 50,\n    \"numberOfPages\": 1\n  },\n  \"data\": [\n    {\n      \"_id\": \"63bc8d063e721990a8cc5085\",\n      \"title\": \"Pedigree Complete Nutrition Grilled Steak \u0026 Vegetable Flavor Dog Kibble Adult Dry Dog Food\",\n      \"slug\": \"pedigree-complete-nutrition-grilled-steak-and-vegetable-flavor-dog-kibble-adult-dry-dog-food\",\n      \"description\": \"Give your furry friend a taste of the good life with the Pedigree Complete Nutrition Grilled Steak \u0026 Vegetable Flavor Dog Kibble Adult Dry Dog Food. With a succulent steak flavor accented with hearty vegetables, this food has everything you need to keep your dog feeling his best. It’s prepared with whole grains for healthy digestion, plus essential nutrients and omega-6 fatty acids to promote a healthy skin and luxurious coat. And perhaps best of all, the crunchy texture of the kibble helps clean his teeth, so he’s always ready for his close up. It’s the easy way to combine great-tasting food plus nutrition that promotes health and vitality into a single bowl.\",\n      \"quantity\": 12,\n      \"sold\": 0,\n      \"price\": 27.78,\n      \"priceAfterDiscount\": 16.99,\n      \"colors\": [],\n      \"imageCover\": \"https://store-api-node-bklk.onrender.com//products/product-f720ed78-f7ae-4b97-984e-724fd649b526-1673301241065-cover.jpeg\",\n      \"images\": [\n        \"https://store-api-node-bklk.onrender.com//products/product-75dda5a2-05c8-4ece-9e93-56cd68629d9b-1673301243414-3.jpeg\",\n        \"https://store-api-node-bklk.onrender.com//products/product-6265568d-907a-4c00-a8da-3461ffd0f9d9-1673301243413-1.jpeg\",\n        \"https://store-api-node-bklk.onrender.com//products/product-c1abe725-affd-4db1-b223-fe3a397f8551-1673301243414-2.jpeg\",\n        \"https://store-api-node-bklk.onrender.com//products/product-5a1e1cc9-37ad-438f-ab25-fec0ecf2596d-1673301243415-4.jpeg\"\n      ],\n      \"category\": {\n        \"name\": \"Dog Food\"\n      },\n      \"subcategories\": [],\n      \"ratingsQuantity\": 0,\n      \"createdAt\": \"2023-01-09T21:54:14.049Z\",\n      \"updatedAt\": \"2023-01-09T21:54:14.049Z\",\n      \"id\": \"63bc8d063e721990a8cc5085\"\n    }\n    // ...\n  ]\n}\n```\n\n## Get Related Products\n\nYou can get related product by adding the `/api/products/related/{id}` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/products/related/{productId}\n```\n\n```json\n[\n  {\n    \"_id\": \"636e6bef6c34aa33724e6cdb\",\n    \"title\": \"John Hardy Women's Legends Naga Gold \u0026 Silver Dragon Station Chain Bracelet\",\n    \"slug\": \"john-hardy-women's-legends-naga-gold-and-silver-dragon-station-chain-bracelet\",\n    \"description\": \"From our Legends Collection, the Naga was inspired by the .....................\",\n    \"quantity\": 91,\n    \"sold\": 23,\n    \"price\": 695,\n    \"colors\": [],\n    \"imageCover\": \"https://test.com/img/71pWzhdJNwL._AC_UL640_QL65_ML3_.jpg\",\n    \"images\": [],\n    \"category\": {\n      \"_id\": \"636e64579569c30b4ef8de53\",\n      \"name\": \"Women's Clothing\"\n    },\n    \"subcategories\": [],\n    \"ratingsAverage\": 4.4,\n    \"ratingsQuantity\": 12,\n    \"createdAt\": \"2022-11-11T15:36:15.688Z\",\n    \"updatedAt\": \"2022-12-20T12:12:03.570Z\"\n  }\n  // ...\n]\n```\n\n## Search for a product by price\n\nYou can search for a product by price by sending an object like the following\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/products/search\n```\n\n```json\n{\n  \"filters\": {\n    \"price\": [4, 20]\n  }\n}\n```\n\n## Search by title or description\n\nTo Search by title or description the API needs to be called with the `keyword` set word that you want\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/products/?keyword=Flavors\n```\n\n```json\n{\n  \"results\": 1,\n  \"paginationResult\": {\n    \"currentPage\": 1,\n    \"limit\": 50,\n    \"numberOfPages\": 1\n  },\n  \"data\": [\n    {\n      \"_id\": \"63bc8e4b3e721990a8cc5089\",\n      \"title\": \"Kibbles 'n Bits Original Savory Beef \u0026 Chicken Flavors Dry Dog Food\",\n      \"slug\": \"kibbles-'n-bits-original-savory-beef-and-chicken-flavors-dry-dog-food\",\n      \"description\": \"Give your pup the nutrition and flavor he loves with the Kibbles 'n Bits Original Savory Beef \u0026 Chicken Flavors Dry Dog Food. This formula packs plenty of meaty taste into a blend of crunchy kibble and soft meaty bits made with the flavors of beef and chicken. It’s loaded with high-quality protein to help support strong muscles, plus vitamins, minerals and antioxidants so it’s a complete and balanced diet for adults. Plus, it’s proudly made in the USA so it’s a satisfying meal you can feel good about serving your dog every day!\\n\\n\",\n      \"quantity\": 80,\n      \"sold\": 0,\n      \"price\": 26.83,\n      \"priceAfterDiscount\": 25.49,\n      \"colors\": [],\n      \"imageCover\": \"https://store-api-node-bklk.onrender.com//products/product-843c9047-6b04-41ef-8006-c649a9717976-1673301569183-cover.jpeg\",\n      \"images\": [\n        \"https://store-api-node-bklk.onrender.com//products/product-0cfe07c8-2f7e-460c-9ce0-3f405e6fea95-1673301571031-4.jpeg\",\n        \"https://store-api-node-bklk.onrender.com//products/product-86670577-2138-4e16-b405-0b4757a67293-1673301571030-1.jpeg\",\n        \"https://store-api-node-bklk.onrender.com//products/product-0d83e714-47b7-4b01-8126-8d9be261f7fe-1673301571031-3.jpeg\",\n        \"https://store-api-node-bklk.onrender.com//products/product-998a7b86-fb60-4299-a5ca-895906919a58-1673301571030-2.jpeg\"\n      ],\n      \"category\": {\n        \"name\": \"Dog Food\"\n      },\n      \"subcategories\": [],\n      \"ratingsQuantity\": 0,\n      \"createdAt\": \"2023-01-09T21:59:39.954Z\",\n      \"updatedAt\": \"2023-01-09T21:59:39.954Z\",\n      \"id\": \"63bc8e4b3e721990a8cc5089\"\n    }\n    // ..\n  ]\n}\n```\n\n## Filter results\n\nTo Filter results the API needs to be called with the `ratingsAverage[gte]` set number that you want\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/products/?ratingsAverage[gte]=1.6\n```\n\n```json\n{\n  \"page\": 1,\n  \"result\": 16,\n  \"data\": [\n    {\n      \"_id\": \"636e6bef6c34aa33724e6cd9\",\n      \"title\": \"Mens Cotton Jacket\",\n      \"slug\": \"mens-cotton-jacket\",\n      \"description\": \"great outerwear jackets for Spring/Autumn/Winter, .........\",\n      \"quantity\": 20,\n      \"sold\": 75,\n      \"price\": 55.99,\n      \"colors\": [],\n      \"category\": {\n        \"_id\": \"636e61a8aa2719937c3cf0dc\",\n        \"name\": \"Men's Clothing\"\n      },\n      \"subcategories\": [],\n      \"ratingsAverage\": 4,\n      \"ratingsQuantity\": 70,\n      \"createdAt\": \"2022-11-11T15:36:15.688Z\",\n      \"updatedAt\": \"2022-11-11T15:36:15.688Z\"\n    }\n  ]\n  // ...\n}\n```\n\n## Field Limiting\n\nTo Field Limiting the API needs to be called with the `fields` set attribute that you want to display\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/products/?fields=title,price\n```\n\n```json\n{\n  \"results\": 2,\n  \"paginationResult\": {\n    \"currentPage\": 1,\n    \"limit\": 50,\n    \"numberOfPages\": 1\n  },\n  \"data\": [\n    {\n      \"_id\": \"63bc8d063e721990a8cc5085\",\n      \"title\": \"Pedigree Complete Nutrition Grilled Steak \u0026 Vegetable Flavor Dog Kibble Adult Dry Dog Food\",\n      \"price\": 27.78,\n      \"category\": {\n        \"name\": \"Dog Food\"\n      },\n      \"id\": \"63bc8d063e721990a8cc5085\"\n    }\n    // ..\n  ]\n}\n```\n\n## Product Schema\n\n| Attribute          | Type     |\n| ------------------ | -------- |\n| title              | string   |\n| slug               | string   |\n| description        | string   |\n| quantity           | Number   |\n| price              | Number   |\n| sold               | Number   |\n| priceAfterDiscount | Number   |\n| Colors             | arrays   |\n| imageCover         | string   |\n| images             | images   |\n| category           | ObjectId |\n| subcategories      | ObjectId |\n| brand              | ObjectId |\n| ratingsAverage     | Number   |\n| ratingsAverage     | Number   |\n| ratingsQuantity    | Number   |\n| shipping           | Boolean  |\n\n---\n\n## Reviews\n\n#### Endpoints for Reviews\n\n---\n\nReview Routes:\n\n| @Route                           | @Type  | @access               | @desc                                  |\n| -------------------------------- | ------ | --------------------- | -------------------------------------- |\n| /api/reviews/                    | POST   | Private/Protect       | Add new Review                         |\n| /api/reviews/:reviewId           | PUT    | Private/Protect       | Update specific review                 |\n| /api/reviews/:reviewId           | DELETE | Private/Protect/Admin | Delete specific review                 |\n| /api/reviews/?page=2\u0026limit=1     | GET    | Public                | Get List of reviews                    |\n| /api/reviews/:reviewId           | GET    | Public                | Get specific review                    |\n| /api/products/:productId/reviews | GET    | Public                | Get all reviews on specifique products |\n\n## Add new Review\n\nYou can create a new review by sending an object like the following to `/api/reviews/` endpoint.\n\n```\n[GET] https://store-api-node-bklk.onrender.com/api/reviews\n```\n\n```json\n{\n  \"title\": \"Good Product\",\n  \"ratings\": 4,\n  \"product\": \"63adace3279142448c05b4fb\"\n}\n```\n\n## Update a review\n\nyou can update review exists by sending an object like the following and adding the `id` as a parameter: `/api/reviews/{id}`\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/reviews/{reviewId}\n```\n\n```json\n{\n  \"title\": \"updating Reviews\",\n  \"ratings\": 5\n}\n```\n\n\u003e Note that it is not necessary to send all review attributes, just send the attributes that want to update.\n\n## Delete specific review\n\nYou can delete specific review by adding the `id` as a parameter: `/api/reviews/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/reviews/{reviewId}\n```\n\n```json\nstatus : 204 No Content\n```\n\n## Get specific review\n\nYou can get specific review by adding the `id` as a parameter: `/api/reviews/{id}`\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/reviews/{reviewId}\n```\n\n```json\n{\n  \"data\": {\n    \"_id\": \"63aec38300b84ab23dbf222d\",\n    \"title\": \"Good Product\",\n    \"ratings\": 4,\n    \"user\": {\n      \"_id\": \"63a9b1b28fbd8a25a5202f58\",\n      \"name\": \"Emma\"\n    },\n    \"product\": \"63adad1c279142448c05b4ff\",\n    \"createdAt\": \"2022-12-30T10:54:59.146Z\",\n    \"updatedAt\": \"2022-12-30T10:54:59.146Z\"\n  }\n}\n```\n\n## Get List of reviews\n\nYou can access the list of reviews by using the `/api/reviews` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/reviews\n```\n\n```json\n{\n  \"page\": 1,\n  \"result\": 7,\n  \"data\": [\n    {\n      \"_id\": \"63aec39f00b84ab23dbf2236\",\n      \"title\": \"Good Product\",\n      \"ratings\": 5,\n      \"user\": {\n        \"_id\": \"63a9b1b28fbd8a25a5202f58\",\n        \"name\": \"Emma\"\n      },\n      \"product\": \"63adace3279142448c05b4fb\",\n      \"createdAt\": \"2022-12-30T10:55:27.679Z\",\n      \"updatedAt\": \"2022-12-30T10:55:55.834Z\"\n    }\n    // ...\n  ]\n}\n```\n\n## Get all reviews on specifique products\n\nYou can access the list of reviews on specifique products by using the `/api/{productId}/reviews` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/{productId}/reviews\n```\n\n```json\n{\n  \"result\": 2,\n  \"data\": [\n    {\n      \"_id\": \"63aec1dff1a585ce1a2cd108\",\n      \"title\": \"Bad Product\",\n      \"ratings\": 2,\n      \"user\": {\n        \"_id\": \"63aead724ba368735b49ae67\",\n        \"name\": \"KvnHart\"\n      },\n      \"product\": \"63adace3279142448c05b4fb\",\n      \"createdAt\": \"2022-12-30T10:47:59.701Z\",\n      \"updatedAt\": \"2022-12-30T10:47:59.701Z\",\n      \"__v\": 0\n    }\n    // ...\n  ]\n}\n```\n\n## Review Schema\n\nReview Schema:\n\n| Attribute | Type     |\n| --------- | -------- |\n| title     | string   |\n| ratings   | Number   |\n| user      | ObjectId |\n| product   | ObjectId |\n\n---\n\n## Wishlist\n\n#### Endpoints for Wishlist\n\n---\n\nWishlist Routes:\n\n| @Route                    | @Type  | @access      | @desc                        |\n| ------------------------- | ------ | ------------ | ---------------------------- |\n| /api/wishlist/            | POST   | Private/User | Add Product To Wishlist      |\n| /api/wishlist/:ProductId/ | DELETE | Private/User | Remove Product From Wishlist |\n| /api/wishlist/            | GET    | Private/User | Get Logged User Wishlist     |\n\n## Add Product To Wishlist\n\nYou can add Product To Wishlist by sending an object like the following to `/api/wishlist/` endpoint.\n\n```\n[POST] https://store-api-node-bklk.onrender.com/api/wishlist\n```\n\n```json\n{\n  \"product\": \"63ada0558394679ebc49646f\"\n}\n```\n\n## Remove Product From Wishlist\n\nYou can Remove Product From Wishlist by adding the `id` as a parameter: `/api/wishlist/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/wishlist/{productId}\n```\n\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Product removed successfully from your wishlist.\",\n  \"data\": [\"63adace3279142448c05b4fb\", \"63ada0558394679ebc49646f\"]\n}\n```\n\n## Get Logged User Wishlist\n\nYou can access the list of User Wishlist by using the `/api/wishlist` endpoint.\n\n```\n[GET] https://store-api-node-bklk.onrender.com/api/wishlist\n```\n\n```json\n{\n  \"status\": \"success\",\n  \"results\": 2,\n  \"data\": [\n    {\n      \"_id\": \"63adace3279142448c05b4fb\",\n      \"title\": \"Big Chill Women's Wrap Fleece Jacket\",\n      \"slug\": \"big-chill-women's-wrap-fleece-jacket\",\n      \"description\": \"Fleece is not only for athleisure! ..........\",\n      \"quantity\": 3,\n      \"sold\": 0,\n      \"price\": 44.96,\n      \"priceAfterDiscount\": 14.99,\n      \"colors\": [],\n      \"imageCover\": \"product-3eed9312-8a1f-4a9c-b4a2-ce5a652d5f5c-1672326370700-cover.jpeg\",\n      \"images\": [\n        \"product-ca74c168-ea0b-49b8-aa02-c695b7509d4f-1672326370887-2.jpeg\",\n        \"product-f90b50d4-a784-4ea9-9ae4-4c48bdd6d49a-1672326370884-1.jpeg\"\n      ],\n      \"category\": {\n        \"_id\": \"636e64579569c30b4ef8de53\",\n        \"name\": \"Women's Clothing\"\n      },\n      \"subcategories\": [],\n      \"ratingsQuantity\": 2,\n      \"createdAt\": \"2022-12-29T15:06:11.655Z\",\n      \"updatedAt\": \"2022-12-30T10:55:55.852Z\",\n      \"__v\": 0,\n      \"ratingsAverage\": 3.5\n    }\n    // ...\n  ]\n}\n```\n\n---\n\n## Addresses\n\n#### Endpoints for Addresses\n\n---\n\nAddresses Routes:\n\n| @Route                      | @Type  | @access      | @desc                                   |\n| --------------------------- | ------ | ------------ | --------------------------------------- |\n| /api/addressess/            | POST   | Private/User | Add address to user addresses list      |\n| /api/addressess/:addressId/ | DELETE | Private/User | Remove address from user addresses list |\n| /api/addressess/            | GET    | Private/User | Get logged user addresses list          |\n\n## Add address to user addresses list\n\nYou can Add address to user addresses list by sending an object like the following to `/api/addressess/` endpoint.\n\n```\n[POST] https://store-api-node-bklk.onrender.com/api/addressess\n```\n\n```json\n{\n  \"alias\": \"Home\",\n  \"details\": \"985 Pinnickinnick Street\",\n  \"phone\": \"615-827-2462\",\n  \"city\": \"Sayreville\",\n  \"postalCode\": \"08872\"\n}\n```\n\n## Remove address from user addresses list\n\nYou can Remove address from user addresses list by adding the `id` as a parameter: `/api/addressess/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/addressess/{addressId}\n```\n\n```json\n{\n  \"status\": \"success\",\n  \"message\": \"Address removed successfully.\",\n  \"data\": [\n    {\n      \"alias\": \"Home\",\n      \"details\": \"985 Pinnickinnick Street\",\n      \"phone\": \"615-827-2462\",\n      \"city\": \"Sayreville\",\n      \"postalCode\": \"08872\",\n      \"_id\": \"63b045fbdd839ae49bd78e5f\"\n    }\n    // ..\n  ]\n}\n```\n\n## Get logged user addresses list\n\nYou can access the list of addresses by using the `/api/addressess` endpoint.\n\n```\n[GET] https://store-api-node-bklk.onrender.com/api/addressess\n```\n\n```json\n{\n  \"status\": \"success\",\n  \"results\": 2,\n  \"data\": [\n    {\n      \"alias\": \"Home\",\n      \"details\": \"985 Pinnickinnick Street\",\n      \"phone\": \"615-827-2462\",\n      \"city\": \"Sayreville\",\n      \"postalCode\": \"08872\",\n      \"_id\": \"63b045fbdd839ae49bd78e5f\"\n    }\n    // ..\n  ]\n}\n```\n\n---\n\n## Coupon\n\n#### Endpoints for Coupon\n\n---\n\nCoupon Routes:\n\n| @Route            | @Type  | @access       | @desc                  |\n| ----------------- | ------ | ------------- | ---------------------- |\n| /api/coupons/     | POST   | Private/Admin | Create Coupon          |\n| /api/coupons/:id/ | PUT    | Private/Admin | Update specific Coupon |\n| /api/coupons/:id/ | DELETE | Private/Admin | Delete specific Coupon |\n| /api/coupons/     | GET    | Public        | Get All Coupons        |\n| /api/coupons/:id/ | GET    | Public        | Get specific Coupon    |\n\n## Create Coupon\n\nYou can Create Coupon by sending an object like the following to `/coupons/`\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/coupons/\n```\n\n```json\n{\n  \"name\": \"HAPPY20\",\n  \"expire\": \"2021/12/01\",\n  \"discount\": 30\n}\n```\n\n## Update specific coupon\n\nYou can Update specific coupon by sending an object like the following and adding the `id` as a parameter: `/coupons/{id}`\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/coupons/{couponId}\n```\n\n```json\n{\n  \"discount\": 10\n}\n```\n\n\u003e Note that it is not necessary to send all coupon attributes, just send the attributes that want to update.\n\n## Delete specific coupon\n\nYou can Delete specific coupon by adding the `id`as a parameter: `/api/coupons/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/coupons/{couponId}\n```\n\n```json\nstatus : 204 No Content\n```\n\n## Get list of coupons\n\nYou can access the list of coupons by using the `/api/coupons` endpoint.\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/coupons\n```\n\n```json\n{\n  \"page\": 1,\n  \"result\": 3,\n  \"data\": [\n    {\n      \"_id\": \"63b0552c3fb00490d0b7d573\",\n      \"name\": \"HAPPY20\",\n      \"expire\": \"2021-11-30T23:00:00.000Z\",\n      \"discount\": 20,\n      \"createdAt\": \"2022-12-31T15:28:44.651Z\",\n      \"updatedAt\": \"2022-12-31T15:28:44.651Z\"\n    }\n    // ..\n  ]\n}\n```\n\n## Get specific coupon\n\nYou can get specific coupon by adding the `id` as a parameter: `/api/coupons/{id}`\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/coupons/{couponId}\n```\n\n```json\n{\n  \"data\": {\n    \"_id\": \"63b0552c3fb00490d0b7d573\",\n    \"name\": \"HAPPY20\",\n    \"expire\": \"2021-11-30T23:00:00.000Z\",\n    \"discount\": 20,\n    \"createdAt\": \"2022-12-31T15:28:44.651Z\",\n    \"updatedAt\": \"2022-12-31T15:28:44.651Z\",\n    \"__v\": 0\n  }\n}\n```\n\n## Coupon Schema\n\n| Attribute | Type   |\n| --------- | ------ |\n| name      | string |\n| discount  | Number |\n| expire    | Date   |\n\n---\n\n## Cart\n\n#### Endpoints for Cart\n\n---\n\nCart Routes:\n\n| @Route                | @Type  | @access      | @desc                         |\n| --------------------- | ------ | ------------ | ----------------------------- |\n| /api/cart/            | POST   | Private/User | Add product to cart           |\n| /api/cart/            | GET    | Private/User | Get logged user cart          |\n| /api/cart/:itemId/    | DELETE | Private/User | Remove specific cart item     |\n| /api/cart/            | DELETE | Private/User | Clear logged user cart        |\n| /api/cart/:itemId/    | PUT    | Private/User | Update cart item quantity     |\n| /api/cart/applyCoupon | PUT    | Private/User | Apply coupon on shopping cart |\n\n## Add product to cart\n\nYou can Add product to cart by sending an object like the following to `/cart/`\n\n```bash\n[POST] https://store-api-node-bklk.onrender.com/api/cart/\n```\n\n```json\n{\n  \"productId\": \"636e6bef6c34aa33724e6cdd\",\n  \"color\": \"Black\"\n}\n```\n\n## Get logged user cart\n\n```bash\n[GET] https://store-api-node-bklk.onrender.com/api/cart\n```\n\n```json\n{\n  \"status\": \"success\",\n  \"numOfCartItems\": 2,\n  \"data\": {\n    \"_id\": \"63b08822a8808232467c2993\",\n    \"cartItems\": [\n      {\n        \"product\": \"636e6bef6c34aa33724e6cdd\",\n        \"quantity\": 1,\n        \"color\": \"Black\",\n        \"price\": 9.99,\n        \"_id\": \"63b08822a8808232467c2994\"\n      }\n      // ...\n    ],\n    \"user\": \"63aeed564a116b073bc4d0cf\",\n    \"createdAt\": \"2022-12-31T19:06:10.762Z\",\n    \"updatedAt\": \"2022-12-31T19:11:18.797Z\",\n    \"__v\": 1\n  }\n}\n```\n\n## Update specific cart\n\nYou can Update specific coupon by sending an object like the following and adding the `id` as a parameter: `/cart/{id}`\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/cart/{itemId}\n```\n\n```json\n{\n  \"quantity\": 2\n}\n```\n\n## Remove specific cart item\n\nYou can remove Specific Cart Item by adding the `id`as a parameter: `/api/cart/{id}`\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/cart/{itemId}\n```\n\n## Clear logged user cart\n\n```bash\n[DELETE] https://store-api-node-bklk.onrender.com/api/cart/\n```\n\n## Apply Coupon On Shopping Cart\n\nYou can Apply Coupon On Shopping Cart by sending an object like the following\n\n```bash\n[PUT] https://store-api-node-bklk.onrender.com/api/cart/applyCoupon\n```\n\n```json\n{\n  \"coupon\": \"HAPPY24\"\n}\n```\n\n## Cart Schema\n\n| Attribute               | Type   |\n| ----------------------- | ------ |\n| cartItems               | arrays |\n| totalCartPrice          | Number |\n| totalPriceAfterDiscount | Number |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmr85%2Fstore-api-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjmr85%2Fstore-api-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjmr85%2Fstore-api-node/lists"}