{"info":{"_postman_id":"ee299890-e041-4ba0-a5e8-11c664aa05b9","name":"Mini Ecommerce Api Dcumentation","description":"<html><head></head><body><h2 id=\"this-is-documentation-on-how-to-use-this-simple-mini-e-commerce-api\">This is documentation on how to use this simple Mini e-commerce API</h2>\n<h3 id=\"to-get-started\">To get started.</h3>\n<blockquote>\n<p>You need to be authenicate to perform any API request.<br>You need to have a product category and sub category to create a product.<br><strong>Note:</strong> make sure you follow the order as listed below if you are using the API for the first time.</p>\n</blockquote>\n<ul>\n<li><code>Register a user to generate a token, if you registered a user u can log in with the user's details with</code> <strong><code>Authentication API</code></strong></li>\n<li><code>Create a Product category using the create</code> <strong><code>Category API.</code></strong></li>\n<li><code>Create a Product Sub Category using the create</code> <strong><code>Sub-category API.</code></strong></li>\n<li><code>Create a Product using the Create</code> <strong><code>Product API.</code></strong></li>\n</ul>\n<blockquote>\n<p>NOTE: You can perform crud operation using the Category APIs, Sub Category APIs and Product APIs</p>\n</blockquote>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"12234489","collectionId":"ee299890-e041-4ba0-a5e8-11c664aa05b9","publishedId":"UVJcnHCT","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-11-29T18:41:36.000Z"},"item":[{"name":"Authentication APIs","item":[{"name":"Login request","event":[{"listen":"test","script":{"id":"ffefb711-def9-48a7-8676-33d6b98b64ea","exec":["pm.test(\"Body matches string\", function () {","    pm.expect(pm.response.text()).to.include(\"token\");","});","pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript"}}],"id":"162c6763-455e-4b41-bfaf-d3e0525f56b3","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"email","value":"email@email.com","type":"text"},{"key":"password","value":"password","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/login","description":"<p>This is <strong>Post request</strong>, pass an email and  a password to the body of the request.\nfor example:</p>\n<p><code>email: email@email.com</code>\n<code>password: password</code></p>\n<p>After a successful login a unique bearer token will be generated</p>\n","urlObject":{"protocol":"https","path":["api","login"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"dfd2eb19-14f5-4c6d-9917-4122adb30c81","name":"Login request","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"description":"the email address you registered","key":"email","value":"email@email.com","type":"text"},{"description":"enter your password","key":"password","value":"password","type":"text"}]},"url":{"raw":"https://myecommerce-api.herokuapp.com/api/login","protocol":"https","host":["myecommerce-api","herokuapp","com"],"path":["api","login"],"query":[{"key":"email","value":"","disabled":true},{"key":"password","value":null,"disabled":true}]}},"_postman_previewlanguage":"Text","header":[],"cookie":[],"responseTime":null,"body":"{\n    \"type\": \"bearer\",\n    \"token\": \"MTY.r3JeQOlpZsItzgbap_AH518tfY9SnYnv3-YMencUjdgrIHxE9hqYE072mOAm\",\n    \"expires_at\": \"2021-12-09T12:11:57.554+00:00\"\n}"}],"_postman_id":"162c6763-455e-4b41-bfaf-d3e0525f56b3"},{"name":"registration Request","event":[{"listen":"test","script":{"id":"d1689395-b1b1-48e9-bf30-1e5e076d450e","exec":[""],"type":"text/javascript"}}],"id":"0a65b481-d78a-4266-be7b-1d7c4f7e1bc9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"first_name","value":"string","type":"text"},{"key":"last_name","value":"string","type":"text"},{"key":"email","value":"valid email","type":"text"},{"key":"username","value":"string","type":"text"},{"key":"address","value":"text","type":"text"},{"key":"contact_number","value":"number","type":"text"},{"key":"password","value":"string","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/register","description":"<p>This is a <strong>POST REQUEST</strong> for creating a new user account, after successfully creating of account you will be automatically be logged in and a unique token will be generated for you.</p>\n","urlObject":{"protocol":"https","path":["api","register"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"76ab569d-4195-47bb-9674-9d965dceefbb","name":"registration Request","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"first_name","value":"John","type":"text","description":"must be a string"},{"key":"last_name","value":"Doe","type":"text"},{"key":"email","value":"email@email.com","type":"text"},{"key":"username","value":"johndoe","type":"text"},{"key":"address","value":"No, 15 john str","type":"text"},{"key":"contact_number","value":"040349304","type":"text"},{"key":"password","value":"password","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/register"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"type\": \"bearer\",\n    \"token\": \"MTY.r3JeQOlpZsItzgbap_AH518tfY9SnYnv3-YMencUjdgrIHxE9hqYE072mOAm\",\n    \"expires_at\": \"2021-12-09T12:11:57.554+00:00\"\n}"}],"_postman_id":"0a65b481-d78a-4266-be7b-1d7c4f7e1bc9"}],"id":"b28c48e3-5a67-4e8b-88dd-67790f403a7c","auth":{"type":"noauth","isInherited":false},"event":[{"listen":"prerequest","script":{"id":"47654377-bfbe-4075-a772-055f6b29c20f","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"984715dd-b6f2-4d64-9dab-53a2f60ea617","type":"text/javascript","exec":[""]}}],"_postman_id":"b28c48e3-5a67-4e8b-88dd-67790f403a7c","description":""},{"name":"Product APIs","item":[{"name":"Create a product","event":[{"listen":"test","script":{"id":"f2b8f81a-9f15-46f5-9222-e7d1a03e7fe8","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript"}}],"id":"180155ff-d5c7-4fb7-b520-b76d6bafab29","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"title","value":"string","type":"text"},{"key":"subcategory","value":"string","type":"text"},{"key":"category","value":"string","type":"text"},{"key":"description","value":"text","type":"text"},{"key":"calendar_days","value":"string","type":"text"},{"key":"address","value":"text","type":"text"},{"key":"price","value":"float","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/product","description":"<p>This <strong>POST REQUEST</strong>, is used to create a product in the database, to successfully create a product you need to first create a category and a sub category. because product creation depends category and sub category.</p>\n","urlObject":{"protocol":"https","path":["api","product"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"31b8f6b2-c718-4575-94eb-14eaca3d24c9","name":"Create a product","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"title","value":"product 5","type":"text"},{"key":"subcategory","value":"sub-category 2","type":"text"},{"key":"category","value":"category 1","type":"text"},{"key":"description","value":"This is a beatuiful product but it","type":"text"},{"key":"calendar_days","value":"Tuesday","type":"text"},{"key":"address","value":"No, 15 john str","type":"text"},{"key":"price","value":"670.30","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/product"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product created succussfully\",\n    \"productCreated\": {\n        \"title\": \"new product\",\n        \"user_id\": 2,\n        \"category_id\": 3,\n        \"sub_category_id\": 5,\n        \"address\": \"No, 15 john str\",\n        \"description\": \"This is a beatuiful product buy it\",\n        \"calendar_days\": \"Tuesday\",\n        \"price\": 240.3,\n        \"created_at\": \"2021-11-29T12:18:10.369+00:00\",\n        \"updated_at\": \"2021-11-29T12:18:10.369+00:00\",\n        \"id\": 5\n    }\n}"}],"_postman_id":"180155ff-d5c7-4fb7-b520-b76d6bafab29"},{"name":"Get all the Products","event":[{"listen":"test","script":{"id":"c9aa4fca-1ac9-4f95-84d5-68724bfccdd0","exec":["pm.test(\"Status code is 200\", function () {","    pm.response.to.have.status(200);","});"],"type":"text/javascript"}}],"id":"70ad343c-afff-4abd-b5c9-b52f6ba6e446","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/product","description":"<h2 id=\"this-get-request-gets-all-the-products-and-their-details\">This <em>GET Request</em> gets all the products and their details</h2>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","name":"Product APIs","type":"folder"}},"urlObject":{"protocol":"https","path":["api","product"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"66aa1256-85de-449a-ab68-ee337340a4fd","name":"Get all the Products","originalRequest":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/category"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 2,\n        \"user_id\": 1,\n        \"category_id\": 2,\n        \"day_type\": \"type 1\",\n        \"sub_category_id\": 1,\n        \"title\": \"product 3\",\n        \"address\": \"No, 15 john str\",\n        \"calendar_days\": \"Monday\",\n        \"description\": \"This is a beatuiful product but it\",\n        \"price\": 500.08,\n        \"created_at\": \"2021-11-28T20:06:34.008+00:00\",\n        \"updated_at\": \"2021-11-28T20:08:41.435+00:00\",\n        \"user\": {\n            \"id\": 1,\n            \"username\": \"mroz\",\n            \"first_name\": \"Pascal\",\n            \"last_name\": \"Dike\",\n            \"email\": \"ozioma@gmail.com\",\n            \"address\": \"No, 15 john str\",\n            \"contact_number\": \"040349304\",\n            \"status\": \"ACTIVE\",\n            \"type\": \"Admin\",\n            \"remember_me_token\": null,\n            \"created_at\": \"2021-11-28T20:01:16.582+00:00\",\n            \"updated_at\": \"2021-11-28T20:01:16.582+00:00\"\n        },\n        \"category\": {\n            \"id\": 2,\n            \"name\": \"category 2\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:03:06.738+00:00\",\n            \"updated_at\": \"2021-11-28T20:03:06.738+00:00\"\n        },\n        \"subCategory\": null\n    },\n    {\n        \"id\": 3,\n        \"user_id\": 1,\n        \"category_id\": 2,\n        \"day_type\": \"type 1\",\n        \"sub_category_id\": 1,\n        \"title\": \"product 3\",\n        \"address\": \"No, 15 john str\",\n        \"calendar_days\": \"Monday\",\n        \"description\": \"This is a beatuiful product but it\",\n        \"price\": 450.9,\n        \"created_at\": \"2021-11-28T20:07:05.200+00:00\",\n        \"updated_at\": \"2021-11-28T20:09:49.519+00:00\",\n        \"user\": {\n            \"id\": 1,\n            \"username\": \"mroz\",\n            \"first_name\": \"Pascal\",\n            \"last_name\": \"Dike\",\n            \"email\": \"ozioma@gmail.com\",\n            \"address\": \"No, 15 john str\",\n            \"contact_number\": \"040349304\",\n            \"status\": \"ACTIVE\",\n            \"type\": \"Admin\",\n            \"remember_me_token\": null,\n            \"created_at\": \"2021-11-28T20:01:16.582+00:00\",\n            \"updated_at\": \"2021-11-28T20:01:16.582+00:00\"\n        },\n        \"category\": {\n            \"id\": 2,\n            \"name\": \"category 2\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:03:06.738+00:00\",\n            \"updated_at\": \"2021-11-28T20:03:06.738+00:00\"\n        },\n        \"subCategory\": null\n    },\n    {\n        \"id\": 5,\n        \"user_id\": 2,\n        \"category_id\": 3,\n        \"day_type\": \"type 1\",\n        \"sub_category_id\": 5,\n        \"title\": \"new product\",\n        \"address\": \"No, 15 john str\",\n        \"calendar_days\": \"Tuesday\",\n        \"description\": \"This is a beatuiful product buy it\",\n        \"price\": 240.3,\n        \"created_at\": \"2021-11-29T12:18:10.369+00:00\",\n        \"updated_at\": \"2021-11-29T12:18:10.369+00:00\",\n        \"user\": {\n            \"id\": 2,\n            \"username\": \"johndoe\",\n            \"first_name\": \"John\",\n            \"last_name\": \"Doe\",\n            \"email\": \"email@email.com\",\n            \"address\": \"No, 15 john str\",\n            \"contact_number\": \"040349304\",\n            \"status\": \"ACTIVE\",\n            \"type\": \"Admin\",\n            \"remember_me_token\": null,\n            \"created_at\": \"2021-11-28T20:37:30.438+00:00\",\n            \"updated_at\": \"2021-11-28T20:37:30.438+00:00\"\n        },\n        \"category\": {\n            \"id\": 3,\n            \"name\": \"category 3\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:03:11.180+00:00\",\n            \"updated_at\": \"2021-11-28T20:03:11.180+00:00\"\n        },\n        \"subCategory\": {\n            \"id\": 5,\n            \"category_id\": 3,\n            \"name\": \"sub-category 5\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:04:52.228+00:00\",\n            \"updated_at\": \"2021-11-28T20:04:52.228+00:00\"\n        }\n    }\n]"}],"_postman_id":"70ad343c-afff-4abd-b5c9-b52f6ba6e446"},{"name":"find a product","id":"c4cada03-cd47-40e9-9f3c-87bf610400c9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/product/5","description":"<h3 id=\"this-get-request-finds-a-product-by-id-you-will-provide-the-id-on-the-url\">This GET request finds a <strong>product</strong> <em><strong>by id</strong></em> you will provide the id on the URL.</h3>\n<h3 id=\"for-example\">for example</h3>\n<h2 id=\"httpsmyecommerce-apiherokuappcomapiproductid\"><code>https://myecommerce-api.herokuapp.com/api/product/:id</code></h2>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","name":"Product APIs","type":"folder"}},"urlObject":{"protocol":"https","path":["api","product","5"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"1ecf1a92-7383-4e5b-b782-95d2727e81a5","name":"find a product","originalRequest":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/product/1"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"id\": 5,\n    \"user_id\": 2,\n    \"category_id\": 3,\n    \"day_type\": \"type 1\",\n    \"sub_category_id\": 5,\n    \"title\": \"new product\",\n    \"address\": \"No, 15 john str\",\n    \"calendar_days\": \"Tuesday\",\n    \"description\": \"This is a beatuiful product buy it\",\n    \"price\": 240.3,\n    \"created_at\": \"2021-11-29T12:18:10.369+00:00\",\n    \"updated_at\": \"2021-11-29T12:18:10.369+00:00\",\n    \"category\": {\n        \"id\": 3,\n        \"name\": \"category 3\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T20:03:11.180+00:00\",\n        \"updated_at\": \"2021-11-28T20:03:11.180+00:00\"\n    },\n    \"subCategory\": {\n        \"id\": 5,\n        \"category_id\": 3,\n        \"name\": \"sub-category 5\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T20:04:52.228+00:00\",\n        \"updated_at\": \"2021-11-28T20:04:52.228+00:00\"\n    }\n}"}],"_postman_id":"c4cada03-cd47-40e9-9f3c-87bf610400c9"},{"name":"Update a product","id":"ad1cdbb4-9e95-4690-9807-20da0bc437f6","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"title","value":"string","type":"text"},{"key":"subcategory","value":"string","type":"text"},{"key":"category","value":"string","type":"text"},{"key":"description","value":"text","type":"text"},{"key":"calendar_days","value":"string","type":"text"},{"key":"address","value":"text","type":"text"},{"key":"price","value":"float","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/product/3","description":"<p>This <strong>PUT request</strong> updates a <strong>product by id</strong>, you will provide the id on the URL.</p>\n<p>for example</p>\n<h2 id=\"httpsmyecommerce-apiherokuappcomapiproductid\"><code>https://myecommerce-api.herokuapp.com/api/product/:id</code></h2>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","name":"Product APIs","type":"folder"}},"urlObject":{"protocol":"https","path":["api","product","3"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"64ae912d-deba-4777-bbba-ba51ab5e6a3a","name":"Update a product","originalRequest":{"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"title","value":"product 1 ","type":"text"},{"key":"subcategory","value":"sub-category 2","type":"text"},{"key":"category","value":"category 1","type":"text"},{"key":"description","value":"This is a beatuiful product but it","type":"text"},{"key":"calendar_days","value":"Tuesday","type":"text"},{"key":"address","value":"No, 15 john str","type":"text"},{"key":"price","value":"670.30","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/product/1"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product Updated succussfully\",\n    \"productUpdated\": {\n        \"id\": 3,\n        \"user_id\": 2,\n        \"category_id\": 2,\n        \"day_type\": \"type 1\",\n        \"sub_category_id\": 5,\n        \"title\": \"product 3 updated\",\n        \"address\": \"No, 15 john str\",\n        \"calendar_days\": \"Monday\",\n        \"description\": \"This is a beatuiful product but it\",\n        \"price\": 670.3,\n        \"created_at\": \"2021-11-28T20:07:05.200+00:00\",\n        \"updated_at\": \"2021-11-29T12:34:36.552+00:00\"\n    }\n}"}],"_postman_id":"ad1cdbb4-9e95-4690-9807-20da0bc437f6"},{"name":"Delete a product","id":"d9a7e63c-4713-4852-9a26-fb2ffd35e46c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"https://myecommerce-api.herokuapp.com/api/product/1","description":"<p>This <strong>DELETE request</strong> Delete a <strong>product by id</strong>, you will provide the id on the URL.</p>\n<p>for example</p>\n<h4 id=\"httpsmyecommerce-apiherokuappcomapiproductid\"><code>https://myecommerce-api.herokuapp.com/api/product/:id</code></h4>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","name":"Product APIs","type":"folder"}},"urlObject":{"protocol":"https","path":["api","product","1"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"4e24450c-e39c-457d-9ca8-a617a36676fc","name":"Delete a product","originalRequest":{"method":"DELETE","header":[],"url":"https://myecommerce-api.herokuapp.com/api/product/1"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"d9a7e63c-4713-4852-9a26-fb2ffd35e46c"}],"id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"event":[{"listen":"prerequest","script":{"id":"52e35d00-f134-48f6-b93c-f8a7aba72b2d","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"c4dacaad-2e9b-43a7-8b15-6aa48d85deef","type":"text/javascript","exec":[""]}}],"_postman_id":"e35304f2-a7a9-413f-aa2d-dd02e2df9e6a","description":""},{"name":"Category APIs","item":[{"name":"get all category","id":"f8d1360c-aa98-46c7-89d7-12634e3bcf96","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/category","description":"<h2 id=\"this-get-request-will-return-all-the-categories-in-the-database\">This <em><strong>GET request</strong></em>, will return all the categories in the database</h2>\n","urlObject":{"protocol":"https","path":["api","category"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"8ad5a08a-9201-4bce-a2bb-f0890b8a80ff","name":"get all category","originalRequest":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/category"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 2,\n        \"name\": \"category 2\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T20:03:06.738+00:00\",\n        \"updated_at\": \"2021-11-28T20:03:06.738+00:00\",\n        \"subCategories\": [\n            {\n                \"id\": 9,\n                \"category_id\": 2,\n                \"name\": \"sub-catgeory 1\",\n                \"status\": true,\n                \"created_at\": \"2021-11-28T21:17:16.540+00:00\",\n                \"updated_at\": \"2021-11-28T21:17:16.540+00:00\"\n            },\n            {\n                \"id\": 10,\n                \"category_id\": 2,\n                \"name\": \"sub-catgeory 1\",\n                \"status\": true,\n                \"created_at\": \"2021-11-29T11:18:03.540+00:00\",\n                \"updated_at\": \"2021-11-29T11:18:03.540+00:00\"\n            },\n            {\n                \"id\": 4,\n                \"category_id\": 2,\n                \"name\": \"sub category 2 updated\",\n                \"status\": true,\n                \"created_at\": \"2021-11-28T20:04:41.731+00:00\",\n                \"updated_at\": \"2021-11-29T12:08:47.256+00:00\"\n            },\n            {\n                \"id\": 11,\n                \"category_id\": 2,\n                \"name\": \"sub-catgeory created\",\n                \"status\": true,\n                \"created_at\": \"2021-11-29T12:09:58.142+00:00\",\n                \"updated_at\": \"2021-11-29T12:09:58.142+00:00\"\n            }\n        ]\n    },\n    {\n        \"id\": 3,\n        \"name\": \"category 3\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T20:03:11.180+00:00\",\n        \"updated_at\": \"2021-11-28T20:03:11.180+00:00\",\n        \"subCategories\": [\n            {\n                \"id\": 5,\n                \"category_id\": 3,\n                \"name\": \"sub-category 5\",\n                \"status\": true,\n                \"created_at\": \"2021-11-28T20:04:52.228+00:00\",\n                \"updated_at\": \"2021-11-28T20:04:52.228+00:00\"\n            },\n            {\n                \"id\": 6,\n                \"category_id\": 3,\n                \"name\": \"sub-category 6\",\n                \"status\": true,\n                \"created_at\": \"2021-11-28T20:04:59.300+00:00\",\n                \"updated_at\": \"2021-11-28T20:04:59.300+00:00\"\n            }\n        ]\n    },\n    {\n        \"id\": 5,\n        \"name\": \"category 1\",\n        \"status\": true,\n        \"created_at\": \"2021-11-29T11:18:01.530+00:00\",\n        \"updated_at\": \"2021-11-29T11:18:01.531+00:00\",\n        \"subCategories\": []\n    }\n]"}],"_postman_id":"f8d1360c-aa98-46c7-89d7-12634e3bcf96"},{"name":"show a category","id":"a462c268-1a50-498d-9fc1-c7a26a1b443e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/category/2","description":"<h2 id=\"this-get-request-finds-a-category-by-its-unique-id\">This GET Request finds a category by its unique ID</h2>\n<h3 id=\"for-example\">for example</h3>\n<h4 id=\"httpsmyecommerce-apiherokuappcomapicategoryid\"><strong><code>https://myecommerce-api.herokuapp.com/api/category/:id</code></strong></h4>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","name":"Category APIs","type":"folder"}},"urlObject":{"protocol":"https","path":["api","category","2"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"a3d235b9-c4ea-413b-b377-4252ac69cc92","name":"show a category","originalRequest":{"method":"GET","header":[{"key":"name","value":"category 2"}],"url":"https://myecommerce-api.herokuapp.com/api/category/"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"id\": 2,\n    \"name\": \"category 2\",\n    \"status\": true,\n    \"created_at\": \"2021-11-28T20:03:06.738+00:00\",\n    \"updated_at\": \"2021-11-28T20:03:06.738+00:00\"\n}"}],"_postman_id":"a462c268-1a50-498d-9fc1-c7a26a1b443e"},{"name":"Create a new category","id":"dc67bfec-c712-42ce-b240-de165e89c25e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"string","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/category/","description":"<h2 id=\"this-post-request-creates-a-new-category-for-a-product\">This POST Request Creates a new Category for a <em><strong>product</strong></em>.</h2>\n<p>it takes category name as a body params</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n\"name\":\"category name\"\n}\n\n</code></pre>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","name":"Category APIs","type":"folder"}},"urlObject":{"protocol":"https","path":["api","category",""],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"2e63da5f-d82d-4f1f-9d89-20cc15c9fcc9","name":"Create a new category","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"category one","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/category/"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"dc67bfec-c712-42ce-b240-de165e89c25e"},{"name":"Update a category","id":"2fbdadfd-3c2f-4543-85df-0b6034358fe1","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"name","value":"category 1 updated"}],"body":{"mode":"formdata","formdata":[{"key":"name","value":"string","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/category/1","description":"<h2 id=\"this-put-request-updates-an-existing-category\">This PUT Request Updates an existing Category,</h2>\n<h4 id=\"you-need-to-pass-the-category-id-on-the-url\"><em>You need to pass the category :id on the URL</em></h4>\n<h4 id=\"httpsmyecommerce-apiherokuappcomapicategoryid\"><code>https://myecommerce-api.herokuapp.com/api/category/:id</code></h4>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","name":"Category APIs","type":"folder"}},"urlObject":{"protocol":"https","path":["api","category","1"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"872472ef-7d84-4f8b-b2ef-9b2afb693ff8","name":"Update a category","originalRequest":{"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"category name update","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/category/1"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"2fbdadfd-3c2f-4543-85df-0b6034358fe1"},{"name":"delete a category","id":"917e7ad0-acbb-4b05-b618-8109b2d84316","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"https://myecommerce-api.herokuapp.com/api/category/1","description":"<p>This DELETE request deletes Category a <strong>by id</strong>, you will provide the id on the URL.</p>\n<p>for example</p>\n<h4 id=\"httpsmyecommerce-apiherokuappcomapicategoryid\"><em><strong><code>https://myecommerce-api.herokuapp.com/api/category/:id</code></strong></em></h4>\n","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":true,"source":{"_postman_id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","name":"Category APIs","type":"folder"}},"urlObject":{"protocol":"https","path":["api","category","1"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"30d96397-25fd-4660-8270-75d8e62cccfb","name":"delete a category","originalRequest":{"method":"DELETE","header":[],"url":"https://myecommerce-api.herokuapp.com/api/category/1"},"_postman_previewlanguage":null,"header":[],"cookie":[],"responseTime":null,"body":null}],"_postman_id":"917e7ad0-acbb-4b05-b618-8109b2d84316"}],"id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"event":[{"listen":"prerequest","script":{"id":"499e9347-f62f-4b86-9732-e344223b0e1c","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"c32711c3-85e8-4c31-bafa-5806b9915f84","type":"text/javascript","exec":[""]}}],"_postman_id":"b1fb9163-a12e-4b89-b31f-94ac5c4c9177","description":""},{"name":"Sub Category APIs","item":[{"name":"show all sub category","id":"1674b941-95f0-47ec-bc44-e3260c2873ea","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/sub-category","description":"<h2 id=\"this-get-request-returns-all-the-sub-categories-with-the-parent-category\">This GET Request returns all the sub categories with the parent category</h2>\n","urlObject":{"protocol":"https","path":["api","sub-category"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"9985c5f5-3434-4f4b-b68d-7754073a7669","name":"show all sub category","originalRequest":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/sub-category"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": 4,\n        \"category_id\": 2,\n        \"name\": \"sub-category 4\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T20:04:41.731+00:00\",\n        \"updated_at\": \"2021-11-28T20:04:41.731+00:00\",\n        \"category\": {\n            \"id\": 2,\n            \"name\": \"category 2\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:03:06.738+00:00\",\n            \"updated_at\": \"2021-11-28T20:03:06.738+00:00\"\n        }\n    },\n    {\n        \"id\": 5,\n        \"category_id\": 3,\n        \"name\": \"sub-category 5\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T20:04:52.228+00:00\",\n        \"updated_at\": \"2021-11-28T20:04:52.228+00:00\",\n        \"category\": {\n            \"id\": 3,\n            \"name\": \"category 3\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:03:11.180+00:00\",\n            \"updated_at\": \"2021-11-28T20:03:11.180+00:00\"\n        }\n    },\n    {\n        \"id\": 6,\n        \"category_id\": 3,\n        \"name\": \"sub-category 6\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T20:04:59.300+00:00\",\n        \"updated_at\": \"2021-11-28T20:04:59.300+00:00\",\n        \"category\": {\n            \"id\": 3,\n            \"name\": \"category 3\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:03:11.180+00:00\",\n            \"updated_at\": \"2021-11-28T20:03:11.180+00:00\"\n        }\n    },\n    {\n        \"id\": 9,\n        \"category_id\": 2,\n        \"name\": \"sub-catgeory 1\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T21:17:16.540+00:00\",\n        \"updated_at\": \"2021-11-28T21:17:16.540+00:00\",\n        \"category\": {\n            \"id\": 2,\n            \"name\": \"category 2\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:03:06.738+00:00\",\n            \"updated_at\": \"2021-11-28T20:03:06.738+00:00\"\n        }\n    },\n    {\n        \"id\": 10,\n        \"category_id\": 2,\n        \"name\": \"sub-catgeory 1\",\n        \"status\": true,\n        \"created_at\": \"2021-11-29T11:18:03.540+00:00\",\n        \"updated_at\": \"2021-11-29T11:18:03.540+00:00\",\n        \"category\": {\n            \"id\": 2,\n            \"name\": \"category 2\",\n            \"status\": true,\n            \"created_at\": \"2021-11-28T20:03:06.738+00:00\",\n            \"updated_at\": \"2021-11-28T20:03:06.738+00:00\"\n        }\n    }\n]"}],"_postman_id":"1674b941-95f0-47ec-bc44-e3260c2873ea"},{"name":"show a sub category","id":"de1b7410-467b-4542-af0f-a79945e097af","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/sub-category/4","description":"<h2 id=\"this-get-request-finds-a-sub-category-by-its-unique-id\">This GET Request finds a sub category by its unique ID</h2>\n","urlObject":{"protocol":"https","path":["api","sub-category","4"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"549aa244-6e5d-41c9-bb92-2f9e7d752a53","name":"show a sub category","originalRequest":{"method":"GET","header":[],"url":"https://myecommerce-api.herokuapp.com/api/sub-category/3"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"id\": 4,\n    \"category_id\": 2,\n    \"name\": \"sub-category 4\",\n    \"status\": true,\n    \"created_at\": \"2021-11-28T20:04:41.731+00:00\",\n    \"updated_at\": \"2021-11-28T20:04:41.731+00:00\",\n    \"category\": {\n        \"id\": 2,\n        \"name\": \"category 2\",\n        \"status\": true,\n        \"created_at\": \"2021-11-28T20:03:06.738+00:00\",\n        \"updated_at\": \"2021-11-28T20:03:06.738+00:00\"\n    }\n}"}],"_postman_id":"de1b7410-467b-4542-af0f-a79945e097af"},{"name":"Update a sub category","id":"a81de929-c3e5-4f61-9856-a009690c87ae","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"category","value":"string","type":"text"},{"key":"name","value":"string","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/sub-category/4","description":"<h2 id=\"this-put-request-updates-an-existing-sub-category\">This PUT Request Updates an existing Sub Category,</h2>\n<h4 id=\"you-need-to-pass-the-sub-category-id-on-the-url\"><em>You need to pass the sub category :id on the URL</em></h4>\n<h4 id=\"httpsmyecommerce-apiherokuappcomapisub-categoryid\"><code>https://myecommerce-api.herokuapp.com/api/sub-category/:id</code></h4>\n","urlObject":{"protocol":"https","path":["api","sub-category","4"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"8db4c152-a2dc-4d2c-a272-db2ad4bd18f4","name":"Update a sub category","originalRequest":{"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"category","value":"category 2","type":"text"},{"key":"name","value":"sub category Updated","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/sub-category/3"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"id\": 4,\n    \"category_id\": 2,\n    \"name\": \"sub category 2 updated\",\n    \"status\": true,\n    \"created_at\": \"2021-11-28T20:04:41.731+00:00\",\n    \"updated_at\": \"2021-11-29T12:08:47.256+00:00\"\n}"}],"_postman_id":"a81de929-c3e5-4f61-9856-a009690c87ae"},{"name":"Create a sub category","id":"57c53639-c9fc-4bc7-a841-df84dbc58f6a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"string","type":"text"},{"key":"category","value":"string","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/sub-category","description":"<h2 id=\"this-post-creates-a-new-sub-category-for-a-product\">This POST Creates a new Sub Category for a <em><strong>product</strong></em>.</h2>\n<p>it takes sub category name, and the parent category name as a body params</p>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code class=\"language-json\">{\n\"name\":\"sub category name\",\n\"category\":\"name of the parent category\"\n}\n\n</code></pre>\n","urlObject":{"protocol":"https","path":["api","sub-category"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"88e480b8-769a-4662-89a8-2f65a75025b3","name":"Create a sub category","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"name","value":"sub-catgeory created","type":"text"},{"key":"category","value":"category 2","type":"text"}]},"url":"https://myecommerce-api.herokuapp.com/api/sub-category"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Sub Category created succussfully\",\n    \"subCategoryCreated\": {\n        \"category_id\": 2,\n        \"name\": \"sub-catgeory created\",\n        \"created_at\": \"2021-11-29T12:09:58.142+00:00\",\n        \"updated_at\": \"2021-11-29T12:09:58.142+00:00\"\n    }\n}"}],"_postman_id":"57c53639-c9fc-4bc7-a841-df84dbc58f6a"},{"name":"Delete a sub create","id":"28274618-6098-4caa-a268-681859acdc98","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"https://myecommerce-api.herokuapp.com/api/sub-category/3","description":"<p>This DELETE request. deletes a Sub Category <strong>by id</strong>, you will provide the id on the URL</p>\n<p>for example</p>\n<h4 id=\"httpsmyecommerce-apiherokuappcomapisub-categoryid\"><em><strong><code>https://myecommerce-api.herokuapp.com/api/sub-category/:id</code></strong></em></h4>\n","urlObject":{"protocol":"https","path":["api","sub-category","3"],"host":["myecommerce-api","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"43a6353f-33b3-494e-b390-71e0fd07a2e2","name":"Delete a sub create","originalRequest":{"method":"DELETE","header":[],"url":"https://myecommerce-api.herokuapp.com/api/sub-category/1"},"_postman_previewlanguage":null,"header":null,"cookie":[],"responseTime":null,"body":null}],"_postman_id":"28274618-6098-4caa-a268-681859acdc98"}],"id":"0998556b-a436-4e2e-af05-71e6cf72833f","_postman_id":"0998556b-a436-4e2e-af05-71e6cf72833f","description":""}],"event":[{"listen":"prerequest","script":{"id":"b8f2e749-2e90-46cb-b1dd-3a6328fd8a5f","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"2cc13690-a590-427b-bdc6-94d337a1b14f","type":"text/javascript","exec":[""]}}],"variable":[{"key":"baseUrl","value":"https://myecommerce-api.herokuapp.com/"}]}