{"info":{"_postman_id":"dce5db1a-242f-4627-8e7c-9615aa4e16f2","name":"Flask Python API","description":"<html><head></head><body><p>Welcome to the <strong>Flask Python API</strong> documentation. This API is designed to manage customers, products, and orders in an efficient and scalable way. It follows a layered architecture using Flask blueprints for route management and structured service layers for business logic. The API supports full CRUD operations on customers, products, and orders, as well as health check endpoints to ensure uptime.</p>\n<p>This documentation provides a detailed overview of all available endpoints, including their request formats, response formats, and example payloads.</p>\n</body></html>","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"owner":"36681432","collectionId":"dce5db1a-242f-4627-8e7c-9615aa4e16f2","publishedId":"2sAXqqchr4","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"589AAF"},"publishDate":"2024-09-17T18:41:00.000Z"},"item":[{"name":"Customer Endpoints","item":[{"name":"save customer","id":"3128a4c5-b620-4304-bba6-b6abb85b3e06","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"John Xavier\",\n    \"address\": \"123 Street\",\n    \"email\": \"john@xavier.com\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/customer","description":"<p>This endpoint creates a new customer in the system. You must provide customer details like name, address, and email. On successful creation, the system returns the response message.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","customer"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"49496a87-520e-4a08-877d-7a82026bd802","name":"example response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"John Xavier\",\n    \"address\": \"123 Street\",\n    \"email\": \"john@xavier.com\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/customer/register"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:22:18 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"48"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Customer added successfully!\"\n}"}],"_postman_id":"3128a4c5-b620-4304-bba6-b6abb85b3e06"},{"name":"get customer","id":"045e73a1-f5ba-43ad-9e4d-75b3c61e790f","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/customer/2","description":"<p>Retrieves detailed information about a specific customer by ID. This is useful for viewing customer details or verifying data.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","customer","2"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"ced38a50-82a6-4e88-89b4-2189b432ea29","name":"example response","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/customer/2"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:25:52 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"90"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"customer\": [\n        2,\n        \"John Xavier\",\n        \"123 Street\",\n        \"john@xavier.com\"\n    ]\n}"}],"_postman_id":"045e73a1-f5ba-43ad-9e4d-75b3c61e790f"},{"name":"get all customers","id":"9e7d19b5-ddf1-40e0-a68c-3a0b154ada0c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/customer","description":"<p>Returns a list of all registered customers in the system.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","customer"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"f44b55a8-616e-4394-9ff3-7be40d88ea5a","name":"example response","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/customer"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:32:15 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"289"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"customers\": [\n        [\n            1,\n            \"Ramesh Silva\",\n            \"123 Street\",\n            \"ramesh@silva.com\"\n        ],\n        [\n            2,\n            \"John Xavier\",\n            \"456 Street\",\n            \"john@xavier.com\"\n        ],\n        [\n            3,\n            \"Vince Perera\",\n            \"789 Street\",\n            \"vince@perera.com\"\n        ]\n    ]\n}"}],"_postman_id":"9e7d19b5-ddf1-40e0-a68c-3a0b154ada0c"},{"name":"update customer","id":"ad9896f9-dbeb-4969-a68c-45a2ebec0d90","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Jane Doe\",\n    \"address\": \"412 Avenue\",\n    \"email\": \"jane@doe.com\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/customer/1","description":"<p>Updates an existing customer's details, allowing partial updates (such as changing only the address or email).</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","customer","1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"24f200d4-1a26-45f9-bb4e-dabce9394848","name":"example response","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Jane Doe\",\n    \"address\": \"412 Avenue\",\n    \"email\": \"jane@doe.com\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/customer/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:33:39 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"50"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Customer updated successfully!\"\n}"}],"_postman_id":"ad9896f9-dbeb-4969-a68c-45a2ebec0d90"},{"name":"delete customer","id":"baabb9e2-57a7-48ae-bad3-594113d86074","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://127.0.0.1:5001/api/v1/customer/3","description":"<p>Removes a customer from the system by their ID. This action is irreversible.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","customer","3"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"c0f2da61-bf6c-4458-8404-02b262c154fa","name":"example response","originalRequest":{"method":"DELETE","header":[],"url":"http://127.0.0.1:5001/api/v1/customer/3"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:35:26 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"50"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Customer deleted successfully!\"\n}"}],"_postman_id":"baabb9e2-57a7-48ae-bad3-594113d86074"}],"id":"78cf8feb-fbf8-4a8b-ac45-dbc228dfbc91","description":"<p>The customer resource is responsible for handling the management of customer data, including creation, retrieval, update, and deletion. Below are the endpoints related to the customer operations:</p>\n","_postman_id":"78cf8feb-fbf8-4a8b-ac45-dbc228dfbc91"},{"name":"Product Endpoints","item":[{"name":"save product","id":"30e07465-ecb8-42fe-a523-f6a8803f87ee","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Cream craker\",\n    \"price\": \"450.00\",\n    \"qty\": \"120\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/product","description":"<p>Adds a new product to the inventory. Requires details such as the product name, price, and quantity.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","product"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"13d672d6-f170-4113-a34c-fa3f75ea8d95","name":"example response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Cream craker\",\n    \"price\": \"450.00\",\n    \"qty\": \"120\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/product"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:44:09 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"47"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product added successfully!\"\n}"}],"_postman_id":"30e07465-ecb8-42fe-a523-f6a8803f87ee"},{"name":"get product","id":"5fef54bf-e5ca-4aa2-a618-e61b24ff04e9","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/product/1","description":"<p>Fetches detailed information about a specific product by ID.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","product","1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"98cf07bb-03f9-4704-9b75-cacc92b6c0fb","name":"example response","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/product/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:47:08 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"72"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"product\": [\n        1,\n        \"Cream craker\",\n        \"450.00\",\n        120\n    ]\n}"}],"_postman_id":"5fef54bf-e5ca-4aa2-a618-e61b24ff04e9"},{"name":"get all products","id":"12ac2b66-8fb9-49ad-9c6a-7920430c8400","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/product","description":"<p>Returns a list of all available products in the inventory.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","product"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"5e1dbd88-658c-4039-909e-8424c7997ebc","name":"example response","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/product"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:47:55 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"231"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"products\": [\n        [\n            1,\n            \"Cream craker\",\n            \"450.00\",\n            120\n        ],\n        [\n            2,\n            \"Diva detergent\",\n            \"640.00\",\n            80\n        ],\n        [\n            3,\n            \"Panda soap\",\n            \"90.00\",\n            500\n        ]\n    ]\n}"}],"_postman_id":"12ac2b66-8fb9-49ad-9c6a-7920430c8400"},{"name":"update product","id":"8f1d5096-54d0-4988-993e-87e7b44a54a5","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Ginger biscuits\",\n    \"price\": \"340.00\",\n    \"qty\": \"134\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/product/1","description":"<p>Updates specific details of a product, such as price or quantity.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","product","1"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"dc36df56-0118-4cd3-8f6f-8975d3a73de3","name":"example response","originalRequest":{"method":"PATCH","header":[],"body":{"mode":"raw","raw":"{\n    \"name\": \"Ginger biscuits\",\n    \"price\": \"340.00\",\n    \"qty\": \"134\"\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/product/1"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Tue, 17 Sep 2024 11:06:44 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"49"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product updated successfully!\"\n}"}],"_postman_id":"8f1d5096-54d0-4988-993e-87e7b44a54a5"},{"name":"delete product","id":"2fdd57fe-a058-40be-9714-0294097d5f98","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"DELETE","header":[],"url":"http://127.0.0.1:5001/api/v1/product/3","description":"<p>Deletes a product from the inventory.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","product","3"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"bc04b158-f7f9-4184-933c-73227062cb79","name":"example response","originalRequest":{"method":"DELETE","header":[],"url":"http://127.0.0.1:5001/api/v1/product/3"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Tue, 17 Sep 2024 11:10:22 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"49"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Product deleted successfully!\"\n}"}],"_postman_id":"2fdd57fe-a058-40be-9714-0294097d5f98"}],"id":"9beb4ee7-edae-44c6-ab27-11a523787892","description":"<p>The product resource manages all products in the inventory. You can create, view, update, or delete product information using these endpoints:</p>\n","_postman_id":"9beb4ee7-edae-44c6-ab27-11a523787892"},{"name":"Order Endpoints","item":[{"name":"place order","id":"e8dc4781-a6d3-4ef7-acc0-f7c7876c6b4c","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"customer_id\": 4,\n    \"items\": [\n        {\n            \"product_id\": 2,\n            \"quantity\": 1\n        },\n        {\n            \"product_id\": 1,\n            \"quantity\": 5\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/order","description":"<p>Places a new order for a customer. You must provide the customer ID and the list of product items with quantities. The system ensures inventory consistency by updating product quantities accordingly.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","order"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"5955970e-eac2-4419-aa90-ad5650bfab6a","name":"example response","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\n    \"customer_id\": 1,\n    \"items\": [\n        {\n            \"product_id\": 1,\n            \"quantity\": 2\n        },\n        {\n            \"product_id\": 2,\n            \"quantity\": 1\n        }\n    ]\n}","options":{"raw":{"language":"json"}}},"url":"http://127.0.0.1:5001/api/v1/order"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Tue, 17 Sep 2024 17:44:40 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"63"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"message\": \"Order placed successfully!\",\n    \"order_id\": 3\n}"}],"_postman_id":"e8dc4781-a6d3-4ef7-acc0-f7c7876c6b4c"},{"name":"get order","id":"fab7dd51-eefb-41fe-8849-2fde61b82aca","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/order/3","description":"<p>Retrieves detailed information about a specific order by ID, including the customer, order date and total price.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","order","3"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"168788c0-b347-4d20-916a-2db45283ed1d","name":"example response","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/order/3"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Tue, 17 Sep 2024 17:51:27 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"86"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"order\": [\n        3,\n        1,\n        \"Tue, 17 Sep 2024 23:14:40 GMT\",\n        \"1320.00\"\n    ]\n}"}],"_postman_id":"fab7dd51-eefb-41fe-8849-2fde61b82aca"},{"name":"get all orders","id":"e27b6ca1-640b-430c-b7b3-f9e9605e5d65","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/order","description":"<p>Fetches all the orders placed in the system.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","order"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"0a3b0fe7-ab55-46e5-a21b-20e0c743dfec","name":"example response","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/order"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Tue, 17 Sep 2024 17:53:07 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"279"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"orders\": [\n        [\n            3,\n            1,\n            \"Tue, 17 Sep 2024 23:14:40 GMT\",\n            \"1320.00\"\n        ],\n        [\n            5,\n            4,\n            \"Tue, 17 Sep 2024 23:18:21 GMT\",\n            \"2340.00\"\n        ],\n        [\n            6,\n            5,\n            \"Tue, 17 Sep 2024 23:20:22 GMT\",\n            \"2600.00\"\n        ]\n    ]\n}"}],"_postman_id":"e27b6ca1-640b-430c-b7b3-f9e9605e5d65"}],"id":"36f4aaef-40a8-44b0-9d2f-0876c70dc5e9","description":"<p>The order resource handles customer orders, including creating new orders and viewing order details. Each order consists of a customer and a list of product items.</p>\n","_postman_id":"36f4aaef-40a8-44b0-9d2f-0876c70dc5e9"},{"name":"health check","id":"bf8d9683-906a-452e-bd62-ecf66e87eb61","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/health","description":"<p>To ensure the API is running smoothly, a health check endpoint is available. This can be used to verify the API’s availability and general health.</p>\n","urlObject":{"protocol":"http","port":"5001","path":["api","v1","health"],"host":["127","0","0","1"],"query":[],"variable":[]}},"response":[{"id":"ff76910f-040c-4c38-9df9-4ee940181ab5","name":"example response","originalRequest":{"method":"GET","header":[],"url":"http://127.0.0.1:5001/api/v1/health"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"Server","value":"Werkzeug/3.0.4 Python/3.10.12"},{"key":"Date","value":"Mon, 16 Sep 2024 18:24:01 GMT"},{"key":"Content-Type","value":"application/json"},{"key":"Content-Length","value":"21"},{"key":"Access-Control-Allow-Origin","value":"*"},{"key":"Connection","value":"close"}],"cookie":[],"responseTime":null,"body":"{\n    \"status\": \"ok\"\n}"}],"_postman_id":"bf8d9683-906a-452e-bd62-ecf66e87eb61"}]}