{"info":{"_postman_id":"c362a388-3feb-4024-af40-d5ed986b7d8b","name":"Store-manager Heroku","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"4977996","collectionId":"c362a388-3feb-4024-af40-d5ed986b7d8b","publishedId":"RzZ4pgzB","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2018-11-02T05:14:40.000Z"},"item":[{"name":"User authentication","item":[{"name":"Admin Login","id":"8c48ca4b-c915-4de4-94a2-9c1aa44ce4cc","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"email_address\": \"calvin@gmail.com\", \"password\": \"Pete\"}"},"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/auth/login","description":"<p>This authenticates the administrator and returns a jwt token for the admin to use in the add product, get product, get all products, register staff attendant and get all sale records endpoints.</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","auth","login"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"8c48ca4b-c915-4de4-94a2-9c1aa44ce4cc"},{"name":"Staff attendant login","id":"3439d6bf-bbd0-4ca8-8da7-469e2e5b7ba1","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"email_address\": \"hope@gmail.com\", \"password\": \"h23\"}"},"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/auth/login","description":"<p>This authenticates a normal user(staff attendant) and returns a jwt token for the user to use in get product, get all products, create a sale record and get a single sale record endpoints.</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","auth","login"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"3439d6bf-bbd0-4ca8-8da7-469e2e5b7ba1"}],"id":"80e24538-6ce3-4962-90c4-b61a0338e71f","_postman_id":"80e24538-6ce3-4962-90c4-b61a0338e71f","description":""},{"name":"Product","item":[{"name":"Add product","id":"61035ede-bbd2-409a-9e00-b6285f7ded51","request":{"method":"POST","header":[{"key":"x-access-token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbF9hZGRyZXNzIjoiam9iQGdtYWlsLmNvbSIsImV4cCI6MTU0MDExMzU5N30.u_v3jDQFySR3A2k1UJP7pR5Vzqj7E8DW7VC-45YJ2zY","disabled":false},{"key":"Content-Type","value":"application/json","disabled":false}],"body":{"mode":"raw","raw":"{\"product_name\": \"Splash\", \"quantity\": 12, \"details\": \"500ml Mango\", \"price\": 6500}"},"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/products","description":"<p>This adds a product to a particular category of products. Its only accessible to the admin</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","products"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"61035ede-bbd2-409a-9e00-b6285f7ded51"},{"name":"Get all products","id":"c02ac499-f6f7-40fc-8b7b-4cde456326a9","request":{"method":"GET","header":[{"key":"x-access-token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbF9hZGRyZXNzIjoiaG9wZUBnbWFpbC5jb20iLCJleHAiOjE1NDAxMTM2Mjl9.P4FlsR4BZsRXD1mU_IBpeNnyB8CY0W91lykVTi3qV_4","disabled":false}],"body":{"mode":"formdata","formdata":[]},"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/products","description":"<p>This fetches all products in the inventory</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","products"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"c02ac499-f6f7-40fc-8b7b-4cde456326a9"},{"name":"Get single product","id":"f9a9d793-c71e-412d-b1c4-d1c14481c6e5","request":{"method":"GET","header":[{"key":"x-access-token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbF9hZGRyZXNzIjoiaG9wZUBnbWFpbC5jb20iLCJleHAiOjE1NDAxMTM2Mjl9.P4FlsR4BZsRXD1mU_IBpeNnyB8CY0W91lykVTi3qV_4"}],"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/products/1","description":"<p>This fetches a paticular product from the inventory using the product_id then returns a dictionary of the product's details</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","products","1"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"f9a9d793-c71e-412d-b1c4-d1c14481c6e5"},{"name":"Delete Product","id":"1744763c-06fd-4694-a73d-04da8bbe87e4","request":{"method":"DELETE","header":[{"key":"x-access-token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbF9hZGRyZXNzIjoiYWRtaW5AZ21haWwuY29tIiwiZXhwIjoxNTQwOTk0NjU0fQ.NfRHTvcf5AfKV5P8R1t7CXmuEJaX7xjiqjjh_mO_Cx8","type":"text"}],"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/products/1","description":"<p>This removes a product from the inventory</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","products","1"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"1744763c-06fd-4694-a73d-04da8bbe87e4"},{"name":"Edit a Product","id":"4ac0b589-ff00-46ab-9eff-b8c0e26fbcd2","request":{"method":"PUT","header":[{"key":"x-access-token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbF9hZGRyZXNzIjoiYWRtaW5AZ21haWwuY29tIiwiZXhwIjoxNTQwOTk0OTcyfQ.aOuGfdKpuxJGHUelqFLl0l-h3Icgejh1LilkVfceLns","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\"product_name\": \"Splash\", \"quantity\": 12, \"details\": \"500ml Mango\", \"price\": 6500}"},"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/products/1","description":"<p>This modifies the product's information</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","products","1"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"4ac0b589-ff00-46ab-9eff-b8c0e26fbcd2"},{"name":"Stock product","id":"a8699596-3d98-4015-93c0-678b95d72fa4","request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\"product_id\": 1, \"quantity\": 24}"},"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/inventory?x-access-token","description":"<p>This restocks the product in the inventory</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","inventory"],"host":["store-manager17","herokuapp","com"],"query":[{"key":"x-access-token","value":null}],"variable":[]}},"response":[],"_postman_id":"a8699596-3d98-4015-93c0-678b95d72fa4"}],"id":"56bbacd4-b929-4147-8863-f688cf6113c2","_postman_id":"56bbacd4-b929-4147-8863-f688cf6113c2","description":""},{"name":"Sales","item":[{"name":"Create a sale record","id":"df804131-8bb9-4255-b904-5a26ee42b961","request":{"method":"POST","header":[{"key":"x-access-token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbF9hZGRyZXNzIjoiaG9wZUBnbWFpbC5jb20iLCJleHAiOjE1NDAxMTM2Mjl9.P4FlsR4BZsRXD1mU_IBpeNnyB8CY0W91lykVTi3qV_4","type":"text"},{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\"payment_mode\": \"cash\", \"products\": [{\"product_id\": 3, \"quantity_to_be_sold\": 4}, {\"product_id\": 2, \"quantity_to_be_sold\": 5}]}"},"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/sales","description":"<p>This creates a record of a product sold by the staff attendant. Its only accessible to the staff attendant creating the record.</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","sales"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"df804131-8bb9-4255-b904-5a26ee42b961"},{"name":"Get single sale record","id":"ac6d6f73-e858-437c-8f4d-31f7a8ffd284","request":{"method":"GET","header":[{"key":"x-access-token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbF9hZGRyZXNzIjoiaG9wZUBnbWFpbC5jb20iLCJleHAiOjE1NDAxMTM2Mjl9.P4FlsR4BZsRXD1mU_IBpeNnyB8CY0W91lykVTi3qV_4","type":"text"}],"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/sales/1","description":"<p>This fetches a particulr sale record created by its creator (store attendant).Its only accessible to the owner of the sale record</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","sales","1"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"ac6d6f73-e858-437c-8f4d-31f7a8ffd284"},{"name":"Get all Sale records","id":"4687e838-efac-42f9-a792-84c922441e42","request":{"method":"GET","header":[{"key":"x-access-token","value":"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJlbWFpbF9hZGRyZXNzIjoiam9iQGdtYWlsLmNvbSIsImV4cCI6MTU0MDExMjI3MH0.nDD0fra7aeSxN_jBJPWloBbULmMuBqWuBcrkBSfZMpo","type":"text"}],"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/sales","description":"<p>This fetches all sale records created by all staff attendants. Its only accessible to the admin</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","sales"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"4687e838-efac-42f9-a792-84c922441e42"}],"id":"bf41079a-543a-411a-8ea7-702662303437","_postman_id":"bf41079a-543a-411a-8ea7-702662303437","description":""},{"name":"User Registration","item":[{"name":"Register Users","id":"591b40cf-d6c1-456a-809b-4445fd689327","request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json"}],"body":{"mode":"raw","raw":"{\"name\": \"Calvin\", \"email_address\": \"calvin@gmail.com\", \"password\": \"Pete\", \"account_type\": \"store_attendant\"}"},"url":"https://store-manager17.herokuapp.com/store-manager/api/v1/auth/signup","description":"<p>This creates another user E.g. staff attendant. It's accessible only to the admin</p>\n","urlObject":{"protocol":"https","path":["store-manager","api","v1","auth","signup"],"host":["store-manager17","herokuapp","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"591b40cf-d6c1-456a-809b-4445fd689327"}],"id":"c23a670d-8160-417a-b38b-47803bdb7c53","event":[{"listen":"prerequest","script":{"id":"6c1e46d2-1567-4627-8b66-b02fde88191b","type":"text/javascript","exec":[""]}},{"listen":"test","script":{"id":"67afd341-1d63-4f14-92cd-fbe8163ec5dc","type":"text/javascript","exec":[""]}}],"_postman_id":"c23a670d-8160-417a-b38b-47803bdb7c53","description":""}]}