{"info":{"_postman_id":"2d561ca0-4f4a-472d-ae6d-321c99781ea2","name":"LabECommerce","description":"<html><head></head><body><p>API REST desenvolvida com o objetivo de simular um sistema de um E-commerce. Os endpoints permitem buscar todos os usuários, buscar todos os produtos, buscar as compras de cada usuário, criar um novo usuário, criar um novo produto e adicionar uma nova compra.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"22366134","collectionId":"2d561ca0-4f4a-472d-ae6d-321c99781ea2","publishedId":"2s8Yt1qp5J","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"EF5B25"},"publishDate":"2022-11-30T18:40:04.000Z"},"item":[{"name":"getAllUsers","id":"9b02c9d1-5d16-48d7-9836-e9d73c626745","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://labecommerce-backend.onrender.com/users","description":"<p>Retorna todos os usuários (id, name, email e password) e array de compras realizadas (purchases). Retorna um array vazio na propriedade purchases quando o usuário ainda não efetuou nenhuma compra.</p>\n","urlObject":{"protocol":"https","path":["users"],"host":["labecommerce-backend","onrender","com"],"query":[],"variable":[]}},"response":[{"id":"830d7ab0-ba43-4a3c-956b-e3a85b8d2d0c","name":"getAllUsers","originalRequest":{"method":"GET","header":[],"url":"https://labecommerce-backend.onrender.com/users"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 01 Dec 2022 13:15:45 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"CF-Ray","value":"772c16b08bd800d7-GRU"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"ETag","value":"W/\"2e2-6tolK4XxV/Q6rQIqSrHd189zKpw\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"CF-Cache-Status","value":"DYNAMIC"},{"key":"x-powered-by","value":"Express"},{"key":"Server","value":"cloudflare"},{"key":"Content-Encoding","value":"br"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": \"1669749337942\",\n        \"name\": \"Maria\",\n        \"email\": \"maria@gmail.com\",\n        \"password\": \"bananinha\",\n        \"purchases\": [\n            {\n                \"productName\": \"CD 5 Seconds of Summer - 5S0S5\",\n                \"productId\": \"1669751515034\",\n                \"quantity\": 2,\n                \"totalPrice\": 71.8\n            },\n            {\n                \"productName\": \"CD Taylor Swift - Folklore\",\n                \"productId\": \"1669751515032\",\n                \"quantity\": 1,\n                \"totalPrice\": 49.9\n            }\n        ]\n    }\n]"}],"_postman_id":"9b02c9d1-5d16-48d7-9836-e9d73c626745"},{"name":"getAllProducts","id":"98b5ef03-9222-42e1-87b9-7a7a55255ff8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://labecommerce-backend.onrender.com/products?search&order","description":"<p>Retorna todos os produtos. É possível buscar pelo nome de um produto, através do query params <strong>search</strong>, e definir se a exibição será por ordem crescente <strong>(asc)</strong> ou decrescente <strong>(desc)</strong> do nome, através do query param <strong>order</strong>.</p>\n","urlObject":{"protocol":"https","path":["products"],"host":["labecommerce-backend","onrender","com"],"query":[{"key":"search","value":null},{"key":"order","value":null}],"variable":[]}},"response":[{"id":"dfbcbabe-a9ab-4aed-8b1c-d1e88305e9a4","name":"getAllProducts","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://labecommerce-backend.onrender.com/products?search&order","protocol":"https","host":["labecommerce-backend","onrender","com"],"path":["products"],"query":[{"key":"search","value":null},{"key":"order","value":null}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 01 Dec 2022 13:17:28 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"CF-Ray","value":"772c1a66fc3d00d7-GRU"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"ETag","value":"W/\"2ff-uJ8uCfnqQq1J5DmIFdnUrOy+Qv8\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"CF-Cache-Status","value":"DYNAMIC"},{"key":"x-powered-by","value":"Express"},{"key":"Server","value":"cloudflare"},{"key":"Content-Encoding","value":"br"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"[\n    {\n        \"id\": \"1669751515034\",\n        \"name\": \"CD 5 Seconds of Summer - 5S0S5\",\n        \"price\": 35.9,\n        \"image_url\": \"https://m.media-amazon.com/images/I/81Mhruo-6VL._AC_SX679_.jpg\"\n    },\n    {\n        \"id\": \"1669751515031\",\n        \"name\": \"CD Ashlee Simpson - Autobiography\",\n        \"price\": 19.9,\n        \"image_url\": \"https://m.media-amazon.com/images/I/71UvrwygP-L._AC_SX522_.jpg\"\n    },\n    {\n        \"id\": \"1669751515032\",\n        \"name\": \"CD Taylor Swift - Folklore\",\n        \"price\": 49.9,\n        \"image_url\": \"https://m.media-amazon.com/images/I/A1Q6XGXmIFL._AC_SX679_.jpg\"\n    }\n]"}],"_postman_id":"98b5ef03-9222-42e1-87b9-7a7a55255ff8"},{"name":"getPurchasesByUser","id":"04396d5f-e6c8-439e-830c-e9fb512628a8","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"https://labecommerce-backend.onrender.com/users/:user_id/purchases","description":"<p>Retorna todas as compras de um determinado usuário. É obrigatório passar o id do usuário., através de path params.</p>\n","urlObject":{"protocol":"https","path":["users",":user_id","purchases"],"host":["labecommerce-backend","onrender","com"],"query":[],"variable":[{"type":"any","value":"","key":"user_id"}]}},"response":[{"id":"2c50f014-ca4e-41bd-a586-0afd07028aac","name":"getPurchasesByUser","originalRequest":{"method":"GET","header":[],"url":{"raw":"https://labecommerce-backend.onrender.com/users/:user_id/purchases","protocol":"https","host":["labecommerce-backend","onrender","com"],"path":["users",":user_id","purchases"],"variable":[{"key":"user_id","value":"1669749337942"}]}},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Date","value":"Thu, 01 Dec 2022 13:17:53 GMT"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Transfer-Encoding","value":"chunked"},{"key":"Connection","value":"keep-alive"},{"key":"CF-Ray","value":"772c1b02ed0000d7-GRU"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"ETag","value":"W/\"107-KcjW16q4KBo6BVryepGYRFVeAYE\""},{"key":"Vary","value":"Accept-Encoding"},{"key":"CF-Cache-Status","value":"DYNAMIC"},{"key":"x-powered-by","value":"Express"},{"key":"Server","value":"cloudflare"},{"key":"Content-Encoding","value":"br"},{"key":"alt-svc","value":"h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400"}],"cookie":[],"responseTime":null,"body":"{\n    \"user\": \"Maria\",\n    \"id\": \"1669749337942\",\n    \"purchases\": [\n        {\n            \"productName\": \"CD 5 Seconds of Summer - 5S0S5\",\n            \"productId\": \"1669751515034\",\n            \"quantity\": 2,\n            \"totalPrice\": 71.8\n        },\n        {\n            \"productName\": \"CD Taylor Swift - Folklore\",\n            \"productId\": \"1669751515032\",\n            \"quantity\": 1,\n            \"totalPrice\": 49.9\n        }\n    ]\n}"}],"_postman_id":"04396d5f-e6c8-439e-830c-e9fb512628a8"},{"name":"createUser","id":"673dc62b-3bc9-490d-911b-6a033495faea","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"Maria\",\r\n    \"email\": \"maria@gmail.com\",\r\n    \"password\": \"bananinha\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://labecommerce-backend.onrender.com/users","description":"<p>Adiciona um novo usuário. É obrigatório passar <strong>name</strong>, <strong>email</strong> e <strong>password</strong>.</p>\n","urlObject":{"protocol":"https","path":["users"],"host":["labecommerce-backend","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"673dc62b-3bc9-490d-911b-6a033495faea"},{"name":"createProduct","id":"e5289248-481e-44e1-af00-36db8e1407fb","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"name\": \"\",\r\n    \"price\": 0,\r\n    \"image_url\": \"\"\r\n}","options":{"raw":{"language":"json"}}},"url":"https://labecommerce-backend.onrender.com/products","description":"<p>Adiciona um novo produto. É obrigatório passar <strong>name</strong>, <strong>price</strong> (maior que 0) e <strong>image_url</strong>.</p>\n","urlObject":{"protocol":"https","path":["products"],"host":["labecommerce-backend","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"e5289248-481e-44e1-af00-36db8e1407fb"},{"name":"addPurchase","id":"f1e78734-2b55-425b-9a8c-11f32d05cfe4","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"userId\": \"\",\r\n    \"productId\": \"\",\r\n    \"quantity\": 0\r\n}","options":{"raw":{"language":"json"}}},"url":"https://labecommerce-backend.onrender.com/purchases","description":"<p>Adiciona uma nova compra. É obrigatório passar o <strong>id do usuário (userId)</strong>, <strong>id do produto (productId)</strong>, e <strong>quantidade (quantity)</strong> de itens do mesmo produto.</p>\n","urlObject":{"protocol":"https","path":["purchases"],"host":["labecommerce-backend","onrender","com"],"query":[],"variable":[]}},"response":[],"_postman_id":"f1e78734-2b55-425b-9a8c-11f32d05cfe4"}]}