{"info":{"_postman_id":"851bdc03-7ece-46da-8617-fb5c7013f743","name":"CSP2-ECommerce-API","description":"<html><head></head><body><p>The <strong>CSP2-ECommerce-API</strong> is a RESTful service built with <strong>Express.js</strong> and <strong>MongoDB</strong>.</p>\n<p>It provides endpoints for managing users, products, carts, and orders.</p>\n<p>This API supports authentication, admin privileges, and standard e-commerce operations such as:</p>\n<ul>\n<li><p>User registration, login, and profile retrieval</p>\n</li>\n<li><p>Product creation, retrieval, updating, and search</p>\n</li>\n<li><p>Cart management (add, update, remove items)</p>\n</li>\n<li><p>Order creation and tracking</p>\n</li>\n<li><p>Admin-only access for managing users and products</p>\n</li>\n</ul>\n<p>Use this documentation to test and explore all available endpoints within <strong>Postman</strong>.<a href=\"https://4ishcfixzh.execute-api.us-east-2.amazonaws.com/production\"><br><br></a>Request Url : &lt; base url&gt;/endpoint</p>\n<p>Example Request:<br>GET <a href=\"https://4ishcfixzh.execute-api.us-east-2.amazonaws.com/production/products/active\">https://example.com/products/active</a></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"49213711","collectionId":"851bdc03-7ece-46da-8617-fb5c7013f743","publishedId":"2sB3Wjx2vs","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2025-10-23T07:16:06.000Z"},"item":[{"name":"Users","item":[{"name":"get user details","id":"9ffae561-d603-446b-a9a8-d0202172089b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"/users/details","description":"<p><strong>Description:</strong></p>\n<p>Retrieves the details of the currently authenticated user.</p>\n<p>Requires a valid <strong>access token</strong> in the request authorization header.</p>\n<p><strong>Use Case:</strong></p>\n<p>Used to fetch user profile information after login.</p>\n<p><strong>Access:</strong></p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["users","details"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"5c6a8b05-98e5-4508-9133-64fb6e21f5a8","name":"success","originalRequest":{"method":"GET","header":[],"url":"http://localhost:4000/users/details"},"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":"157"},{"key":"ETag","value":"W/\"9d-38e9T6s1jhfrAhtWpLUq8653IXM\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:44:13 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"user\": {\n        \"_id\": \"68f9dbb0140b4ed01ae4927e\",\n        \"firstName\": \"test\",\n        \"lastName\": \"user\",\n        \"email\": \"testuser@mail.com\",\n        \"isAdmin\": false,\n        \"mobileNo\": \"09876543211\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"9ffae561-d603-446b-a9a8-d0202172089b"},{"name":"register user","id":"ba4ca10c-48c2-4ae4-bda9-1ae4dd945e57","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n        \"firstName\" : \"test\",\r\n        \"lastName\" : \"user\",\r\n        \"email\" : \"testuser@mail.com\",\r\n        \"mobileNo\" : \"09876543211\",\r\n        \"password\" : \"password123\"\r\n    }","options":{"raw":{"language":"json"}}},"url":"/users/register","description":"<p><strong>Description:</strong>  </p>\n<p>Creates a new user account by providing required user information such as first name, last name, email, password, and mobile number.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used for user sign-up or account creation.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Public</p>\n","urlObject":{"path":["users","register"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"43099f27-6f0d-47f5-8a40-cb0fd3aca3bc","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n        \"firstName\" : \"test\",\r\n        \"lastName\" : \"user\",\r\n        \"email\" : \"testuser@mail.com\",\r\n        \"mobileNo\" : \"09876543211\",\r\n        \"password\" : \"test123456\"\r\n    }","options":{"raw":{"language":"json"}}},"url":"/users/register"},"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":"37"},{"key":"ETag","value":"W/\"25-4wuOnm3SDOVtWXfdo5HkKUMFJSI\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:33:34 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Registered Successfully\"\n}"},{"id":"27178a5e-8a40-46b8-a69c-11d8b8b2fc83","name":"fail (invalid input fields)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n        \"firstName\" : \"test\",\r\n        \"lastName\" : \"user\",\r\n        \"email\" : \"testusermail.com\",\r\n        \"mobileNo\" : \"09876543211\",\r\n        \"password\" : \"password123\"\r\n    }","options":{"raw":{"language":"json"}}},"url":"/users/register"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"25"},{"key":"ETag","value":"W/\"19-Nr6ECQyfI75n8P4VdVlSW56vRU8\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:53:56 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Email invalid\"\n}"},{"id":"700d1f48-6ab9-420a-9a97-76c1502578b7","name":"fail (duplicate email)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n        \"firstName\" : \"test\",\r\n        \"lastName\" : \"user\",\r\n        \"email\" : \"testuser@mail.com\",\r\n        \"mobileNo\" : \"09876543211\",\r\n        \"password\" : \"password123\"\r\n    }","options":{"raw":{"language":"json"}}},"url":"/users/register"},"status":"Conflict","code":409,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"36"},{"key":"ETag","value":"W/\"24-5B56xuvmw3IrU+e3WAtyoxowjFk\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:57:31 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Email already registered\"\n}"}],"_postman_id":"ba4ca10c-48c2-4ae4-bda9-1ae4dd945e57"},{"name":"login user","id":"6dac495d-ec3e-4f57-94cd-a9b132179800","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\" : \"testuser@mail.com\",\r\n    \"password\": \"password123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/users/login","description":"<p><strong>Description:</strong>  </p>\n<p>Authenticates a user using email and password credentials.  </p>\n<p>Returns a <strong>JSON Web Token (JWT)</strong> to be used for accessing protected routes.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used for logging in an existing user.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Public</p>\n","urlObject":{"path":["users","login"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"8b0b93f9-7046-4b46-96d0-754bf9d9dd3e","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\" : \"testuser@mail.com\",\r\n    \"password\": \"password123\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/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":"220"},{"key":"ETag","value":"W/\"dc-F0HLYyTLsIEXzr0QHL30hYu0pE4\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:40:41 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"access\": \"{{vault:json-web-token}}\"\n}"},{"id":"3d3dd067-f23a-4b96-a29d-6dea1e886e53","name":"fail (unauthorized)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\" : \"testuser@mail.com\",\r\n    \"password\": \"password12345\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/users/login"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"43"},{"key":"ETag","value":"W/\"2b-TXX7dziEhDOEpPjXNFJAp0IGpCg\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:59:05 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Email and password do not match\"\n}"}],"_postman_id":"6dac495d-ec3e-4f57-94cd-a9b132179800"},{"name":"set user as admin","id":"bcf485e1-b1aa-4a3e-8454-41b012e863d8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"/users/:userId/set-as-admin","description":"<p><strong>Description:</strong></p>\n<p>Grants admin privileges to a specific user by updating their <code>isAdmin</code> status to <code>true</code>.</p>\n<p><strong>Use Case:</strong></p>\n<p>Used by existing admins to promote another user to admin role.</p>\n<p><strong>Access:</strong></p>\n<p>🔴 Admin only</p>\n","urlObject":{"path":["users",":userId","set-as-admin"],"host":[""],"query":[],"variable":[{"type":"any","value":"","key":"userId"}]}},"response":[{"id":"19a7d8e9-1275-4edf-b29b-075720e81331","name":"success","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"/users/:userId/set-as-admin","host":[""],"path":["users",":userId","set-as-admin"],"variable":[{"key":"userId","value":""}]}},"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":"237"},{"key":"ETag","value":"W/\"ed-7AVo4GkCZrNbvGidY2n8w3c+u10\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:47:06 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"updatedUser\": {\n        \"_id\": \"68f9dbb0140b4ed01ae4927e\",\n        \"firstName\": \"test\",\n        \"lastName\": \"user\",\n        \"email\": \"testuser@mail.com\",\n        \"password\": \"$2b$10$7eWkZBswIBPDBAE.nTXWbuzB6zhyfz1T5cSmFz7VkVzS2RPVTmdbS\",\n        \"isAdmin\": true,\n        \"mobileNo\": \"09876543211\",\n        \"__v\": 0\n    }\n}"},{"id":"5297ed92-2a23-47e5-b228-e951eec2e3b4","name":"success (already an admin)","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"/users/:userId/set-as-admin","host":[""],"path":["users",":userId","set-as-admin"],"variable":[{"key":"userId","value":""}]}},"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":"38"},{"key":"ETag","value":"W/\"26-iRYWSEubaDRFF1bkX9SlbVFFWaM\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:47:45 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"User is already an admin\"\n}"},{"id":"a0b5e6db-7c0a-4260-aa79-d1deee1145d1","name":"fail (unauthorized)","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":{"raw":"/users/:userId/set-as-admin","host":[""],"path":["users",":userId","set-as-admin"],"variable":[{"key":"userId","value":""}]}},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"46"},{"key":"ETag","value":"W/\"2e-MWsz/xq6kbARKfBHbQOnIWn/bD0\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:00:47 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"auth\": \"Failed\",\n    \"message\": \"Action Forbidden\"\n}"}],"_postman_id":"bcf485e1-b1aa-4a3e-8454-41b012e863d8"},{"name":"update password","id":"63800cbc-d5b7-474f-9d8c-446dd64f2119","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"newPassword\" : \"password1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/users/update-password","description":"<p><strong>Description:</strong></p>\n<p>Allows a logged-in user to update their account password.</p>\n<p>Requires the new password in the request body.</p>\n<p><strong>Use Case:</strong></p>\n<p>Used when users want to change their password securely.</p>\n<p><strong>Access:</strong></p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["users","update-password"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"f1c18d8d-4a07-4da7-9f5b-08c03cbfc782","name":"success","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"newPassword\" : \"password1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/users/update-password"},"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":"41"},{"key":"ETag","value":"W/\"29-JLWAnLrf6qmJkXqaEuCQpWt9O0c\""},{"key":"Date","value":"Thu, 23 Oct 2025 07:49:20 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Password reset successfully\"\n}"},{"id":"99177405-3dfa-4cf4-9a06-f7f82493923c","name":"fail (incorrect current password)","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"currentPassword\": \"123445678\",\r\n    \"newPassword\" : \"password1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/users/update-password"},"status":"Unauthorized","code":401,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"41"},{"key":"ETag","value":"W/\"29-OBQ2DeaEQJlcLtA0Myvo8NbNoz4\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:04:20 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"Current password is incorrect\"\n}"},{"id":"e725db52-5974-41c3-acf8-c151cddee04e","name":"fail (invalid password)","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"currentPassword\" : \"password123\",\r\n    \"newPassword\" : \"pw\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/users/update-password"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"59"},{"key":"ETag","value":"W/\"3b-F1muhwNslKJznP7HlYst7tGI7SE\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:05:56 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"New password must be at least 8 characters long\"\n}"}],"_postman_id":"63800cbc-d5b7-474f-9d8c-446dd64f2119"}],"id":"455e231c-e8bb-4a4c-b57f-de5d4001e179","description":"<p>Handles all <strong>user-related operations</strong> including registration, login, profile retrieval, and admin actions.  </p>\n<p>Endpoints under this folder manage user authentication, authorization, and role management.</p>\n","_postman_id":"455e231c-e8bb-4a4c-b57f-de5d4001e179"},{"name":"Products","item":[{"name":"get all products","id":"729e10d6-28c8-4f69-b788-8bc3b584c4e0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"/products/all","description":"<p><strong>Description:</strong>  </p>\n<p>Retrieves all products from the database, including both active and inactive ones.  </p>\n<p>Useful for <strong>admin views</strong> and overall product management.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used by admins to view all existing products.</p>\n<p><strong>Access:</strong>  </p>\n<p>🔴 Admin only</p>\n","urlObject":{"path":["products","all"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"d3130180-077c-4dea-9780-56f9a6e42a66","name":"success","originalRequest":{"method":"GET","header":[],"url":"/products/all"},"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":"1008"},{"key":"ETag","value":"W/\"3f0-C8pDKzEDUfRh9Uny6/1GlCtE1uA\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:11:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"_id\": \"68f86c3e6d12db90a22a6044\",\n        \"name\": \"LOGITECH F310 GAMEPAD Pro11111\",\n        \"description\": \"Play hits and classics. Play console ports with their native-style controller or adopt a more relaxed position while enjoying PC games. F310 is easy to set up and use with your favorite games thanks to XInput/DirectInput1Requires software installation for DirectInput mode. —the two most common input standards.\",\n        \"price\": 1500,\n        \"isActive\": true,\n        \"createdOn\": \"2025-10-22T05:31:42.950Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"68f87c7c57eb82baf7f07c89\",\n        \"name\": \"test product\",\n        \"description\": \"test product description\",\n        \"price\": 2000,\n        \"isActive\": true,\n        \"createdOn\": \"2025-10-22T06:41:00.766Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"68f97a4dd4154f74896ab97e\",\n        \"name\": \"test product 2\",\n        \"description\": \"test product description\",\n        \"price\": 500,\n        \"isActive\": true,\n        \"createdOn\": \"2025-10-23T00:43:57.100Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"68f97a55d4154f74896ab981\",\n        \"name\": \"test product 3\",\n        \"description\": \"test product description\",\n        \"price\": 2000,\n        \"isActive\": false,\n        \"createdOn\": \"2025-10-23T00:44:05.231Z\",\n        \"__v\": 0\n    }\n]"},{"id":"7aac842a-c250-4ac7-a040-5efe9e51b87f","name":"fail (unauthorized)","originalRequest":{"method":"GET","header":[],"url":"/products/all"},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"46"},{"key":"ETag","value":"W/\"2e-MWsz/xq6kbARKfBHbQOnIWn/bD0\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:12:10 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"auth\": \"Failed\",\n    \"message\": \"Action Forbidden\"\n}"}],"_postman_id":"729e10d6-28c8-4f69-b788-8bc3b584c4e0"},{"name":"get all active products","id":"0bef574a-bce3-43eb-9e42-ff316c10fd0a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"/products/active","description":"<p><strong>Description:</strong>  </p>\n<p>Fetches all <strong>active products</strong> available for customers to browse or purchase.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used by customers to display available items in the store.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Public</p>\n","urlObject":{"path":["products","active"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"55538d92-1c0c-47f6-a79d-dd858914b4ba","name":"success","originalRequest":{"method":"GET","header":[],"url":"/products/active"},"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":"831"},{"key":"ETag","value":"W/\"33f-af63sgj43JO1I/y3gmL88b4FVMI\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:11:28 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"_id\": \"68f86c3e6d12db90a22a6044\",\n        \"name\": \"LOGITECH F310 GAMEPAD Pro11111\",\n        \"description\": \"Play hits and classics. Play console ports with their native-style controller or adopt a more relaxed position while enjoying PC games. F310 is easy to set up and use with your favorite games thanks to XInput/DirectInput1Requires software installation for DirectInput mode. —the two most common input standards.\",\n        \"price\": 1500,\n        \"isActive\": true,\n        \"createdOn\": \"2025-10-22T05:31:42.950Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"68f87c7c57eb82baf7f07c89\",\n        \"name\": \"test product\",\n        \"description\": \"test product description\",\n        \"price\": 2000,\n        \"isActive\": true,\n        \"createdOn\": \"2025-10-22T06:41:00.766Z\",\n        \"__v\": 0\n    },\n    {\n        \"_id\": \"68f97a4dd4154f74896ab97e\",\n        \"name\": \"test product 2\",\n        \"description\": \"test product description\",\n        \"price\": 500,\n        \"isActive\": true,\n        \"createdOn\": \"2025-10-23T00:43:57.100Z\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"0bef574a-bce3-43eb-9e42-ff316c10fd0a"},{"name":"get product by id","id":"554d8681-6005-4415-a2ea-9a2b6ab0480b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"/products/:productId","description":"<p><strong>Description:</strong>  </p>\n<p>Retrieves detailed information about a specific product using its <strong>ID</strong>.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used to view product details on a product page.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Public</p>\n","urlObject":{"path":["products",":productId"],"host":[""],"query":[],"variable":[{"type":"any","value":"","key":"productId"}]}},"response":[{"id":"b69d7622-9f3a-4b12-8cae-b4d6c5709ed4","name":"success","originalRequest":{"method":"GET","header":[],"url":{"raw":"/products/:productId","host":[""],"path":["products",":productId"],"variable":[{"key":"productId","value":""}]}},"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":"173"},{"key":"ETag","value":"W/\"ad-xQFgCdYA9k9DNrbY4AN1A9Xb8d0\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:15:07 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"_id\": \"68f87c7c57eb82baf7f07c89\",\n    \"name\": \"test product\",\n    \"description\": \"test product description\",\n    \"price\": 2000,\n    \"isActive\": true,\n    \"createdOn\": \"2025-10-22T06:41:00.766Z\",\n    \"__v\": 0\n}"}],"_postman_id":"554d8681-6005-4415-a2ea-9a2b6ab0480b"},{"name":"create product","id":"05a66030-7a57-46a2-bbbd-f0b966dd38df","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"test product 3\",\r\n    \"description\": \"test product description\",\r\n    \"price\": 2000\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/","description":"<p><strong>Description:</strong>  </p>\n<p>Creates a new product by providing its name, description, and price.  </p>\n<p>The newly created product is active by default.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used by admins to add new products to the catalog.</p>\n<p><strong>Access:</strong>  </p>\n<p>🔴 Admin only</p>\n","urlObject":{"path":["products",""],"host":[""],"query":[],"variable":[]}},"response":[{"id":"2f872e5d-dc18-454f-892e-d741f17d1d48","name":"fail (existing product name)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"test product\",\r\n    \"description\": \"test product description\",\r\n    \"price\": 2000\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/"},"status":"Conflict","code":409,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"36"},{"key":"ETag","value":"W/\"24-s8WgZks72QHSYy1PjBBcBb9NZBc\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:17:09 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product already exists\"\n}"},{"id":"b77923b2-4cab-4990-b4b2-6e78308ce33e","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"product test\",\r\n    \"description\": \"test product description\",\r\n    \"price\": 1000\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/"},"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":"173"},{"key":"ETag","value":"W/\"ad-nWIsbVLIxwXGI5e40tnDoO0Bu2o\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:19:03 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"name\": \"product test\",\n    \"description\": \"test product description\",\n    \"price\": 1000,\n    \"isActive\": true,\n    \"_id\": \"68f9e4f73b878357ac3e0143\",\n    \"createdOn\": \"2025-10-23T08:19:03.603Z\",\n    \"__v\": 0\n}"}],"_postman_id":"05a66030-7a57-46a2-bbbd-f0b966dd38df"},{"name":"search product by name","id":"719a03c6-48b3-4bc2-b138-64582603e4fe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"caroline\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/search-by-name","description":"<p><strong>Description:</strong></p>\n<p>Searches for products by name using a case-insensitive keyword match.</p>\n<p><strong>Use Case:</strong></p>\n<p>Used for implementing a product search bar or keyword search.</p>\n<p><strong>Access:</strong></p>\n<p>🟢 Public</p>\n","urlObject":{"path":["products","search-by-name"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"49cb2681-f727-4cab-b6f1-833934c204c9","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"LOGITECH\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/search-by-name"},"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":"510"},{"key":"ETag","value":"W/\"1fe-ZUiWRBw9bGTp/wd1pTfsTrJByAo\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:20:50 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"products\": [\n        {\n            \"_id\": \"68f86c3e6d12db90a22a6044\",\n            \"name\": \"LOGITECH F310 GAMEPAD Pro11111\",\n            \"description\": \"Play hits and classics. Play console ports with their native-style controller or adopt a more relaxed position while enjoying PC games. F310 is easy to set up and use with your favorite games thanks to XInput/DirectInput1Requires software installation for DirectInput mode. —the two most common input standards.\",\n            \"price\": 1500,\n            \"isActive\": true,\n            \"createdOn\": \"2025-10-22T05:31:42.950Z\",\n            \"__v\": 0\n        }\n    ]\n}"},{"id":"668e6197-df94-4f0e-b979-ab88108f6459","name":"fail","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"computer\"\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/search-by-name"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"32"},{"key":"ETag","value":"W/\"20-n1RfghLMoj/BeFZvNPw9MM6AZvg\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:22:12 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"No products found.\"\n}"}],"_postman_id":"719a03c6-48b3-4bc2-b138-64582603e4fe"},{"name":"search product by price","id":"50337d7a-b5e7-4dfb-8b17-d3bd0dce61b8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"minPrice\" : 1000,\r\n    \"maxPrice\" : 2000\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/search-by-price","description":"<p><strong>Description:</strong>  </p>\n<p>Finds products within a specified <strong>price range</strong> (e.g., minimum and maximum price).</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used for filtering products by price in listings or store filters.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Public</p>\n","urlObject":{"path":["products","search-by-price"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"4b6c7d65-ae7f-4395-9880-c3282894c5e2","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"minPrice\" : 2000,\r\n    \"maxPrice\" : 5000\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/search-by-price"},"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":"215"},{"key":"ETag","value":"W/\"d7-TDDT3bwvlADS96gEsiJlf/YOKYs\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:23:12 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Products found\",\n    \"products\": [\n        {\n            \"_id\": \"68f87c7c57eb82baf7f07c89\",\n            \"name\": \"test product\",\n            \"description\": \"test product description\",\n            \"price\": 2000,\n            \"isActive\": true,\n            \"createdOn\": \"2025-10-22T06:41:00.766Z\",\n            \"__v\": 0\n        }\n    ]\n}"},{"id":"5fb5d1bc-276e-48f7-bb3e-191c87b74969","name":"fail","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"minPrice\" : 5000,\r\n    \"maxPrice\" : 10000\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/search-by-price"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"55"},{"key":"ETag","value":"W/\"37-yUV9fJ1s5/CW8HAl0fen7WFsWgE\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:23:36 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"No products found within this price range\"\n}"}],"_postman_id":"50337d7a-b5e7-4dfb-8b17-d3bd0dce61b8"},{"name":"update product","id":"7c10a48d-2fea-4bdf-9e5b-067a714a5836","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"new product test\",\r\n    \"description\": \"new product description.\",\r\n    \"price\": 1500\r\n}","options":{"raw":{"language":"json"}}},"url":"/products/:productId/update","description":"<p><strong>Description:</strong>  </p>\n<p>Updates product details such as name, description, or price.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used by admins to modify existing product information.</p>\n<p><strong>Access:</strong>  </p>\n<p>🔴 Admin only</p>\n","urlObject":{"path":["products",":productId","update"],"host":[""],"query":[],"variable":[{"type":"any","value":"","key":"productId"}]}},"response":[{"id":"46c6ffc4-4daa-47c1-b8ef-a4f2dab380c4","name":"success","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"new product test\",\r\n    \"description\": \"new product description.\",\r\n    \"price\": 1500\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"/products/:productId/update","host":[""],"path":["products",":productId","update"],"variable":[{"key":"productId","value":""}]}},"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":"57"},{"key":"ETag","value":"W/\"39-C+oVLIhKX/hMPCBXBZKJYGuX2u8\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:25:01 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Product updated successfully\"\n}"},{"id":"6951ac84-84a1-4667-9b16-633d0064d262","name":"fail (unauthorized)","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\" : \"LOGITECH F310 GAMEPAD Pro11111\",\r\n    \"description\": \"Play hits and classics. Play console ports with their native-style controller or adopt a more relaxed position while enjoying PC games. F310 is easy to set up and use with your favorite games thanks to XInput/DirectInput1Requires software installation for DirectInput mode. —the two most common input standards.\",\r\n    \"price\": 1500\r\n}","options":{"raw":{"language":"json"}}},"url":{"raw":"/products/:productId/update","host":[""],"path":["products",":productId","update"],"variable":[{"key":"productId","value":""}]}},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"46"},{"key":"ETag","value":"W/\"2e-MWsz/xq6kbARKfBHbQOnIWn/bD0\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:25:43 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"auth\": \"Failed\",\n    \"message\": \"Action Forbidden\"\n}"}],"_postman_id":"7c10a48d-2fea-4bdf-9e5b-067a714a5836"},{"name":"archive product","id":"500ff20d-3e67-49dc-bfb2-465ec449c812","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PATCH","header":[],"url":"http://localhost:4000/products/:productId/archive","description":"<p><strong>Description:</strong>  </p>\n<p>Marks a product as <strong>inactive</strong> (<code>isActive: false</code>), effectively removing it from the customer’s product list without deleting it.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used by admins to temporarily hide or disable a product.</p>\n<p><strong>Access:</strong>  </p>\n<p>🔴 Admin only</p>\n","urlObject":{"protocol":"http","port":"4000","path":["products",":productId","archive"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"productId"}]}},"response":[{"id":"dae9ae78-fbb5-43f6-9160-c45f81da8363","name":"success","originalRequest":{"method":"PATCH","header":[],"url":{"raw":"http://localhost:4000/products/:productId/archive","protocol":"http","host":["localhost"],"port":"4000","path":["products",":productId","archive"],"variable":[{"key":"productId","value":""}]}},"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":"58"},{"key":"ETag","value":"W/\"3a-4YXQC0sPiD5FfWwYVJSW9XOXI3s\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:27:53 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Product archived successfully\"\n}"},{"id":"b243f89e-feaa-4489-885c-4f92005bfdc4","name":"success (product already archived)","originalRequest":{"method":"PATCH","header":[],"url":{"raw":"http://localhost:4000/products/:productId/archive","protocol":"http","host":["localhost"],"port":"4000","path":["products",":productId","archive"],"variable":[{"key":"productId","value":""}]}},"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":"235"},{"key":"ETag","value":"W/\"eb-p5EwgLygpzEVCGrn9F/TEpq4SXo\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:30:39 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product already archived\",\n    \"archivedProduct\": {\n        \"_id\": \"68f9e4f73b878357ac3e0143\",\n        \"name\": \"new product test\",\n        \"description\": \"new product description.\",\n        \"price\": 1500,\n        \"isActive\": false,\n        \"createdOn\": \"2025-10-23T08:19:03.603Z\",\n        \"__v\": 0\n    }\n}"},{"id":"2c9234c3-4bd6-47e2-b976-c54bb6ca354a","name":"fail (unauthorized)","originalRequest":{"method":"PATCH","header":[],"url":{"raw":"http://localhost:4000/products/:productId/archive","protocol":"http","host":["localhost"],"port":"4000","path":["products",":productId","archive"],"variable":[{"key":"productId","value":""}]}},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"46"},{"key":"ETag","value":"W/\"2e-MWsz/xq6kbARKfBHbQOnIWn/bD0\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:32:01 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"auth\": \"Failed\",\n    \"message\": \"Action Forbidden\"\n}"}],"_postman_id":"500ff20d-3e67-49dc-bfb2-465ec449c812"},{"name":"activate product","id":"37caddf4-724a-4c26-a091-3e9420dac4aa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PATCH","header":[],"url":"http://localhost:4000/products/:productId/activate","description":"<p><strong>Description:</strong>  </p>\n<p>Reactivates a previously archived product by setting <code>isActive: true</code>.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used by admins to make an archived product visible again.</p>\n<p><strong>Access:</strong>  </p>\n<p>🔴 Admin only</p>\n","urlObject":{"protocol":"http","port":"4000","path":["products",":productId","activate"],"host":["localhost"],"query":[],"variable":[{"type":"any","value":"","key":"productId"}]}},"response":[{"id":"3abb986c-3f59-4581-9b8e-7c9816e88647","name":"success","originalRequest":{"method":"PATCH","header":[{"key":"","value":"","type":"text","disabled":true}],"url":{"raw":"http://localhost:4000/products/:productId/activate","protocol":"http","host":["localhost"],"port":"4000","path":["products",":productId","activate"],"variable":[{"key":"productId","value":""}]}},"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":"59"},{"key":"ETag","value":"W/\"3b-NC5rJcpf5yloLl0rosyi7OEK1RI\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:30:56 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"success\": true,\n    \"message\": \"Product activated successfully\"\n}"},{"id":"96c9b5f6-4855-4ac1-9053-313334a99b1a","name":"success (product already activated)","originalRequest":{"method":"PATCH","header":[{"key":"","value":"","type":"text","disabled":true}],"url":{"raw":"http://localhost:4000/products/:productId/activate","protocol":"http","host":["localhost"],"port":"4000","path":["products",":productId","activate"],"variable":[{"key":"productId","value":""}]}},"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":"235"},{"key":"ETag","value":"W/\"eb-tHi4SxPELp+hW0m/CH0OqwVMHIE\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:31:13 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product already activated\",\n    \"activateProduct\": {\n        \"_id\": \"68f9e4f73b878357ac3e0143\",\n        \"name\": \"new product test\",\n        \"description\": \"new product description.\",\n        \"price\": 1500,\n        \"isActive\": true,\n        \"createdOn\": \"2025-10-23T08:19:03.603Z\",\n        \"__v\": 0\n    }\n}"},{"id":"d48dde38-6cac-4e9c-8517-00fca7bba306","name":"fail (unauthorized)","originalRequest":{"method":"PATCH","header":[{"key":"","value":"","type":"text","disabled":true}],"url":{"raw":"http://localhost:4000/products/:productId/activate","protocol":"http","host":["localhost"],"port":"4000","path":["products",":productId","activate"],"variable":[{"key":"productId","value":""}]}},"status":"Forbidden","code":403,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"46"},{"key":"ETag","value":"W/\"2e-MWsz/xq6kbARKfBHbQOnIWn/bD0\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:32:48 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"auth\": \"Failed\",\n    \"message\": \"Action Forbidden\"\n}"}],"_postman_id":"37caddf4-724a-4c26-a091-3e9420dac4aa"}],"id":"835f735c-8cce-4b37-9737-66b538cece40","description":"<p>Contains endpoints for managing <strong>product data</strong> in the e-commerce platform.  </p>\n<p>Users can browse and search for products, while admins can add, update, or deactivate products.</p>\n","_postman_id":"835f735c-8cce-4b37-9737-66b538cece40"},{"name":"Carts","item":[{"name":"get cart","id":"c8fb8ff0-16f8-4892-97c6-c2119de94c20","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"/cart/get-cart","description":"<p><strong>Description:</strong>  </p>\n<p>Retrieves the current user’s shopping cart, including all items, quantities, and total price.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used to display the user’s active cart before checkout.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["cart","get-cart"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"9bafbc27-ecbe-4d78-9c78-68db0fc76c1b","name":"fail (no existing cart)","originalRequest":{"method":"GET","header":[],"url":"/cart/get-cart"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"25"},{"key":"ETag","value":"W/\"19-Wf0V+roNQlKXEWodjmWNrdR9Ji0\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:33:42 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"error\": \"No Cart Found\"\n}"},{"id":"7a55d32c-7abf-4bdf-9720-8fba9ae388a8","name":"success","originalRequest":{"method":"GET","header":[],"url":"/cart/get-cart"},"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":"254"},{"key":"ETag","value":"W/\"fe-A/2rvvCuD2vxMFENs8AF5fcve3s\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:35:11 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"_id\": \"68f9e8ac3b878357ac3e0168\",\n        \"userId\": \"68f9dbb0140b4ed01ae4927e\",\n        \"cartItems\": [\n            {\n                \"productId\": \"68f9e4f73b878357ac3e0143\",\n                \"quantity\": 1,\n                \"subtotal\": 1500,\n                \"_id\": \"68f9e8ac3b878357ac3e0169\"\n            }\n        ],\n        \"totalPrice\": 1500,\n        \"orderedOn\": \"2025-10-23T08:34:52.161Z\",\n        \"__v\": 0\n    }\n]"}],"_postman_id":"c8fb8ff0-16f8-4892-97c6-c2119de94c20"},{"name":"add to cart","id":"26dc2027-851e-43b7-98cb-0794dfaaa958","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"productId\": \"68f87c7c57eb82baf7f07c89\",\r\n    \"price\": 2000,\r\n    \"quantity\": 1,\r\n    \"subtotal\": 2000\r\n}","options":{"raw":{"language":"json"}}},"url":"/cart/add-to-cart","description":"<p><strong>Description:</strong>  </p>\n<p>Adds a product to the user’s shopping cart.  </p>\n<p>If the product already exists in the cart, its quantity and subtotal are updated accordingly.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used when a customer adds an item to their cart from a product page or listing.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["cart","add-to-cart"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"3082576b-3526-4b1e-950a-cfe5e092c85f","name":"success","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"productId\": \"68f87c7c57eb82baf7f07c89\",\r\n    \"price\": 2000,\r\n    \"quantity\": 1,\r\n    \"subtotal\": 2000\r\n}","options":{"raw":{"language":"json"}}},"url":"/cart/add-to-cart"},"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":"418"},{"key":"ETag","value":"W/\"1a2-def0+0RdR4yHRee3y9kFTKyh0tY\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:36:27 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Item quantity updated successfully\",\n    \"updatedCart\": {\n        \"_id\": \"68f9e8ac3b878357ac3e0168\",\n        \"userId\": \"68f9dbb0140b4ed01ae4927e\",\n        \"cartItems\": [\n            {\n                \"productId\": \"68f9e4f73b878357ac3e0143\",\n                \"quantity\": 1,\n                \"subtotal\": 1500,\n                \"_id\": \"68f9e8ac3b878357ac3e0169\"\n            },\n            {\n                \"productId\": \"68f87c7c57eb82baf7f07c89\",\n                \"quantity\": 2,\n                \"subtotal\": 4000,\n                \"_id\": \"68f9e8f93b878357ac3e0170\"\n            }\n        ],\n        \"totalPrice\": 5500,\n        \"orderedOn\": \"2025-10-23T08:34:52.161Z\",\n        \"__v\": 1\n    }\n}"},{"id":"b969556f-b4a5-48dc-bbe0-d0682572b965","name":"fail (product not found)","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"productId\": \"68f87c7c57eb82baf7f07c80\",\r\n    \"price\": 2000,\r\n    \"quantity\": 1,\r\n    \"subtotal\": 2000\r\n}","options":{"raw":{"language":"json"}}},"url":"/cart/add-to-cart"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"31"},{"key":"ETag","value":"W/\"1f-Zkgaox/LmBaRs1Ofkuc8bu8COvo\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:36:59 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product not found\"\n}"}],"_postman_id":"26dc2027-851e-43b7-98cb-0794dfaaa958"},{"name":"update cart quantity","id":"553fd81a-51db-42d7-85a3-5906cd84170b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"productId\": \"68f87c7c57eb82baf7f07c89\",\r\n    \"newQuantity\": 1\r\n}","options":{"raw":{"language":"json"}}},"url":"/cart/update-cart-quantity","description":"<p><strong>Description:</strong></p>\n<p>Updates the quantity of a specific product already in the cart and recalculates the subtotal and total price.</p>\n<p><strong>Use Case:</strong></p>\n<p>Used when a customer changes the quantity of an item in their cart.</p>\n<p><strong>Access:</strong></p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["cart","update-cart-quantity"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"6f982e48-b525-4e93-9d55-e05c385b7aff","name":"success","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"productId\": \"68f87c7c57eb82baf7f07c89\",\r\n    \"newQuantity\": 2\r\n}","options":{"raw":{"language":"json"}}},"url":"/cart/update-cart-quantity"},"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":"418"},{"key":"ETag","value":"W/\"1a2-def0+0RdR4yHRee3y9kFTKyh0tY\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:37:40 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Item quantity updated successfully\",\n    \"updatedCart\": {\n        \"_id\": \"68f9e8ac3b878357ac3e0168\",\n        \"userId\": \"68f9dbb0140b4ed01ae4927e\",\n        \"cartItems\": [\n            {\n                \"productId\": \"68f9e4f73b878357ac3e0143\",\n                \"quantity\": 1,\n                \"subtotal\": 1500,\n                \"_id\": \"68f9e8ac3b878357ac3e0169\"\n            },\n            {\n                \"productId\": \"68f87c7c57eb82baf7f07c89\",\n                \"quantity\": 2,\n                \"subtotal\": 4000,\n                \"_id\": \"68f9e8f93b878357ac3e0170\"\n            }\n        ],\n        \"totalPrice\": 5500,\n        \"orderedOn\": \"2025-10-23T08:34:52.161Z\",\n        \"__v\": 1\n    }\n}"},{"id":"b397ccad-c26f-4c36-ae9c-1118f54eb4c2","name":"fail (product not found)","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\r\n    \"productId\": \"68f87c7c57eb82baf7f07c80\",\r\n    \"newQuantity\": 1\r\n}","options":{"raw":{"language":"json"}}},"url":"/cart/update-cart-quantity"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"31"},{"key":"ETag","value":"W/\"1f-Zkgaox/LmBaRs1Ofkuc8bu8COvo\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:38:21 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product not found\"\n}"}],"_postman_id":"553fd81a-51db-42d7-85a3-5906cd84170b"},{"name":"remove item from cart","id":"1f3d2444-4aba-4a05-a6af-a2ce4f0e7188","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PATCH","header":[],"url":"/cart/:productId/remove-from-cart","description":"<p><strong>Description:</strong>  </p>\n<p>Removes a specific product from the user’s cart.  </p>\n<p>The total price is automatically updated after removal.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used when a customer deletes an item from their shopping cart.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["cart",":productId","remove-from-cart"],"host":[""],"query":[{"disabled":true,"key":"","value":""}],"variable":[{"type":"any","value":"","key":"productId"}]}},"response":[{"id":"18cca182-0ff9-49f9-aa04-5605cd06b7f5","name":"success","originalRequest":{"method":"PATCH","header":[],"url":{"raw":"/cart/:productId/remove-from-cart","host":[""],"path":["cart",":productId","remove-from-cart"],"query":[{"key":"","value":null,"type":"text","disabled":true}],"variable":[{"key":"productId","value":""}]}},"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":"316"},{"key":"ETag","value":"W/\"13c-LxmrXh/y5NHxH+E8u2QfauuVJ2M\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:39:10 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Item removed from cart successfully\",\n    \"updatedCart\": {\n        \"_id\": \"68f9e8ac3b878357ac3e0168\",\n        \"userId\": \"68f9dbb0140b4ed01ae4927e\",\n        \"cartItems\": [\n            {\n                \"productId\": \"68f87c7c57eb82baf7f07c89\",\n                \"quantity\": 2,\n                \"subtotal\": 4000,\n                \"_id\": \"68f9e8f93b878357ac3e0170\"\n            }\n        ],\n        \"totalPrice\": 4000,\n        \"orderedOn\": \"2025-10-23T08:34:52.161Z\",\n        \"__v\": 2\n    }\n}"},{"id":"28e8999c-a8f6-4cad-a1e4-4c57b7c09291","name":"fail (product not found)","originalRequest":{"method":"PATCH","header":[],"url":{"raw":"/cart/:productId/remove-from-cart","host":[""],"path":["cart",":productId","remove-from-cart"],"query":[{"key":"","value":null,"type":"text","disabled":true}],"variable":[{"key":"productId","value":"68f9e4f73b878357ac3e0147"}]}},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"31"},{"key":"ETag","value":"W/\"1f-Zkgaox/LmBaRs1Ofkuc8bu8COvo\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:40:15 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product not found\"\n}"}],"_postman_id":"1f3d2444-4aba-4a05-a6af-a2ce4f0e7188"},{"name":"clear cart","id":"294cd6d1-bbd4-4ac1-a7b9-789ee37be96f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"productId\": \"68f87c7c57eb82baf7f07c89\",\r\n    \"newQuantity\": 2\r\n}"},"url":"/cart/clear-cart","description":"<p><strong>Description:</strong>  </p>\n<p>Removes <strong>all items</strong> from the user’s shopping cart, resetting it to an empty state.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used when a customer wants to completely clear their cart before adding new items or logging out.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["cart","clear-cart"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"f1ff177c-99bc-4eb9-b061-a5c89b7e7b9c","name":"success","originalRequest":{"method":"PUT","header":[],"url":"/cart/clear-cart"},"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":"194"},{"key":"ETag","value":"W/\"c2-nWrMvKvM26jjcb63ojOPonD16wM\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:40:55 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Cart cleared successfully\",\n    \"cart\": {\n        \"_id\": \"68f9e8ac3b878357ac3e0168\",\n        \"userId\": \"68f9dbb0140b4ed01ae4927e\",\n        \"cartItems\": [],\n        \"totalPrice\": 0,\n        \"orderedOn\": \"2025-10-23T08:34:52.161Z\",\n        \"__v\": 3\n    }\n}"},{"id":"94053b6a-4d23-4b1f-8070-7181f0fa39f0","name":"fail (cart already empty)","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"productId\": \"68f87c7c57eb82baf7f07c89\",\r\n    \"newQuantity\": 2\r\n}"},"url":"/cart/clear-cart"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"36"},{"key":"ETag","value":"W/\"24-qfCuSlpYOitb2UMLf+Y5jy2DHQs\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:41:19 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Cart is already empty.\"\n}"}],"_postman_id":"294cd6d1-bbd4-4ac1-a7b9-789ee37be96f"}],"id":"2e097db7-bf38-4443-9ad4-211bdf261a1e","description":"<p>Includes endpoints for <strong>shopping cart management</strong> for authenticated users.  </p>\n<p>Users can add products to their cart, update quantities, and view their current cart contents.</p>\n","_postman_id":"2e097db7-bf38-4443-9ad4-211bdf261a1e"},{"name":"Orders","item":[{"name":"checkout","id":"c7d46b0e-4d3a-4b36-8d3a-4438423e8d22","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"url":"/orders/checkout","description":"<p><strong>Description:</strong></p>\n<p>Processes the user’s checkout by creating a new order based on the contents of their current cart.</p>\n<p>After a successful checkout.</p>\n<p><strong>Use Case:</strong></p>\n<p>Used when a customer proceeds to checkout and confirms their purchase.</p>\n<p><strong>Access:</strong></p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["orders","checkout"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"a1db0c18-317b-4263-9549-2c41c92b9e8d","name":"fail (cart already empty)","originalRequest":{"method":"POST","header":[],"url":"/orders/checkout"},"status":"Bad Request","code":400,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"27"},{"key":"ETag","value":"W/\"1b-o3MnawzYxpn9m9OqDfmxZIGYquw\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:42:33 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Cart is empty\"\n}"},{"id":"b83b5d88-fdcf-474a-9379-a6085c140419","name":"success","originalRequest":{"method":"POST","header":[],"url":"/orders/checkout"},"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":"326"},{"key":"ETag","value":"W/\"146-u0N+epJc7JKboqEBX4JAK2rhLKg\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:43:21 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Order created successfully\",\n    \"order\": {\n        \"userId\": \"68f9dbb0140b4ed01ae4927e\",\n        \"productsOrdered\": [\n            {\n                \"productId\": \"68f87c7c57eb82baf7f07c89\",\n                \"quantity\": 1,\n                \"subtotal\": 2000,\n                \"_id\": \"68f9ea993b878357ac3e0191\"\n            }\n        ],\n        \"totalPrice\": 2000,\n        \"status\": \"Pending\",\n        \"_id\": \"68f9eaa93b878357ac3e0195\",\n        \"orderedOn\": \"2025-10-23T08:43:21.006Z\",\n        \"__v\": 0\n    }\n}"}],"_postman_id":"c7d46b0e-4d3a-4b36-8d3a-4438423e8d22"},{"name":"get all orders","id":"e9c11a2d-5e64-428c-ab4f-bb267b92b936","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"/orders/all-orders","description":"<p><strong>Description:</strong>  </p>\n<p>Retrieves all orders from all users.  </p>\n<p>Intended for <strong>admin users</strong> to monitor, manage, and analyze orders across the platform.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used by admins to view all placed orders for reporting or order management.</p>\n<p><strong>Access:</strong>  </p>\n<p>🔴 Admin only</p>\n","urlObject":{"path":["orders","all-orders"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"d5361ca4-ea98-4bfe-a612-674ad80e772d","name":"success","originalRequest":{"method":"GET","header":[],"url":"/orders/all-orders"},"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":"603"},{"key":"ETag","value":"W/\"25b-fBCxHMwO6VFxLZdCSIOEy8nc+qs\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:46:30 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Orders found\",\n    \"count\": 2,\n    \"orders\": [\n        {\n            \"_id\": \"68f9a0ad7c7d504efc7b938e\",\n            \"userId\": \"68f8460bda32b0ca6e7692e1\",\n            \"productsOrdered\": [\n                {\n                    \"productId\": \"68f87c7c57eb82baf7f07c89\",\n                    \"quantity\": 1,\n                    \"subtotal\": 2000,\n                    \"_id\": \"68f9a0a37c7d504efc7b9389\"\n                }\n            ],\n            \"totalPrice\": 2000,\n            \"status\": \"Pending\",\n            \"orderedOn\": \"2025-10-23T03:27:41.974Z\",\n            \"__v\": 0\n        },\n        {\n            \"_id\": \"68f9eaa93b878357ac3e0195\",\n            \"userId\": \"68f9dbb0140b4ed01ae4927e\",\n            \"productsOrdered\": [\n                {\n                    \"productId\": \"68f87c7c57eb82baf7f07c89\",\n                    \"quantity\": 1,\n                    \"subtotal\": 2000,\n                    \"_id\": \"68f9ea993b878357ac3e0191\"\n                }\n            ],\n            \"totalPrice\": 2000,\n            \"status\": \"Pending\",\n            \"orderedOn\": \"2025-10-23T08:43:21.006Z\",\n            \"__v\": 0\n        }\n    ]\n}"},{"id":"d3d5d2d4-cf5b-4232-965d-fce2795d1813","name":"fail (no orders found)","originalRequest":{"method":"GET","header":[],"url":"/orders/all-orders"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"29"},{"key":"ETag","value":"W/\"1d-ef88ZXFKUy3RA36tgBi4ZakOvR8\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:47:11 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"No orders found\"\n}"}],"_postman_id":"e9c11a2d-5e64-428c-ab4f-bb267b92b936"},{"name":"get user's order","id":"c1513860-3767-4ba6-b12c-21a32fb346fe","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"/orders/my-orders","description":"<p><strong>Description:</strong>  </p>\n<p>Fetches all orders belonging to the currently logged-in user.  </p>\n<p>Displays a user’s personal order history, including product details, status, and order date.</p>\n<p><strong>Use Case:</strong>  </p>\n<p>Used by customers to view their past purchases and track order status.</p>\n<p><strong>Access:</strong>  </p>\n<p>🟢 Authenticated users only</p>\n","urlObject":{"path":["orders","my-orders"],"host":[""],"query":[],"variable":[]}},"response":[{"id":"1938b0d7-f11a-4845-b5c3-efec244eed13","name":"fail (no orders found)","originalRequest":{"method":"GET","header":[],"url":"/orders/my-orders"},"status":"Not Found","code":404,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"29"},{"key":"ETag","value":"W/\"1d-ef88ZXFKUy3RA36tgBi4ZakOvR8\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:47:53 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"No orders found\"\n}"},{"id":"f2ed0413-e04d-4164-9149-e1ac3bb9d910","name":"success","originalRequest":{"method":"GET","header":[],"url":"/orders/my-orders"},"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":"325"},{"key":"ETag","value":"W/\"145-pOlcgBJqSI5gxMhRPlGh6NRitW4\""},{"key":"Date","value":"Thu, 23 Oct 2025 08:48:41 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Orders found\",\n    \"count\": 1,\n    \"orders\": [\n        {\n            \"_id\": \"68f9ebd996cdf069c8fb0994\",\n            \"userId\": \"68f9dbb0140b4ed01ae4927e\",\n            \"productsOrdered\": [\n                {\n                    \"productId\": \"68f87c7c57eb82baf7f07c89\",\n                    \"quantity\": 1,\n                    \"subtotal\": 2000,\n                    \"_id\": \"68f9ea993b878357ac3e0191\"\n                }\n            ],\n            \"totalPrice\": 2000,\n            \"status\": \"Pending\",\n            \"orderedOn\": \"2025-10-23T08:48:25.884Z\",\n            \"__v\": 0\n        }\n    ]\n}"}],"_postman_id":"c1513860-3767-4ba6-b12c-21a32fb346fe"}],"id":"92297359-73ea-4ca3-ba8b-633242c79b35","description":"<p>Manages <strong>order-related operations</strong> including checkout, order history, and admin order management.</p>\n<p>Users can place orders from their carts, while admins can view and update order statuses.</p>\n","_postman_id":"92297359-73ea-4ca3-ba8b-633242c79b35"}],"event":[{"listen":"prerequest","script":{"id":"b6ba7bc0-b0e3-4af9-9606-666259f4b44b","type":"text/javascript","packages":{},"requests":{},"exec":[""]}},{"listen":"test","script":{"id":"1fec8a6e-64fb-4fd8-9bd7-b89a0ac150a4","type":"text/javascript","packages":{},"requests":{},"exec":[""]}}],"variable":[{"key":"admin_token","value":""},{"key":"regular_token","value":""},{"key":"base_url","value":"","disabled":true},{"key":":userId","value":""},{"key":":productId","value":""},{"key":"base_url","value":"","disabled":true},{"key":"base_url","value":""}]}