{"info":{"_postman_id":"8653ab83-a4cd-46fa-b232-4b412e397fd8","name":"PBP","description":"<html><head></head><body><p>This collection of API calls provides an easy way to interact with a PBP network. Update your environment variables to efficiently use the collection.</p>\n<p><strong>Common Variables</strong></p>\n<ul>\n<li>Bearer Token</li>\n<li>username</li>\n<li>password</li>\n</ul>\n<p>A template has been provided that can be used to quickly import the variable names. You will still be responsible for filling in the values and missing variables as needed.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"8522351","collectionId":"8653ab83-a4cd-46fa-b232-4b412e397fd8","publishedId":"SzKPWMa4","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2020-02-15T08:45:22.000Z"},"item":[{"name":"User Resources","item":[{"name":"Register a regular user","id":"f64127ba-bf13-470b-bbea-79a21f6362a4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"test_user\",\n\t\"password\": \"test_user\"\n}"},"url":"https://pbp-api-v0.herokuapp.com/api/register","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/register\n</code></pre><h2 id=\"parameters\">PARAMETERS</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>username</td>\n<td>The name of the regular user</td>\n</tr>\n<tr>\n<td>password</td>\n<td>The password of the regular user</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 201\n\n{\n    \"msg\": \"User test_user was successfully created\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","register"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"44330ec1-0833-4a73-8b9d-260363ccf57c","name":"Register a regular user","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"test_user\",\n\t\"password\": \"test_user\"\n}","options":{"raw":{"language":"json"}}},"url":"https://pbp-api-v0.herokuapp.com/api/register"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 07:03:08 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"51"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"User test_user was successfully created\"\n}"}],"_postman_id":"f64127ba-bf13-470b-bbea-79a21f6362a4"},{"name":"Login a regular user","id":"0a27d7fc-9402-48db-91fa-507e631e51aa","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"test_user\",\n\t\"password\": \"test_user\"\n}"},"url":"https://pbp-api-v0.herokuapp.com/api/login","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/login\n</code></pre><h2 id=\"parameters\">PARAMETERS</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>username</td>\n<td>The name of the regular user</td>\n</tr>\n<tr>\n<td>password</td>\n<td>The password of the regular user</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 200\n\n{\n    \"msg\": \"Logged in as test_user\",\n    \"access_token\": \"&lt;token&gt;\",\n    \"refresh_token\": \"&lt;token&gt;\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","login"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"af202dd9-bc6c-4b01-b560-9b2be165363d","name":"Login a regular user","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"test_user\",\n\t\"password\": \"test_user\"\n}","options":{"raw":{"language":"json"}}},"url":"https://pbp-api-v0.herokuapp.com/api/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 07:12:38 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"775"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Logged in as test_user\",\n    \"access_token\": \"<token>\",\n    \"refresh_token\": \"<token>\"\n}"}],"_postman_id":"0a27d7fc-9402-48db-91fa-507e631e51aa"},{"name":"Get a regular user's profile","id":"6f669959-372d-471b-b392-e0a2660e1c90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"https://pbp-api-v0.herokuapp.com/api/user/profile","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/user/profile\n</code></pre><h2 id=\"authorization\">AUTHORIZATION</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Bearer Token</td>\n<td>the access token returned on successful regular user login</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 200\n\n{\n    \"username\": \"test_user\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","user","profile"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"87948d04-33a9-474f-8c84-7f9f91c95893","name":"Get a regular user's profile","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"https://pbp-api-v0.herokuapp.com/api/user/profile"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 07:42:14 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"26"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"username\": \"test_user\"\n}"}],"_postman_id":"6f669959-372d-471b-b392-e0a2660e1c90"},{"name":"Register a vendor","id":"118be4d2-fabe-4505-b7b6-fb41a9f5ca1c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"test_vendor\",\n\t\"password\": \"test_vendor\"\n}"},"url":"https://pbp-api-v0.herokuapp.com/api/vendor/register","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/vendor/register\n</code></pre><h2 id=\"parameters\">PARAMETERS</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>username</td>\n<td>The name of the vendor</td>\n</tr>\n<tr>\n<td>password</td>\n<td>The password of the vendor</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 201\n\n{\n    \"msg\": \"Vendor test_vendor was successfully created\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","vendor","register"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"34538e29-cfe0-40ee-9814-a0c6772205a6","name":"Register a vendor","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"test_vendor\",\n\t\"password\": \"test_vendor\"\n}","options":{"raw":{"language":"json"}}},"url":"https://pbp-api-v0.herokuapp.com/api/vendor/register"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 07:20:46 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"55"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Vendor test_vendor was successfully created\"\n}"}],"_postman_id":"118be4d2-fabe-4505-b7b6-fb41a9f5ca1c"},{"name":"Login a vendor","id":"3fff3955-2865-4cc1-8a57-ec198321816d","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"test_vendor\",\n\t\"password\": \"test_vendor\"\n}"},"url":"https://pbp-api-v0.herokuapp.com/api/vendor/login","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/vendor/login\n</code></pre><h2 id=\"parameters\">PARAMETERS</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>username</td>\n<td>The name of the vendor</td>\n</tr>\n<tr>\n<td>password</td>\n<td>The password of the vendor</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 200\n\n{\n    \"msg\": \"Logged in as test_vendor\",\n    \"access_token\": \"&lt;token&gt;\",\n    \"refresh_token\": \"&lt;token&gt;\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","vendor","login"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"a08291bc-c4a5-46de-8b53-ee4a7b06e955","name":"Login a vendor","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"username\": \"test_vendor\",\n\t\"password\": \"test_vendor\"\n}","options":{"raw":{"language":"json"}}},"url":"https://pbp-api-v0.herokuapp.com/api/vendor/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 07:23:50 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"766"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Logged in as test_vendor\",\n    \"access_token\": \"<token>\",\n    \"refresh_token\": \"<token>\"\n}"}],"_postman_id":"3fff3955-2865-4cc1-8a57-ec198321816d"},{"name":"Create a vendor's shop","id":"36f586a6-dea0-4bf3-b594-656873410802","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"shop_name\": \"test_shop\",\n\t\"shop_lat\": -1.28333,\n\t\"shop_lng\": 36.81667\n}"},"url":"https://pbp-api-v0.herokuapp.com/api/vendor/shop","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/vendor/shop\n</code></pre><h2 id=\"parameters\">PARAMETERS</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>shop_name</td>\n<td>The name of the vendor's shop</td>\n</tr>\n<tr>\n<td>shop_lat</td>\n<td>The numeric latitide value of the shop's location</td>\n</tr>\n<tr>\n<td>shop_lng</td>\n<td>The numeric longitude value of the shop's location</td>\n</tr>\n</tbody>\n</table>\n</div><h2 id=\"authorization\">AUTHORIZATION</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Bearer Token</td>\n<td>the access token returned on successful vendor login</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 201\n\n{\n    \"msg\": \"Shop test_shop was successfully created\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","vendor","shop"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"0c0ac3ae-4d4e-48bd-ae19-d9d9ff090cf1","name":"Create a vendor's shop","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer <token>","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"shop_name\": \"test_shop\",\n\t\"shop_lat\": -1.28333,\n\t\"shop_lng\": 36.81667\n}","options":{"raw":{"language":"json"}}},"url":"https://pbp-api-v0.herokuapp.com/api/vendor/shop"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 07:31:19 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"51"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"Shop test_shop was successfully created\"\n}"}],"_postman_id":"36f586a6-dea0-4bf3-b594-656873410802"}],"id":"03215b3c-1117-4afc-b9ca-7ebd7a168424","_postman_id":"03215b3c-1117-4afc-b9ca-7ebd7a168424","description":""},{"name":"Marketplace Resources","item":[{"name":"Create item in a vendor's shop","id":"d42dc735-642b-44a4-98c2-36b81f175b17","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"}],"body":{"mode":"raw","raw":"{\n\t\"item_name\": \"test_item\",\n\t\"item_quantity\": 20\n}"},"url":"https://pbp-api-v0.herokuapp.com/api/item","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/item\n</code></pre><h2 id=\"parameters\">PARAMETERS</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>item_name</td>\n<td>The name of the item to be added to a vendor's shop</td>\n</tr>\n<tr>\n<td>item_quantity</td>\n<td>The number of items to be added</td>\n</tr>\n</tbody>\n</table>\n</div><h2 id=\"authorization\">AUTHORIZATION</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Bearer Token</td>\n<td>the access token returned on successful vendor login</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 201\n\n{\n    \"msg\": \"item test_item was successfully added\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","item"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"3655df04-e713-48f4-8cb1-fc65dcf8c564","name":"Create a new item in a vendor's shop","originalRequest":{"method":"POST","header":[{"key":"Content-Type","name":"Content-Type","type":"text","value":"application/json"},{"key":"Authorization","type":"text","value":"Bearer <token>"}],"body":{"mode":"raw","raw":"{\n\t\"item_name\": \"test_item\",\n\t\"item_quantity\": 20\n}","options":{"raw":{"language":"json"}}},"url":"https://pbp-api-v0.herokuapp.com/api/item"},"status":"CREATED","code":201,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 07:57:41 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"49"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"item test_item was successfully added\"\n}"}],"_postman_id":"d42dc735-642b-44a4-98c2-36b81f175b17"},{"name":"Get all Marketplace items","id":"7cf2d51f-d08a-4ff6-9039-673463f33860","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"noauth","isInherited":false},"method":"GET","header":[],"url":"https://pbp-api-v0.herokuapp.com/api/item","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/item\n</code></pre><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 201\n\n[\n    {\n        \"_id\": \"5e47a475d5d11530edae4a6f\",\n        \"item_name\": \"test_item\",\n        \"item_quantity\": 20,\n        \"vendor_id\": \"5e479bced5d11530edae4a6e\",\n        \"shop_id\": \"5e479e475fdec761743f5829\"\n    }\n]\n</code></pre>","urlObject":{"protocol":"https","path":["api","item"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"cf4ad785-03a0-4e30-8fbd-a6d13edeb3cf","name":"Get all Marketplace items","originalRequest":{"method":"GET","header":[],"url":"https://pbp-api-v0.herokuapp.com/api/item"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 08:01:43 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"1959"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"_id\": \"5e47a475d5d11530edae4a6f\",\n        \"item_name\": \"test_item\",\n        \"item_quantity\": 20,\n        \"vendor_id\": \"5e479bced5d11530edae4a6e\",\n        \"shop_id\": \"5e479e475fdec761743f5829\"\n    }\n]"}],"_postman_id":"7cf2d51f-d08a-4ff6-9039-673463f33860"},{"name":"Create a new order ","id":"e799245e-e0c1-4831-a2f5-2abca885c852","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer <>","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"regular_user_id\": \"5e4797ac5fdec761743f5828\",\n\t\"item_id\": \"5e47a475d5d11530edae4a6f\",\n\t\"shop_id\": \"5e479e475fdec761743f5829\"\n}"},"url":"https://pbp-api-v0.herokuapp.com/api/order","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>POST /api/order\n</code></pre><h2 id=\"parameters\">PARAMETERS</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>regular_user_id</td>\n<td>The id of the user making the order</td>\n</tr>\n<tr>\n<td>item_id</td>\n<td>The id of the item being ordered</td>\n</tr>\n<tr>\n<td>shop_id</td>\n<td>The id of the shop that stocks the item</td>\n</tr>\n</tbody>\n</table>\n</div><h2 id=\"authorization\">AUTHORIZATION</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Bearer Token</td>\n<td>the access token returned on successful regular user login</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 201\n\n{\n    \"msg\": \"new order created\"\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","order"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"d8770943-8582-4225-89b1-5260785fd3cb","name":"Create a new order ","originalRequest":{"method":"POST","header":[{"key":"Content-Type","value":"application/json","type":"text"},{"key":"Authorization","value":"Bearer <token>","type":"text"}],"body":{"mode":"raw","raw":"{\n\t\"regular_user_id\": \"5e4797ac5fdec761743f5828\",\n\t\"item_id\": \"5e47a475d5d11530edae4a6f\",\n\t\"shop_id\": \"5e479e475fdec761743f5829\"\n}"},"url":"https://pbp-api-v0.herokuapp.com/api/order"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 08:22:08 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"29"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"msg\": \"new order created\"\n}"}],"_postman_id":"e799245e-e0c1-4831-a2f5-2abca885c852"},{"name":"Get a regular user's orders","id":"e2d8d998-f75c-4a72-bb0e-ebe8618971ba","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"https://pbp-api-v0.herokuapp.com/api/order","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/order\n</code></pre><h2 id=\"authorization\">AUTHORIZATION</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Bearer Token</td>\n<td>the access token returned on successful regular user login</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 200\n\n[\n    {\n        \"order_id\": \"5e47aa30d5d11530edae4a70\",\n        \"shop_id\": \"5e479e475fdec761743f5829\",\n        \"shop_name\": \"test_shop\",\n        \"items\": [\n            \"test_item\"\n        ]\n    }\n]\n</code></pre>","urlObject":{"protocol":"https","path":["api","order"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"e287073a-0770-4901-b16e-2905f6b5d8c0","name":"Get a regular user's orders","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"https://pbp-api-v0.herokuapp.com/api/order"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 08:31:30 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"132"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"order_id\": \"5e47aa30d5d11530edae4a70\",\n        \"shop_id\": \"5e479e475fdec761743f5829\",\n        \"shop_name\": \"test_shop\",\n        \"items\": [\n            \"test_item\"\n        ]\n    }\n]"}],"_postman_id":"e2d8d998-f75c-4a72-bb0e-ebe8618971ba"},{"name":"Get coordinates for shops a regular user has ordered from","id":"4fbb4d93-2591-4047-a251-70134f921052","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"https://pbp-api-v0.herokuapp.com/api/order/map","description":"<h2 id=\"http-request\">HTTP REQUEST</h2>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>GET /api/order/map\n</code></pre><h2 id=\"authorization\">AUTHORIZATION</h2>\n<div class=\"click-to-expand-wrapper is-table-wrapper\"><table>\n<thead>\n<tr>\n<th><strong>Parameter</strong></th>\n<th><strong>Description</strong></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Bearer Token</td>\n<td>the access token returned on successful regular user login</td>\n</tr>\n</tbody>\n</table>\n</div><h3 id=\"sample-response\">SAMPLE RESPONSE</h3>\n<pre class=\"click-to-expand-wrapper is-snippet-wrapper\"><code>Successful HTTP Status: 200\n\n{\n    \"locations\": [\n        {\n            \"lat\": -1.28333,\n            \"lng\": 36.81667\n        }\n    ]\n}\n</code></pre>","urlObject":{"protocol":"https","path":["api","order","map"],"host":["pbp-api-v0","herokuapp","com"],"query":[],"variable":[]}},"response":[{"id":"d9bd0c2b-16e6-48bb-a62d-163315aa226c","name":"Get coordinates for shops a regular user has ordered from","originalRequest":{"method":"GET","header":[{"key":"Authorization","value":"Bearer <token>","type":"text"}],"url":"https://pbp-api-v0.herokuapp.com/api/order/map"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Connection","value":"keep-alive"},{"key":"Server","value":"gunicorn/20.0.4"},{"key":"Date","value":"Sat, 15 Feb 2020 08:36:16 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"52"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Via","value":"1.1 vegur"}],"cookie":[],"responseTime":null,"body":"{\n    \"locations\": [\n        {\n            \"lat\": -1.28333,\n            \"lng\": 36.81667\n        }\n    ]\n}"}],"_postman_id":"4fbb4d93-2591-4047-a251-70134f921052"}],"id":"9b7555a3-262d-406c-a638-6b084e9d1f25","_postman_id":"9b7555a3-262d-406c-a638-6b084e9d1f25","description":""}]}