{"info":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","description":"<html><head></head><body><p>E-commerce API to serve all industries with common business model such as</p>\n<ul>\n<li><p>Malls</p>\n</li>\n<li><p>Restaurants</p>\n</li>\n<li><p>etc</p>\n</li>\n</ul>\n<p>This API currently serve the <a href=\"https://k-user.vercel.app/\">K Food</a> Project</p>\n<p>This is a <strong>BaaS</strong> that decouples partners allowing them to plug in frontend application seemlessly</p>\n<p><strong>Staging Base Url</strong> : <code>https://ecommerce-backend-9tly.onrender.com</code></p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"37346255","collectionId":"795e289a-604c-4fea-9192-c266da0c750a","publishedId":"2sAYJ6CKk5","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"FF6C37"},"publishDate":"2024-12-27T20:18:46.000Z"},"item":[{"name":"authentication","item":[{"name":"register","event":[{"listen":"test","script":{"id":"667efcef-fd75-4f75-b6c1-d534bf42ca16","exec":["let bearerToken = pm.response.headers.get(\"x-bearerToken\")","","pm.collectionVariables.set(\"bearerToken\",bearerToken)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"2c2e73db-d294-48f2-9a11-3a658fa7cdc2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{ \r\n    \"username\": \"testuser\",\r\n    \"email\": \"testuser@gmail.com\",\r\n    \"password\":\"testuser\", \r\n    \"accountType\": \"customer\", // customer,waiter, manager\r\n    \"partnerId\": null //only needed for waiter, manager\r\n }","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/auth/register","description":"<p>Register user as merchant, owner, supervisor or waiter.</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}},"urlObject":{"path":["api","auth","register"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"2c2e73db-d294-48f2-9a11-3a658fa7cdc2"},{"name":"login","event":[{"listen":"test","script":{"id":"f45abd9d-b72e-4ec2-887e-198a5f055c1b","exec":["let bearerToken = pm.response.headers.get(\"x-bearerToken\")","","pm.collectionVariables.set(\"bearerToken\",bearerToken)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"db4a4794-0c0b-42e0-a16c-f38926305a8f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{    \r\n    \"username\": \"testuser\",\r\n    \"password\": \"testuser\"\r\n }","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/auth/login","description":"<p>Authentication of registered users</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}},"urlObject":{"path":["api","auth","login"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"db4a4794-0c0b-42e0-a16c-f38926305a8f"},{"name":"login Management","event":[{"listen":"test","script":{"id":"236a9116-d52e-40db-bd45-34b31da3d0f1","exec":["let bearerToken = pm.response.headers.get(\"x-bearerToken\")","","pm.collectionVariables.set(\"bearerToken\",bearerToken)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"1f361015-290a-405e-b856-ccb7243eff30","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{    \r\n    \"username\": \"testuser\",\r\n    \"password\": \"testuser\"\r\n }","options":{"raw":{"language":"json"}}},"url":"{{baseUrlLocalHost}}/api/partner/auth/login","description":"<p>Authentication of registered users</p>\n","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}},"urlObject":{"path":["api","partner","auth","login"],"host":["{{baseUrlLocalHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"1f361015-290a-405e-b856-ccb7243eff30"}],"id":"471406a9-7b58-4d47-8c16-9f982087ea21","_postman_id":"471406a9-7b58-4d47-8c16-9f982087ea21","description":"","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}}},{"name":"Products","item":[{"name":"CreateProduct","event":[{"listen":"test","script":{"id":"813ccb19-5410-4567-96c6-2edd2db983bb","exec":[""],"type":"text/javascript","packages":{},"requests":{}}},{"listen":"prerequest","script":{"id":"1fb81542-0631-40a0-bf99-1473bbd5865e","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"0168b9f1-deb0-4e8f-ba17-a0a78df100bd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\":\"Tea\",\r\n    \"description\":\"African Tea\",\r\n    \"image\":\"https://scontent.facc1-1.fna.fbcdn.net/v/t1.6435-9/169138224_4121370304581702_6147309186391701802_n.jpg?_nc_cat=110&ccb=1-7&_nc_sid=810d5f&_nc_eui2=AeEZZeBH1uRcWFU2YvCLe4bfq-u-FAYwTe-r674UBjBN74NjOvt6Ym-t0u_usWHrUQ-30RF5jJHwcAv-0NwDGOGh&_nc_ohc=UcOKO3yGB1wAX-y-adH&_nc_ht=scontent.facc1-1.fna&oh=00_AfBzifybQS2Oi_yA8pNVXb35LQWY7q3Vk4-2EDqpiChJhg&oe=65BD5339\",\r\n    \"category\":[\"Supper\"],\r\n    \"size\":\"L\",\r\n    \"color\":\"blue\",\r\n    \"price\":98\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/products/create","description":"<p>Add product to your collection</p>\n","urlObject":{"path":["api","products","create"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"0168b9f1-deb0-4e8f-ba17-a0a78df100bd"},{"name":"GetSingleProduct","event":[{"listen":"prerequest","script":{"id":"04ab3f21-9397-4284-8c97-960f22c7da5d","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"11e62e13-c6f2-42cd-8999-e00813697d2f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/products/{{productID}}","description":"<p>Search for a product</p>\n","urlObject":{"path":["api","products","{{productID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[{"id":"416e967c-a3af-408f-bee6-ee24f6160db8","name":"GetSingleProduct","originalRequest":{"method":"GET","header":[],"url":"{{baseUrlLocalHost}}/api/products/644c81c46c933eb4f4fdce00"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"11e62e13-c6f2-42cd-8999-e00813697d2f"},{"name":"GetAllProducts","event":[{"listen":"prerequest","script":{"id":"0502e2d8-3cf7-452f-a0a0-eb55652e5028","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"87bf1ee9-3794-4443-b9c3-9f0fb00bad61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/products/","urlObject":{"path":["api","products",""],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"87bf1ee9-3794-4443-b9c3-9f0fb00bad61"},{"name":"GetPrivateProduct(not in use for now)","event":[{"listen":"prerequest","script":{"id":"0324ce09-9986-4b67-9cb2-fd867942af5b","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"2e36edf4-e06f-4b51-9d27-ff16d4b5fc4b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/products/private","description":"<p>Get only products of a user to perform further manipulations</p>\n","urlObject":{"path":["api","products","private"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"2e36edf4-e06f-4b51-9d27-ff16d4b5fc4b"},{"name":"UpdateProduct","event":[{"listen":"prerequest","script":{"id":"65ab624e-0fdf-4499-91ae-63ae90ba641b","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"844a81f3-1a9d-497c-92bf-c4cefc3600a8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"desc\":\"A fruit updated\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/products/{{productID}}","description":"<p>Update details of a product</p>\n","urlObject":{"path":["api","products","{{productID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[{"id":"c0a188d3-7cff-48a9-8b6c-5df8329db5c0","name":"UpdateProduct","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"desc\":\"A fruit updated\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseUrlLocalHost}}/api/products/64312b2aa535f9a8e583d53b"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"844a81f3-1a9d-497c-92bf-c4cefc3600a8"}],"id":"0f8d1e69-5861-4a4a-bb02-9e6359db11fe","_postman_id":"0f8d1e69-5861-4a4a-bb02-9e6359db11fe","description":"","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}}},{"name":"Carts","item":[{"name":"CreateCart","event":[{"listen":"prerequest","script":{"id":"a28afc8a-af2b-412f-84fb-afccb28b9b2e","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"695b64d6-4913-427a-a774-d932b21fdc27","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\"userId\":\"643121ec1cb74a068e38625d\",\r\n    \"products\": [\r\n        {\r\n            \"productId\":\"64312b2aa535f9a8e583d53b\",\r\n            \"quantity\":3,\r\n            \"productName\":\"Rice and Stew\",\r\n            \"productImageUrl\":\"https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.delish.com%2Fcooking%2Fa20089653%2Fhow-to-cook-rice%2F&psig=AOvVaw37sQ5qmIJQjyq7mKBCIkhj&ust=1704288975508000&source=images&cd=vfe&ved=0CBEQjRxqFwoTCKD9zK3pvoMDFQAAAAAdAAAAABAE\"\r\n        }\r\n    ]\r\n    }\r\n","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/carts/create","description":"<p>Store a cloud version of carts for cross device access</p>\n","urlObject":{"path":["api","carts","create"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"695b64d6-4913-427a-a774-d932b21fdc27"},{"name":"GetAllCarts","event":[{"listen":"prerequest","script":{"id":"f94d8246-6115-41b7-84c2-25bf57ada346","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"7f04708b-bce0-4b5a-a018-9e7731ec26b4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"body":{"mode":"raw","raw":"","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/carts/","description":"<p>Query all cart for admin dashboard</p>\n","urlObject":{"path":["api","carts",""],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"7f04708b-bce0-4b5a-a018-9e7731ec26b4"},{"name":"DeleteCart","event":[{"listen":"prerequest","script":{"id":"376ab784-33af-4324-b101-56ebc91894d4","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"f75cfb62-d827-4a8f-8b98-6130d9baa4ca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:5000/api/carts/{{cartID}}","description":"<p>Clear cart</p>\n","urlObject":{"path":["api","carts","{{cartID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[{"id":"94a49131-1828-4822-a768-d773fd97cf2b","name":"DeleteCart","originalRequest":{"method":"DELETE","header":[],"url":"{{baseUrlLocalHost}}/api/carts/644c8f4ff1d2439a2dae6c2f"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"f75cfb62-d827-4a8f-8b98-6130d9baa4ca"}],"id":"c1277c1c-20e2-4fa1-ac6c-2d39d887cab5","description":"<p>Cart are only for customers</p>\n","_postman_id":"c1277c1c-20e2-4fa1-ac6c-2d39d887cab5","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}}},{"name":"Orders","item":[{"name":"UpdateOrders","event":[{"listen":"prerequest","script":{"id":"7b59d28b-a6e9-4cad-8827-64414f8867a7","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"40c7e7f3-dc41-473d-88dd-110524d3bf0e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"Status\":\"accepted\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/orders/{{orderID}}","description":"<p>Update an order details</p>\n","urlObject":{"path":["api","orders","{{orderID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[{"id":"d88f3912-271f-4de1-a80e-bc44a2d04f90","name":"UpdateOrders","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{\r\n    \"Status\":\"accepted\"\r\n}","options":{"raw":{"language":"json"}}},"url":"{{baseUrlLocalHost}}/api/orders/644c81c46c933eb4f4fdce00"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"40c7e7f3-dc41-473d-88dd-110524d3bf0e"},{"name":"DeleteSingleOrder","event":[{"listen":"prerequest","script":{"id":"a512130b-bcdd-428e-a2cc-56c0bb2f9872","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"041ad685-e38f-43d9-a869-187484972b6b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:5000/api/orders/{{orderID}}","description":"<p>Delete an order</p>\n<p><strong>Business Rule</strong></p>\n<ul>\n<li>Only Partner can delete orders</li>\n</ul>\n","urlObject":{"path":["api","orders","{{orderID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[{"id":"00a5a536-e26f-41d0-a213-88989705be84","name":"DeleteSingleOrder","originalRequest":{"method":"DELETE","header":[],"url":"{{baseUrlLocalHost}}/api/orders/644c81c46c933eb4f4fdce00"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"041ad685-e38f-43d9-a869-187484972b6b"},{"name":"CreateOrders","event":[{"listen":"prerequest","script":{"id":"9c9e9b79-5ef9-4aff-9e5c-144a9835a9ae","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"30f0795b-903d-4ee0-a0e7-d1983474081b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"userId\":\"643121ec1cb74a068e38625d\",\r\n    \"products\":[\r\n        {\r\n            \"productId\":\r\n                \"64312b2aa535f9a8e583d53b\"\r\n            ,\r\n            \"quantity\":1,\r\n            \"productName\":\"Rice and Stew\",\r\n            \"productImageUrl\":\"https://www.google.com/url?sa=i&url=https%3A%2F%2Fwww.delish.com%2Fcooking%2Fa20089653%2Fhow-to-cook-rice%2F&psig=AOvVaw37sQ5qmIJQjyq7mKBCIkhj&ust=1704288975508000&source=images&cd=vfe&ved=0CBEQjRxqFwoTCKD9zK3pvoMDFQAAAAAdAAAAABAE\"\r\n\r\n        }\r\n    ],\r\n    \"amount\":200,\r\n    \"address\":{\"city\":\"Accra\"},\r\n    \"Status\":\"pending\"\r\n\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/orders/create","description":"<p>Allow customers make an order</p>\n","urlObject":{"path":["api","orders","create"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"30f0795b-903d-4ee0-a0e7-d1983474081b"},{"name":"GetAllOrders","event":[{"listen":"prerequest","script":{"id":"6f843889-0922-4194-9f6f-69faadfd8bda","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"5721abdb-1c37-471c-9249-976ff2417336","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/orders/","description":"<p>Customers can Query for all orders</p>\n","urlObject":{"path":["api","orders",""],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"5721abdb-1c37-471c-9249-976ff2417336"},{"name":"Get Order details","event":[{"listen":"prerequest","script":{"id":"30f40947-5dd6-4d49-b815-954f3db68c69","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"b594a7fa-472b-4bbd-9222-0e5fc94cc0d2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/orders/{{orderId}}","description":"<p>Customers can Query for all orders</p>\n","urlObject":{"path":["api","orders","{{orderId}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"b594a7fa-472b-4bbd-9222-0e5fc94cc0d2"}],"id":"2504c4b6-3b09-4921-8f79-8f17c395c261","description":"<p>Partners solely update and delete orders</p>\n","_postman_id":"2504c4b6-3b09-4921-8f79-8f17c395c261","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}}},{"name":"Accounts","item":[{"name":"Update User","event":[{"listen":"prerequest","script":{"id":"6b8e8bba-a291-4a20-a884-765e1a559a35","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"d5a8e87e-9cf7-4df9-a9c7-5d600bc75851","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{ \r\n    \"username\": \"fee112\",\r\n    \"password\": \"asd\"\r\n }","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/users/{{userID}}","description":"<p>Update details of authenticated users</p>\n","urlObject":{"path":["api","users","{{userID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[{"id":"34f46bac-b1e2-43ad-9dfd-baad23e0ef54","name":"updateuser","originalRequest":{"method":"PUT","header":[],"body":{"mode":"raw","raw":"{ \r\n    \"username\": \"fee112\",\r\n    \"password\": \"asd\"\r\n }","options":{"raw":{"language":"json"}}},"url":"{{baseUrlLocalHost}}/api/users/64077ed046b2192144986845"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"d5a8e87e-9cf7-4df9-a9c7-5d600bc75851"},{"name":"Delete User","event":[{"listen":"prerequest","script":{"id":"99605747-63c6-4054-af09-6a06384f179c","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"78cb1232-92f8-4740-b75f-bc2ef6b23f48","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:5000/api/users/{{userID}}","urlObject":{"path":["api","users","{{userID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"78cb1232-92f8-4740-b75f-bc2ef6b23f48"}],"id":"aa156e5d-1913-466b-b7c5-2a1d7d18c30f","_postman_id":"aa156e5d-1913-466b-b7c5-2a1d7d18c30f","description":"","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}}},{"name":"Partner","item":[{"name":"Account Permissions","item":[{"name":"Create Role","event":[{"listen":"prerequest","script":{"id":"1f09db41-1c1e-4884-9cf6-396a5ca30782","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"93bab0b4-059c-4c13-86c5-fcf055bab629","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"url":"http://localhost:5000/api/partner/role/create","urlObject":{"path":["api","partner","role","create"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"93bab0b4-059c-4c13-86c5-fcf055bab629"},{"name":"create persmission","event":[{"listen":"prerequest","script":{"id":"36bba6c3-f7cc-49cd-88cf-b493d1f6a9e6","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"d5bea835-b324-4940-95d2-124bd5aa22e1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"tableName\": \"test\",\n    \"actions\": [\n        \"create\",\n        \"read\",\n        \"update\",\n        \"delete\"\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/partner/permission/create","urlObject":{"path":["api","partner","permission","create"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"d5bea835-b324-4940-95d2-124bd5aa22e1"},{"name":"Assign Permission To Role","event":[{"listen":"prerequest","script":{"id":"50830785-d2e4-48d1-93a6-6e4b7df03d9c","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"1f3b3c3c-8ffc-4361-b48d-253b6ef60077","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"raw","raw":"{roleId, permissionIds}","options":{"raw":{"language":"json"}}},"url":"http://localhost:5000/api/partner/role/{{userID}}","urlObject":{"path":["api","partner","role","{{userID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"1f3b3c3c-8ffc-4361-b48d-253b6ef60077"},{"name":"Get All Permissions","event":[{"listen":"prerequest","script":{"id":"ed3e7205-b108-49de-8681-d239dcc856b7","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"655ec262-227a-40cd-a566-f9e7db183703","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/partner/permission","urlObject":{"path":["api","partner","permission"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"655ec262-227a-40cd-a566-f9e7db183703"},{"name":"Get Permission","event":[{"listen":"prerequest","script":{"id":"bc2da668-74fc-4375-a833-34fb7f317fe0","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"1af221b9-9f4d-41e3-b1aa-6c036fc450cd","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/partner/permission/{{ID}}","urlObject":{"path":["api","partner","permission","{{ID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"1af221b9-9f4d-41e3-b1aa-6c036fc450cd"},{"name":"Get All Roles","event":[{"listen":"prerequest","script":{"id":"772e7507-514d-489d-8c7c-5ddcb8d566f3","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"02997060-1e0b-49ba-b780-07d0b86c9202","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/partner/role","urlObject":{"path":["api","partner","role"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"02997060-1e0b-49ba-b780-07d0b86c9202"},{"name":"Get Role","event":[{"listen":"prerequest","script":{"id":"3c0dfb31-df4f-4831-a9d6-894ddb691d68","exec":["let x_apiKey = pm.collectionVariables.get(\"x-apiKey\")","pm.request.headers.append(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"fc7ec0c4-703b-49d8-949a-376c29e5c034","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":""}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:5000/api/partner/role/{{ID}}","urlObject":{"path":["api","partner","role","{{ID}}"],"host":["http://localhost:5000"],"query":[],"variable":[]}},"response":[],"_postman_id":"fc7ec0c4-703b-49d8-949a-376c29e5c034"}],"id":"cbd7f19c-ac95-4642-b219-619206b77f47","description":"<p>Partner access control management</p>\n","_postman_id":"cbd7f19c-ac95-4642-b219-619206b77f47","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}}},{"name":"Generate API Key","item":[{"name":"Generate API Key(not in use)","event":[{"listen":"test","script":{"id":"783b067c-b95c-48b4-887c-d973fdc17913","exec":["let response = pm.response.json()","let x_apiKey = response.apiKey","","pm.collectionVariables.set(\"x-apiKey\",x_apiKey)"],"type":"text/javascript","packages":{},"requests":{}}}],"id":"f7d698b5-fef7-4328-8def-2716386e472e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"raw","raw":"{ \r\n    \"username\": \"testuser\",\r\n    \"email\": \"testuser@gmail.com\",\r\n    \"password\":\"testuser\" // account type is partner by default\r\n }","options":{"raw":{"language":"json"}}},"url":"{{baseUrlLocalHost}}/api/partner/auth/register","description":"<p>Register user as a Partner and returns API Key.</p>\n","urlObject":{"path":["api","partner","auth","register"],"host":["{{baseUrlLocalHost}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f7d698b5-fef7-4328-8def-2716386e472e"}],"id":"2d582433-f522-4486-bd9a-abdcc5054c88","_postman_id":"2d582433-f522-4486-bd9a-abdcc5054c88","description":"","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}}}],"id":"1f8d3285-6775-4159-9b55-73ff4865d75f","_postman_id":"1f8d3285-6775-4159-9b55-73ff4865d75f","description":"","auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]},"isInherited":true,"source":{"_postman_id":"795e289a-604c-4fea-9192-c266da0c750a","id":"795e289a-604c-4fea-9192-c266da0c750a","name":"E-commerce Backend : Nodejs","type":"collection"}}}],"auth":{"type":"apikey","apikey":{"basicConfig":[{"key":"key","value":"x-apiKey"},{"key":"value","value":""}]}},"event":[{"listen":"prerequest","script":{"id":"ef47d20d-c888-4310-858d-0880361d907e","type":"text/javascript","packages":{},"requests":{},"exec":[""]}},{"listen":"test","script":{"id":"16b81338-065c-4def-958e-9e65a0636387","type":"text/javascript","packages":{},"requests":{},"exec":[""]}}],"variable":[{"key":"devBaseUrl","value":"http://localhost:5000"},{"key":"testBaseUrl","value":"https://ecommerce-backend-9tly.onrender.com"},{"key":"prodBaseUrl","value":""},{"key":"x-apiKey","value":""},{"key":"bearerToken","value":""}]}