{"info":{"_postman_id":"2bff027a-7a12-6a0e-f932-e587bee073d4","name":"E-Commerce Store API","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"17449511","collectionId":"2bff027a-7a12-6a0e-f932-e587bee073d4","publishedId":"UUy1g89D","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2021-09-30T14:07:08.000Z"},"item":[{"name":"Advance Ecommerce Store REST-API","item":[{"name":"/items","event":[{"listen":"test","script":{"id":"da1039c4-d590-49a9-aef6-7b9bd303e028","exec":["tests[\"Response time is less than 200ms\"] = responseTime < 200;\r","tests[\"Status code is 200\"] = responseCode.code === 200;"],"type":"text/javascript"}}],"id":"7798a91e-8613-4bb0-9ba5-4efac26669d8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}","type":"text"}],"url":"{{url}}/items","description":"<p>Clients can use this to retrieve data about all items in our collection</p>\n","urlObject":{"path":["items"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7798a91e-8613-4bb0-9ba5-4efac26669d8"},{"name":"/item/<name>","id":"265cf5fd-2b60-4777-af0c-14704d7602b7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}"}],"url":"{{url}}/item/Naked Statistics: Stripping the Dread from the Data","description":"<p>Clients can use this to retrieve information about one item. No 2 items may have the same name.</p>\n","urlObject":{"path":["item","Naked Statistics: Stripping the Dread from the Data"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"265cf5fd-2b60-4777-af0c-14704d7602b7"},{"name":"/stores","event":[{"listen":"test","script":{"id":"b1815241-0c70-4038-8ad0-f3e003f058de","exec":["tests[\"Response time is less than 200ms\"] = responseTime < 200;\r","tests[\"Status code is 200\"] = responseCode.code === 200;"],"type":"text/javascript"}}],"id":"fa954028-75a4-4f69-94f7-b1a90c1061d2","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/stores","description":"<p>Clients can use this to retrieve data about all stores in our collection and their items.</p>\n","urlObject":{"path":["stores"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"fa954028-75a4-4f69-94f7-b1a90c1061d2"},{"name":"/store/<name>","id":"2fc66c57-46b7-4fe4-a070-cf84b2604d4b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"JWT {{jwt_token}}"}],"url":"{{url}}/store/books","description":"<p>Clients can use this to retrieve information about one store. No 2 stores may have the same name.</p>\n","urlObject":{"path":["store","books"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"2fc66c57-46b7-4fe4-a070-cf84b2604d4b"},{"name":"/image/<filename>","id":"7cd2a0f3-b238-4666-9606-eb3b0943c9f8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer {{access_token}}"}],"url":"{{url}}/image/Screenshot_1.png","description":"<p>Clients can use this to retrieve information about one store. No 2 stores may have the same name.</p>\n","urlObject":{"path":["image","Screenshot_1.png"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7cd2a0f3-b238-4666-9606-eb3b0943c9f8"},{"name":"/user/<user_id>","event":[{"listen":"test","script":{"id":"5deeaad7-5fea-46ed-875b-61e0b0e57c0a","exec":["var jsonData = pm.response.json();\r","pm.test(\"user confirmation found\", function () {\r","    pm.expect(jsonData.confirmation).not.eql(undefined);\r","});\r","\r","if (jsonData.confirmation !== undefined) {\r","    pm.environment.set(\"confirmation_id\", jsonData.confirmation.id);\r","}"],"type":"text/javascript"}}],"id":"e571d15d-ad9f-4c6a-a7f9-d047ca3e5738","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/user/1","description":"<p>This request is used to fetch a user by their user id, which is always unique.</p>\n","urlObject":{"path":["user","1"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e571d15d-ad9f-4c6a-a7f9-d047ca3e5738"},{"name":"/confirmation/user/<user_id>","id":"97f76097-2a96-408c-985b-bbf16863b314","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/confirmation/user/1","description":"<p>This is used for retrieving a finished user confirmation by the user id.</p>\n","urlObject":{"path":["confirmation","user","1"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"97f76097-2a96-408c-985b-bbf16863b314"},{"name":"/user_confirmation/<confirmation_id>","id":"7ca0a5ac-02c1-42a6-a5de-1a79f3f4dfaa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"{{url}}/user_confirmation/dc3164a1e96c42b3a66b44a2968fbe55","description":"<p>This is used for sending the user an html page stating that their email has successfully been confirmed and they are registered to the service.</p>\n","urlObject":{"path":["user_confirmation","dc3164a1e96c42b3a66b44a2968fbe55"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"7ca0a5ac-02c1-42a6-a5de-1a79f3f4dfaa"},{"name":"/store/<name>","id":"13ba9349-ce26-4423-bf67-01248c5f2066","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"JWT {{jwt_token}}"}],"url":"{{url}}/store/books","description":"<p>Clients can use this to create a new store. If already that store exists, this will throw 400 bad request error.</p>\n","urlObject":{"path":["store","books"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"13ba9349-ce26-4423-bf67-01248c5f2066"},{"name":"/upload/image","id":"dd142d36-ffa3-4658-953d-47306f06f78b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{access_token}}"},{"key":"Content-Type","value":"multipart/form-data","type":"text"}],"body":{"mode":"formdata","formdata":[{"key":"image","type":"file","src":"/C:/Users/sukanya/Downloads/Screenshot (1).png"}]},"url":"{{url}}/upload/image","description":"<p>Clients can use this to upload a new image.</p>\n","urlObject":{"path":["upload","image"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"dd142d36-ffa3-4658-953d-47306f06f78b"},{"name":"/item/<name>","event":[{"listen":"test","script":{"id":"d43a5ce5-2210-4b2d-bf04-12bbaaf4c7a8","exec":["tests[\"Response time is less than 200ms\"] = responseTime < 200;\r","tests[\"Status code is 201\"] = responseCode.code === 201;"],"type":"text/javascript"}}],"id":"c1e34ff7-88a1-4cc6-84a9-2514e6acdb17","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer {{jwt_token}}","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"price\": 3000.00,\n    \"store_id\": 2\n}"},"url":"{{url}}/item/Naked Statistics: Stripping the Dread from the Data","description":"<p>Clients can use this to create an item. If the item already exists, it will fail.</p>\n","urlObject":{"path":["item","Naked Statistics: Stripping the Dread from the Data"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"c1e34ff7-88a1-4cc6-84a9-2514e6acdb17"},{"name":"/login","event":[{"listen":"test","script":{"id":"e8cb0b2c-b291-40c8-beec-b9a43ed33ff0","exec":["var jsonData = JSON.parse(responseBody);\r","\r","tests[\"Access token was not empty\"] = jsonData.access_token !== undefined;\r","\r","postman.setEnvironmentVariable(\"jwt_token\", jsonData.access_token);\r","postman.setEnvironmentVariable(\"refresh_token\", jsonData.refresh_token);\r","postman.setEnvironmentVariable(\"access_token\", jsonData.access_token);\r",""],"type":"text/javascript"}}],"id":"f2d09f4f-c358-4cdf-8666-e26a407769fc","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\" : \"Sukanya\",\n\t\"password\" : \"iuseGANforpainting\"\n}"},"url":"{{url}}/login","description":"<p>This request is used for logging in a new user after they are successfully registered.</p>\n","urlObject":{"path":["login"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"f2d09f4f-c358-4cdf-8666-e26a407769fc"},{"name":"/logout","id":"6b200e9c-62fd-492c-9c83-d6cf620a6fda","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{jwt_token}}"}],"body":{"mode":"raw","raw":""},"url":"{{url}}/logout","description":"<p>This request is intended to logout a user who created their account and are currently logged in.</p>\n","urlObject":{"path":["logout"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"6b200e9c-62fd-492c-9c83-d6cf620a6fda"},{"name":"/register","event":[{"listen":"test","script":{"id":"d81deeb6-a70c-4cb8-81ee-75dde09db970","exec":[""],"type":"text/javascript"}}],"id":"dd6b304f-7c01-4a4b-ac3c-5725016d5d32","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\" : \"Sukanya\",\n    \"email\": \"sukannya472@gmail.com\",\n\t\"password\" : \"iuseGANforpainting\"\n}"},"url":"{{url}}/register","description":"<p>This request is used for registering a new user successfully by sending them an activation email after they register.</p>\n","urlObject":{"path":["register"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"dd6b304f-7c01-4a4b-ac3c-5725016d5d32"},{"name":"/confirmation/user/<user_id>","id":"9a5dfe19-6b8a-499b-ae7a-a6bdff2e5c89","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"url":"{{url}}/confirmation/user/1","description":"<p>This request is used for resending confirmations to a user if the previous one failed.</p>\n","urlObject":{"path":["confirmation","user","1"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"9a5dfe19-6b8a-499b-ae7a-a6bdff2e5c89"},{"name":"/refresh","id":"b17e515e-2a35-43b9-b74d-17e524e21886","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Authorization","value":"Bearer {{refresh_token}}"}],"body":{"mode":"raw","raw":""},"url":"{{url}}/refresh","description":"<p>This request refreshes the expired access token and sends a new refresh token to the client for logging in.</p>\n","urlObject":{"path":["refresh"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"b17e515e-2a35-43b9-b74d-17e524e21886"},{"name":"/store/<name>","id":"85c8e10e-0d5e-4e5d-bf4d-c8072673e73a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Authorization","value":"JWT {{jwt_token}}"}],"url":"{{url}}/store/cameras","description":"<p>Clients can use this to delete a store.</p>\n","urlObject":{"path":["store","cameras"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"85c8e10e-0d5e-4e5d-bf4d-c8072673e73a"},{"name":"/item/<name>","id":"85090e14-a5ed-4d08-ace5-c1c608b3fdf0","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[{"key":"Content-Type","value":"application/json"},{"key":"Authorization","value":"Bearer {{jwt_token}}","type":"text"}],"body":{"mode":"raw","raw":""},"url":"{{url}}/item/book","description":"<p>Clients can use this to delete an item.</p>\n","urlObject":{"path":["item","book"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"85090e14-a5ed-4d08-ace5-c1c608b3fdf0"},{"name":"/user/<user_id>","id":"0679ab21-7215-41ea-bfe3-de58006f6c6d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"{{url}}/user/1","description":"<p>This request deletes an user if confirmations are unsuccessful/error occurs saving the users to the database.</p>\n","urlObject":{"path":["user","1"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"0679ab21-7215-41ea-bfe3-de58006f6c6d"},{"name":"/item/<name>","id":"e836d6cb-6aff-4b84-bd4d-41bfaef3c3ec","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PUT","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"price\" : 1777.89,\n    \"store_id\": 2\n}"},"url":"{{url}}/item/Data Science for Business: What You Need to Know","description":"<p>Clients can use this to update an item, or create it if it doesn't exist.</p>\n","urlObject":{"path":["item","Data Science for Business: What You Need to Know"],"host":["{{url}}"],"query":[],"variable":[]}},"response":[],"_postman_id":"e836d6cb-6aff-4b84-bd4d-41bfaef3c3ec"}],"id":"2054d6b2-9e83-4dbc-ab3e-3f4fee1e768e","description":"<p>This is an E-Commerce Store REST (Representational State Transfer) API ( Application Programming Interface), build and exposed with a Flask App. The Flask App focuses on creating online stores, with items and users can register themselves, confirm their account and order items from stores as per their need.</p>\n<h1 id=\"overview\">Overview</h1>\n<p>This documentation is generated by Postman. The various endpoints and their descriptions are listed below for developers who want to try out this API and tweak in their ideas.</p>\n<h1 id=\"features\">Features</h1>\n<p>This E-Commerce Store API leverages the following features to make it a complete product-</p>\n<ol>\n<li>JWT Authentication - The API uses JSON Web Token (access and refresh tokens) for User authentication.</li>\n<li>SQLAlchemy - The API leverages SQLAlchemy as a ORM tool for storing informations and resources to our database .</li>\n<li>Marshmallow - The API uses Marshmallow for Serializing and Deserializing purposes i.e for loading and dumping resources to/from our API.</li>\n<li>Mailgun - This API uses Mailgun API for activating users with an activation link send to their email, before using the API.</li>\n<li>Stripe - This API uses Stripe for adding fully secure payment options and payment gateway for users if they order an item from a store.</li>\n</ol>\n<h1 id=\"configuration\">Configuration</h1>\n<p>This E-Commerce Store API requires several predefined environment variables , which are listed below. You will need to add them to your environment in Postman before API testing.</p>\n<ol>\n<li><code>url</code> : The root <code>url</code> for our Flask App is <code>127.0.0.1:5000</code>.</li>\n<li><code>access_token</code>: JWT used for user login. It will be set automatically by some of the request test scripts.</li>\n<li><code>refresh_token</code>: Used for refreshing JWT. It will be set automatically by some of the request test scripts.</li>\n<li><code>confirmation_id</code>: Hex-code which is the latest confirmation id with which the user activated their account. It will be automatically set by some of the request test scripts.</li>\n<li><code>test_email</code>: An email address used to test and registers users to the app via confirming their emails. It must be reachable by Mailgun services.</li>\n</ol>\n<h1 id=\"error-codes\">Error Codes</h1>\n<ul>\n<li>400 - When there is a bad request</li>\n<li>500 - Internal Server error</li>\n<li>401 - Authentication Error</li>\n<li>404 - Requested data not found</li>\n</ul>\n","_postman_id":"2054d6b2-9e83-4dbc-ab3e-3f4fee1e768e"}]}