{"info":{"_postman_id":"afd2cd4c-6616-4724-8571-08e05ac3f3fa","name":"Circuit City","description":"<html><head></head><body><h3 id=\"about-circuit-city\"><strong>About Circuit City</strong></h3>\n<p>Circuit City is an online market for the distribution of electrical tools, equipment and non-reusables to professionals, resellers and consumers in the electrical industry.</p>\n<h3 id=\"the-circuit-city-api\"><strong>The Circuit City API</strong></h3>\n<p>For those unfamiliar with the acronymn API, It stands for Application Program Interface. An API according to IBM is a set of rules or protocols that let software applications communicate with each other to exchange data, features and functionality.</p>\n<p>This is the Circuit City API documentation. It contains a detailed description of how to interact with the resources avaliable in this web application with example requests for each endpoint.</p>\n<h3 id=\"who-should-read-this-api-documentation\">Who should read this API documentation?</h3>\n<p>This API is created to model the distribution of goods to consumers.</p>\n<ul>\n<li>Clients who are interested in creating a similar API to distribute their products.</li>\n<li>Programmers who are interested in understanding the working principles of an e-commerce API</li>\n<li>Curious minds</li>\n</ul>\n<h3 id=\"g-lossary-of-common-terms\">G﻿lossary of Common Terms</h3>\n<ul>\n<li><p>Database: This is an organized collection of data. In simple terms, a place for storage of all of the data needed to ensure a delightful user experience</p>\n</li>\n<li><p>Authentication: This is a process of identifying a registered user</p>\n</li>\n<li><p>Authorization: This is a process of determines the privileges a user has</p>\n</li>\n</ul>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"28166032","collectionId":"afd2cd4c-6616-4724-8571-08e05ac3f3fa","publishedId":"2sA35JzKhh","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-04-02T17:31:22.000Z"},"item":[{"name":"Authentication and Authorization","item":[{"name":"/signup","id":"de18a1f1-c195-451d-8f0c-2b4c82d04da7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\"firstName\": \"Magnus\", \"lastName\": \"major\", \"email\": \"major@gmail.com\", \"password\": \"newpass\", \"role\": \"admin\"}\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/users/signup","description":"<h3 id=\"description\">Description</h3>\n<p>This request is used to create a new user in the database. A user can have two different roles, an admin or a normal user. This is usually referred to as Role Based Authentication(RBAC). The normal user has access to read priviledges while the admin user has access to bth read and write priviledges.</p>\n<h3 id=\"request-parameters\">Request Parameters</h3>\n<p>JSON is the primary format for provision of data to this API. The data should be added to the body of the request.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameters</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>firstName</td>\n<td>User's first name</td>\n</tr>\n<tr>\n<td>lastName</td>\n<td>User's last name</td>\n</tr>\n<tr>\n<td>email</td>\n<td>User's email address (unique)</td>\n</tr>\n<tr>\n<td>role</td>\n<td>user or admin (default is user)</td>\n</tr>\n<tr>\n<td>password</td>\n<td>User's password</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>All of th data entered is returned in JSON format. The password is hashed before being stored in the db and then sent in the response.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","v1","users","signup"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"48905ca4-7f11-4f85-b582-d74076779fc7","name":"/signup","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true},{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\"firstName\": \"Bosco\", \"lastName\": \"John\", \"email\": \"johnbosco@gmail.com\", \"password\": \"pass123\"}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/users/signup"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"229"},{"key":"ETag","value":"W/\"e5-Pw2G+Dk5yPrQhyLudEbb2kmby+0\""},{"key":"Date","value":"Tue, 02 Apr 2024 18:18:14 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"firstName\": \"Bosco\",\n    \"lastName\": \"John\",\n    \"email\": \"johnbosco@gmail.com\",\n    \"password\": \"$2a$12$eEhdy3Y5LkT6mBvDMC4O4uxW3Y/3Eug9Oc3IhITsf1/CYoCsrDWmu\",\n    \"role\": \"user\",\n    \"_id\": \"660c4be6bbf869e02e9d8a46\",\n    \"createdAt\": \"2024-04-02T18:18:14.477Z\"\n}"},{"id":"62542eb9-95bb-4c62-ac66-49b04869d942","name":"/signup (admin)","originalRequest":{"method":"POST","header":[{"key":"","value":"","type":"text","disabled":true},{"key":"","value":"","type":"text","disabled":true}],"body":{"mode":"raw","raw":"{\"firstName\": \"Doe\", \"lastName\": \"John\", \"email\": \"doe@admin.com\", \"password\": \"pass223\", \"role\": \"admin\"}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/users/signup"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"222"},{"key":"ETag","value":"W/\"de-w2n4F+ixcv4fLIosBrG9zy86RoE\""},{"key":"Date","value":"Tue, 02 Apr 2024 18:40:07 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"firstName\": \"Doe\",\n    \"lastName\": \"John\",\n    \"email\": \"doe@admin.com\",\n    \"password\": \"$2a$12$eEhdy3Y5LkT6mBvDMC4O4u3SFtsjKZKHUUxsfEZEtAtb4jbsSVFJi\",\n    \"role\": \"admin\",\n    \"_id\": \"660c5106cb2d5dded98ba6b5\",\n    \"createdAt\": \"2024-04-02T18:40:06.739Z\"\n}"}],"_postman_id":"de18a1f1-c195-451d-8f0c-2b4c82d04da7"},{"name":"/login","id":"844c5845-5112-4ef1-b464-a8a538c01492","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/v1/users/login","description":"<h3 id=\"description\">Description</h3>\n<p>To login, the Authorization key should be added to the request with its value being the base64 encoded version of the <code>scheme email: password</code>. For login, the <code>Basic</code> scheme is accepted.</p>\n<h3 id=\"request-header\">Request Header</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Authorization</td>\n<td>Basic email:password(in base64)</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"dont-know-how-to-generate-base64\">Don't know how to generate base64?</h3>\n<ol>\n<li>Go to <a href=\"https://www.base64encode.org/\">https://www.base64encode.org/</a></li>\n<li>Configure the encoder in this manner.</li>\n</ol>\n<img src=\"https://content.pstmn.io/2df62aff-655d-44e3-b0e7-ebb3c6c39d00/U2NyZWVuc2hvdCAoMTc2KS5wbmc=\" width=\"619\" height=\"348\" />\n\n<p>3. Enter the data i.e <code>scheme :</code> and hit encode.</p>\n<h3 id=\"response\">Response</h3>\n<p>As a response, you will receive a session token. The session expires 2hrs after creation. This token should be added to subsequent requests to the API. This will be explained in detail in the next endpoint.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","v1","users","login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"68b002da-8241-4c16-86ce-6d4766a421d0","name":"/login","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Basic am9obmJvc2NvQGdtYWlsLmNvbTpwYXNzMTIz","type":"text"}],"url":"http://localhost:5000/api/v1/users/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"183"},{"key":"ETag","value":"W/\"b7-VogY+fmqLpUa4AyP9WEMU4PdZ24\""},{"key":"Date","value":"Tue, 02 Apr 2024 18:21:55 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGM0YmU2YmJmODY5ZTAyZTlkOGE0NiIsImlhdCI6MTcxMjA4MjExNSwiZXhwIjoxNzEyMDg5MzE1fQ.yKBYpC5RoQDxwBR7zMbJJi7lFeYqZKm-K08bAkhrHyo\"\n}"}],"_postman_id":"844c5845-5112-4ef1-b464-a8a538c01492"},{"name":"/users/me","id":"ef72a7ed-4a29-4801-a921-0fc45e5ccb46","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MTE1ZTk3YzI3NDBjYWFjYjdiN2FlNyIsImlhdCI6MTcxMjQxNDQwNiwiZXhwIjoxNzEyNDIxNjA2fQ.kB4qT-T2xQ2VMwHIWGcJNOqW-B8SnQSAom4Xiy6nQMc","type":"text"}],"url":"http://localhost:5000/api/users/me","description":"<h3 id=\"description\">Description</h3>\n<p>This endpoint returns the users profile data. The session token generated from the GET /login endpoint last 2hrs and must be regenerated when expired. The token generated from previous endpoint will be used in all other requests to the API. The Authentication scheme accepted for this is <code>Bearer</code>.</p>\n<h3 id=\"request-header\">Request Header</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Authorization</td>\n<td><code>Bearer [token]</code></td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>This sends details about the user in JSON.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","users","me"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"a874ea37-ca8f-4477-9a7d-5c2c20ca5612","name":"/users/me","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGM0YmU2YmJmODY5ZTAyZTlkOGE0NiIsImlhdCI6MTcxMjA4MjExNSwiZXhwIjoxNzEyMDg5MzE1fQ.yKBYpC5RoQDxwBR7zMbJJi7lFeYqZKm-K08bAkhrHyo","type":"text"}],"url":"http://localhost:5000/api/v1/users/me"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"154"},{"key":"ETag","value":"W/\"9a-cZE+1UTew9SBOU9PAe0eJ+QKuss\""},{"key":"Date","value":"Tue, 02 Apr 2024 18:22:41 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"firstName\": \"Bosco\",\n    \"lastName\": \"John\",\n    \"email\": \"johnbosco@gmail.com\",\n    \"role\": \"user\",\n    \"createdAt\": \"2024-04-02T18:18:14.477Z\",\n    \"id\": \"660c4be6bbf869e02e9d8a46\"\n}"}],"_postman_id":"ef72a7ed-4a29-4801-a921-0fc45e5ccb46"}],"id":"27186514-6d55-40a0-91aa-f9e37f555f3a","description":"<p>First off, to begin using this API, you'll need to create a new user and this brings us to our first endpoint</p>\n","_postman_id":"27186514-6d55-40a0-91aa-f9e37f555f3a"},{"name":"Categories","item":[{"name":"/categories","id":"9a280208-adb4-42dc-ae80-10a52bc0cea8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/categories","description":"<h3 id=\"description\">Description</h3>\n<p>This endpoint returns a paginated list of all categories avaliable.</p>\n<h3 id=\"request-header\">Request Header</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Authorization</td>\n<td><code>Bearer [token]</code></td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"query-params\">Query Params</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>page</td>\n<td>1, 2...</td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"http","port":"5000","path":["api","v1","categories"],"host":["localhost"],"query":[{"disabled":true,"key":"page","value":"1"}],"variable":[]}},"response":[{"id":"08725640-cca0-4130-826b-b00572c6ba8a","name":"/categories","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGVjMGI3NjhmOWVlYWM5MDQ4MWI2ZSIsImlhdCI6MTcxMjI5MDU5NSwiZXhwIjoxNzEyMjk3Nzk1fQ.ycpEu9E21K30qmDgUWEhXO7GBKARnCRSczPwaVqtVFo","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"http://localhost:5000/api/v1/categories?page=1","protocol":"http","host":["localhost"],"port":"5000","path":["api","v1","categories"],"query":[{"key":"page","value":"1"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"1027"},{"key":"ETag","value":"W/\"403-LO+wnr3jqcc+3Ae5KRfJq9/lJT0\""},{"key":"Date","value":"Fri, 05 Apr 2024 04:22:44 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"count\": 6,\n    \"prev\": null,\n    \"next\": \"http://localhost/api/v1/categories/?page=2\",\n    \"data\": [\n        {\n            \"_id\": \"660e8df1ee2e2ca872010f89\",\n            \"name\": \"Transformers\",\n            \"description\": \"Various types of transformers\",\n            \"createdAt\": \"2024-04-04T11:24:33.402Z\",\n            \"updatedAt\": \"2024-04-04T11:24:33.402Z\"\n        },\n        {\n            \"_id\": \"660e8e8bee2e2ca872010f8d\",\n            \"name\": \"Electrical Tools\",\n            \"description\": \"Tools for electrical work\",\n            \"createdAt\": \"2024-04-04T11:27:07.575Z\",\n            \"updatedAt\": \"2024-04-04T11:27:07.575Z\"\n        },\n        {\n            \"_id\": \"660e8e9fee2e2ca872010f91\",\n            \"name\": \"Cables\",\n            \"description\": \"Different types and sizes of electrical cables\",\n            \"createdAt\": \"2024-04-04T11:27:27.269Z\",\n            \"updatedAt\": \"2024-04-04T11:27:27.269Z\"\n        },\n        {\n            \"_id\": \"660f7bb1501f8a5d20080fea\",\n            \"name\": \"Cableees\",\n            \"description\": \"Different types and sizes of electrical cables\",\n            \"createdAt\": \"2024-04-05T04:18:57.712Z\",\n            \"updatedAt\": \"2024-04-05T04:18:57.712Z\"\n        },\n        {\n            \"_id\": \"660f7bbe501f8a5d20080fee\",\n            \"name\": \"Cableeaes\",\n            \"description\": \"Different types and sizes of electrical cables\",\n            \"createdAt\": \"2024-04-05T04:19:10.869Z\",\n            \"updatedAt\": \"2024-04-05T04:19:10.869Z\"\n        }\n    ]\n}"}],"_postman_id":"9a280208-adb4-42dc-ae80-10a52bc0cea8"},{"name":"/categories/:id","id":"737c9f7a-0b71-418d-b4f5-84b1caa435dc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/categories/6607b2cd14b58d78a10a0213","description":"<h3 id=\"description\">Description</h3>\n<p>This endpoint returns the category with the specified id. As always, the authorization token must be added to the request.</p>\n<h3 id=\"request-header\">Request Header</h3>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Header</th>\n<th>Value</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Authorization</td>\n<td><code>Bearer [token]</code></td>\n</tr>\n</tbody>\n</table>\n</div>","urlObject":{"protocol":"http","port":"5000","path":["api","v1","categories","6607b2cd14b58d78a10a0213"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"5e687947-9732-4244-9fed-1991482e78ae","name":"/categories/:id","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGVjMGI3NjhmOWVlYWM5MDQ4MWI2ZSIsImlhdCI6MTcxMjI5MDU5NSwiZXhwIjoxNzEyMjk3Nzk1fQ.ycpEu9E21K30qmDgUWEhXO7GBKARnCRSczPwaVqtVFo","type":"text"}],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/categories/660e8df1ee2e2ca872010f89"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"180"},{"key":"ETag","value":"W/\"b4-9wdwJkGIDS9IZqMFNFs1b2dKYUQ\""},{"key":"Date","value":"Fri, 05 Apr 2024 04:18:04 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"660e8df1ee2e2ca872010f89\",\n    \"name\": \"Transformers\",\n    \"description\": \"Various types of transformers\",\n    \"createdAt\": \"2024-04-04T11:24:33.402Z\",\n    \"updatedAt\": \"2024-04-04T11:24:33.402Z\"\n}"}],"_postman_id":"737c9f7a-0b71-418d-b4f5-84b1caa435dc"},{"name":"/categories (admin)","id":"1b4d10a2-bedf-4b26-9e55-240ee3b02dec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGM0YmU2YmJmODY5ZTAyZTlkOGE0NiIsImlhdCI6MTcxMjIyNzQ4NiwiZXhwIjoxNzEyMjM0Njg2fQ.ew-AOneBW-Pj-c12gjuwchmMSiVnYxEIlBOoLlTgQYE","type":"text"}],"body":{"mode":"raw","raw":"{ \"name\": \"Transformers\" \"description\": \"Various types of transformers\" }","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/categories/","description":"<h3 id=\"description\">Description</h3>\n<p>This request is used to create a new user in the database. A user can have two different roles, an admin or a normal user. This is usually referred to as Role Based Authentication(RBAC). The normal user has access to read priviledges while the admin user has access to bth read and write priviledges.</p>\n<h3 id=\"request-parameters\">Request Parameters</h3>\n<p>Far this request, the data is to be sent in the form of <strong>form data</strong>. The data should be added to the body of the request.</p>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th>Parameters</th>\n<th>Description</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>name</td>\n<td>P﻿roduct name</td>\n</tr>\n<tr>\n<td>description</td>\n<td>P﻿roduct description</td>\n</tr>\n<tr>\n<td>price</td>\n<td>P﻿rice of product</td>\n</tr>\n<tr>\n<td>c﻿ategory</td>\n<td>T﻿he id of the category it should be associated with.</td>\n</tr>\n<tr>\n<td>images</td>\n<td>P﻿roduct images</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"response\">Response</h3>\n<p>I﻿f all of the data sent is valid, and you possess admin privileges, the product will be created. If there are any complications, the API will return an error with a message.</p>\n","urlObject":{"protocol":"http","port":"5000","path":["api","v1","categories",""],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"ced251c8-b484-475d-b014-e3b318414187","name":"/categories","originalRequest":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGM1MTA2Y2IyZDVkZGVkOThiYTZiNSIsImlhdCI6MTcxMjIyOTg0NCwiZXhwIjoxNzEyMjM3MDQ0fQ._uz9z0xpN8e4SvTs5vrRJWQZBQeCR9gToUhvbp8QDzc","type":"text"}],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Cables\",\r\n    \"description\": \"Different types and sizes of electrical cables\"\r\n  }","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/categories/"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"191"},{"key":"ETag","value":"W/\"bf-BqoazD4BuF+oT3gCcrIgu5dovos\""},{"key":"Date","value":"Thu, 04 Apr 2024 11:27:29 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"name\": \"Cables\",\n    \"description\": \"Different types and sizes of electrical cables\",\n    \"_id\": \"660e8e9fee2e2ca872010f91\",\n    \"createdAt\": \"2024-04-04T11:27:27.269Z\",\n    \"updatedAt\": \"2024-04-04T11:27:27.269Z\"\n}"}],"_postman_id":"1b4d10a2-bedf-4b26-9e55-240ee3b02dec"},{"name":"/categories/:id (admin)","id":"1c674e21-7bad-4a0f-845c-aa85674f25df","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MDdhM2E4YWNmYzRlOTVhMTZjOTM4OSIsImlhdCI6MTcxMTkwMjQzNSwiZXhwIjoxNzExOTA5NjM1fQ.JZ83e8E4hPxdmKwZDdFjP61BFgGWjX9sVYKxw4SRSa0","type":"text"}],"body":{"mode":"raw","raw":"{\"description\": \"Tools used for electrical works.d\" }","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/categories/66080793053e1618da3270df","urlObject":{"protocol":"http","port":"5000","path":["api","v1","categories","66080793053e1618da3270df"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"9374b424-8d71-4b4d-aa39-0560b5e83332","name":"/categories/:id (admin)","originalRequest":{"method":"PUT","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGVjMGI3NjhmOWVlYWM5MDQ4MWI2ZSIsImlhdCI6MTcxMjI5MDU5NSwiZXhwIjoxNzEyMjk3Nzk1fQ.ycpEu9E21K30qmDgUWEhXO7GBKARnCRSczPwaVqtVFo","type":"text"}],"body":{"mode":"raw","raw":"{\"name\": \"Edited Category\" }","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/categories/660f7bcd501f8a5d20080ff6"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"200"},{"key":"ETag","value":"W/\"c8-TVcs5Jlt4agx9OgUekOq9o6JZLU\""},{"key":"Date","value":"Fri, 05 Apr 2024 04:21:23 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"660f7bcd501f8a5d20080ff6\",\n    \"name\": \"Edited Category\",\n    \"description\": \"Different types and sizes of electrical cables\",\n    \"createdAt\": \"2024-04-05T04:19:25.518Z\",\n    \"updatedAt\": \"2024-04-05T04:21:22.453Z\"\n}"}],"_postman_id":"1c674e21-7bad-4a0f-845c-aa85674f25df"},{"name":"/categories (admin)","id":"ce31b4f4-a1fe-4cdf-8238-e5e851cff965","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MDdhM2E4YWNmYzRlOTVhMTZjOTM4OSIsImlhdCI6MTcxMTc3NzE4NSwiZXhwIjoxNzExNzg0Mzg1fQ.gtvDzctXzPW1GlfZ-5rzl2dz2j6Ap5rRTZQ7RpO6HNM","type":"text"}],"url":"http://localhost:5000/api/v1/categories/6607bc2e7ea7444e9112483a","urlObject":{"protocol":"http","port":"5000","path":["api","v1","categories","6607bc2e7ea7444e9112483a"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"9da7b954-cc02-48f9-ae7c-4cb8ada2de01","name":"/categories (admin)","originalRequest":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGVjMGI3NjhmOWVlYWM5MDQ4MWI2ZSIsImlhdCI6MTcxMjI5MDU5NSwiZXhwIjoxNzEyMjk3Nzk1fQ.ycpEu9E21K30qmDgUWEhXO7GBKARnCRSczPwaVqtVFo","type":"text"}],"url":"http://localhost:5000/api/v1/categories/660f7bcd501f8a5d20080ff6"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"21"},{"key":"ETag","value":"W/\"15-I3n2AsOdaWfcuASvkj163cDtm1k\""},{"key":"Date","value":"Fri, 05 Apr 2024 04:22:11 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": \"deleted\"\n}"}],"_postman_id":"ce31b4f4-a1fe-4cdf-8238-e5e851cff965"}],"id":"e9490984-cb88-4773-a5f1-c40c24455a7d","_postman_id":"e9490984-cb88-4773-a5f1-c40c24455a7d","description":""},{"name":"Products","item":[{"name":"/products","id":"5c40cebf-1736-42d1-b3b0-432e68096eb3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGVjMGI3NjhmOWVlYWM5MDQ4MWI2ZSIsImlhdCI6MTcxMjI5Nzk2MCwiZXhwIjoxNzEyMzA1MTYwfQ.0X12PFStHFz6n20Es-56-PsuZe3VQfRhZYTTUKUUBOU","type":"text"}],"url":"http://localhost:5000/api/v1/products/?page=4","urlObject":{"protocol":"http","port":"5000","path":["api","v1","products",""],"host":["localhost"],"query":[{"key":"page","value":"4"}],"variable":[]}},"response":[],"_postman_id":"5c40cebf-1736-42d1-b3b0-432e68096eb3"},{"name":"/products/:id","id":"52ba4928-66c1-4c43-824f-340c502c1c89","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"52ba4928-66c1-4c43-824f-340c502c1c89"},{"name":"/products","id":"370f437d-4f3f-4e71-8ea2-c4a4ac75b688","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"mandys","type":"text","disabled":true},{"key":"description","value":"This is a new product","type":"text","disabled":true},{"key":"price","value":"500","type":"text","disabled":true},{"key":"category","value":"6607b2cd14b58d78a10a0213","type":"text","disabled":true},{"key":"images","type":"file","fileNotInWorkingDirectoryWarning":"This file isn't in your working directory. Teammates you share this request with won't be able to use this file. To make collaboration easier you can setup your working directory in Settings.","filesNotInWorkingDirectory":["/C:/Users/scott/Downloads/mongodb.png","/C:/Users/scott/Downloads/nodeXexpress.png"],"src":["/C:/Users/scott/Downloads/mongodb.png","/C:/Users/scott/Downloads/nodeXexpress.png"],"disabled":true}]},"url":"http://localhost:5000/api/v1/products/","urlObject":{"protocol":"http","port":"5000","path":["api","v1","products",""],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"370f437d-4f3f-4e71-8ea2-c4a4ac75b688"},{"name":"/products/:id","id":"8c0f3b9b-808f-4806-a8e7-019a68ca490a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGVjMGI3NjhmOWVlYWM5MDQ4MWI2ZSIsImlhdCI6MTcxMjI5Nzk2MCwiZXhwIjoxNzEyMzA1MTYwfQ.0X12PFStHFz6n20Es-56-PsuZe3VQfRhZYTTUKUUBOU","type":"text"}],"url":"http://localhost:5000/api/v1/products/660f9a3bd6a81c834047b493","urlObject":{"protocol":"http","port":"5000","path":["api","v1","products","660f9a3bd6a81c834047b493"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"8c0f3b9b-808f-4806-a8e7-019a68ca490a"},{"name":"/categories/:categoryId/products","id":"20b92a58-b365-4cf4-8a39-705e1cbb9801","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/api/categories/6614e74da97d18f284dabb6a/products","urlObject":{"protocol":"http","port":"5000","path":["api","categories","6614e74da97d18f284dabb6a","products"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"20b92a58-b365-4cf4-8a39-705e1cbb9801"}],"id":"f1856c6e-2491-49ab-a7f9-d11f8770994e","_postman_id":"f1856c6e-2491-49ab-a7f9-d11f8770994e","description":""},{"name":"Cart","item":[{"name":"/carts/:cartId","id":"4d8938ff-6ab2-4f4b-b604-4641160c8e0c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MTE1ZTk3YzI3NDBjYWFjYjdiN2FlNyIsImlhdCI6MTcxMjY2MzY5NiwiZXhwIjoxNzEyNjcwODk2fQ.HCo2kYNdBvirXGcc9Ww17cM9NYDcm7kBfLfSgD-YpCQ","type":"text"}],"url":"http://localhost:5000/api/carts/66115e98c2740caacb7b7ae9","urlObject":{"protocol":"http","port":"5000","path":["api","carts","66115e98c2740caacb7b7ae9"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"4d8938ff-6ab2-4f4b-b604-4641160c8e0c"},{"name":"/carts/:cartId/items","id":"0ce20715-befa-478b-a212-9cf9683e2863","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MTUzZWJhZWI5OTUwYmVkMGIwNThjNyIsImlhdCI6MTcxMjY4NzAyNCwiZXhwIjoxNzEyNjk0MjI0fQ.MTkmhACNbB4Brj3Q-tNRQlS5k_G4RTKOkE4-oLLcWO4","type":"text"}],"body":{"mode":"raw","raw":"{ \"productId\": \"6614e913af692931bf133e78\" , \"quantity\": 3}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/carts/66153ebbeb9950bed0b058c9/items","urlObject":{"protocol":"http","port":"5000","path":["api","carts","66153ebbeb9950bed0b058c9","items"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"0ce20715-befa-478b-a212-9cf9683e2863"},{"name":"/cart/:cartId/items/:itemId","id":"1c6b4007-2092-47fc-8cd0-a6c690884fd6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"1c6b4007-2092-47fc-8cd0-a6c690884fd6"},{"name":"/cart/:cartId/items/:itemId","id":"a1ce469b-9ca4-4fb1-82cb-b9ad20b714fd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MGM0YmU2YmJmODY5ZTAyZTlkOGE0NiIsImlhdCI6MTcxMjE5ODYyNCwiZXhwIjoxNzEyMjA1ODI0fQ.72sDUBvGu-TVu1uEvmT4ElA1K93LSFje2wxuRtYjQ6E","type":"text"}],"url":"http://localhost:5000/api/v1/cart/products/660a59c8ffaf48ad1c4d1a14","urlObject":{"protocol":"http","port":"5000","path":["api","v1","cart","products","660a59c8ffaf48ad1c4d1a14"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"a1ce469b-9ca4-4fb1-82cb-b9ad20b714fd"}],"id":"0dcfb261-b361-4953-bbd9-103c282347ec","_postman_id":"0dcfb261-b361-4953-bbd9-103c282347ec","description":""},{"name":"Orders","item":[{"name":"/orders","id":"4d13bc7b-0103-406e-a2cb-081b017b9b5f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"4d13bc7b-0103-406e-a2cb-081b017b9b5f"},{"name":"/orders","id":"523a8297-003d-4689-bc17-a1703f60e951","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"523a8297-003d-4689-bc17-a1703f60e951"}],"id":"abbd71d1-cafc-42eb-bab7-d868acdd3a77","_postman_id":"abbd71d1-cafc-42eb-bab7-d868acdd3a77","description":""},{"name":"Reviews","item":[{"name":"/reviews","id":"def528f7-251e-4c8b-b72e-288cbf9f88f0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY2MTE1ZTk3YzI3NDBjYWFjYjdiN2FlNyIsImlhdCI6MTcxMjczMzczMywiZXhwIjoxNzEyNzQwOTMzfQ.YLteUwzb_YhJsWeH8qvRtOaDBOtvQsXCce1kHStoDes","type":"text"}],"body":{"mode":"raw","raw":"{\"stars\": 5, \"comment\": \"great product\", \"productId\": \"\"}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/v1/reviews","urlObject":{"protocol":"http","port":"5000","path":["api","v1","reviews"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"def528f7-251e-4c8b-b72e-288cbf9f88f0"},{"name":"/reviews/:id","id":"00f7ab31-5838-4e46-b734-497554b4a28f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"00f7ab31-5838-4e46-b734-497554b4a28f"},{"name":"/products/:productId/reviews","id":"3a80cd31-67d7-4060-98bc-262cc857b32f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"3a80cd31-67d7-4060-98bc-262cc857b32f"},{"name":"/users/:id/reviews","id":"0b10b635-7105-446a-9f5d-a62e43f58574","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"0b10b635-7105-446a-9f5d-a62e43f58574"},{"name":"/reviews/:id","id":"26a3e875-d8ed-40d2-8afd-3407d36e66c0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"26a3e875-d8ed-40d2-8afd-3407d36e66c0"}],"id":"eb0dfed6-0a54-47ad-99ab-4a0150f82438","_postman_id":"eb0dfed6-0a54-47ad-99ab-4a0150f82438","description":""},{"name":"/status","id":"4c8615ac-8202-4869-98bc-227399a32639","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://localhost:5000/status","urlObject":{"protocol":"http","port":"5000","path":["status"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"4c8615ac-8202-4869-98bc-227399a32639"},{"name":"/","id":"45b6ad8b-6d5c-4d69-b7f0-afe0cf14624b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"45b6ad8b-6d5c-4d69-b7f0-afe0cf14624b"},{"name":"New Request","id":"177e1630-11f7-4cbd-aedd-5954c8efac35","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"urlObject":{"query":[],"variable":[]},"url":""},"response":[],"_postman_id":"177e1630-11f7-4cbd-aedd-5954c8efac35"}]}