{"openapi":"3.0.0","info":{"version":"1.0.0","title":"00SV - Develop Data Exchange Services API.","description":"Internal API of company CRM."},"servers":[{"url":"localhost:5000","description":"Location of API server."}],"components":{"securitySchemes":{"basicHttpAuthentication":{"description":"Basic HTTP Authentication","type":"http","scheme":"basic"},"bearerHttpAuthentication":{"description":"Bearer token using a JWT","type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"security":[{"basicHttpAuthentication":[]},{"bearerHttpAuthentication":[]}],"paths":{"/customers":{"get":{"summary":"Get all customers.","description":"Returns a list of all customers.","responses":{"200":{"description":"Returned all customers OK.","content":{"application/json":{"schema":{"type":"object","properties":{"customername":{"type":"string"},"address":{"type":"string"},"phone":{"type":"string"},"province":{"type":"string"}}}}}},"400":{"description":"Invalid request for customers."},"404":{"description":"Customers not found using your request."}}},"post":{"summary":"Create new customer.","description":"Creates a new customer and enters record into database.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customername":{"type":"string"},"address":{"type":"string"},"phone":{"type":"string"},"province":{"type":"string"}}}}}},"responses":{"201":{"description":"New customer created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"customername":{"type":"string"},"address":{"type":"string"},"phone":{"type":"string"},"province":{"type":"string"}}}}}},"404":{"description":"Requested location not found."},"409":{"description":"Conflict resource already exists."}}}},"/customer/{id}":{"get":{"parameters":[{"name":"id","in":"path","required":true,"description":"Customer ID","schema":{"type":"integer"}}],"summary":"Get a customer.","description":"Returns a single customer record based on its unique ID.","responses":{"200":{"description":"Customer retreived successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"customername":{"type":"string"},"address":{"type":"string"},"phone":{"type":"string"},"province":{"type":"string"}}}}}},"400":{"description":"Invalid customer ID request."},"404":{"description":"Customer ID not found."}}}},"/customers/{id}":{"patch":{"parameters":[{"name":"id","in":"path","required":true,"description":"Customer ID","schema":{"type":"integer"}}],"summary":"Update a customer.","description":"Updates a single customer record based on its unique ID.","responses":{"200":{"description":"Customer updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"customername":{"type":"string"},"address":{"type":"string"},"phone":{"type":"string"},"province":{"type":"string"}}}}}},"204":{"description":"No customer exists at this location."},"404":{"description":"Customer cannot be found or invalid customer ID."}}},"delete":{"parameters":[{"name":"id","in":"path","required":true,"description":"Customer ID","schema":{"type":"integer"}}],"summary":"Delete a customer.","description":"Deletes a single customer record based on its unique ID.","responses":{"200":{"description":"Customer deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"customerid":{"type":"integer"},"customername":{"type":"string"},"address":{"type":"string"},"phone":{"type":"string"},"province":{"type":"string"}}}}}},"204":{"description":"This customer does not exist."},"404":{"description":"Customer cannot be found or invalid customer ID."}}}},"/products":{"get":{"summary":"Get all products.","description":"Returns a list of all products.","responses":{"200":{"description":"Returned all products OK.","content":{"application/json":{"schema":{"type":"object","properties":{"productname":{"type":"string"},"price":{"type":"string"}}}}}},"400":{"description":"Invalid request for products."},"404":{"description":"Products not found using your request."}}},"post":{"summary":"Create new products.","description":"Creates a new product and enters record into database.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productname":{"type":"string"},"price":{"type":"string"}}}}}},"responses":{"201":{"description":"New product created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"productname":{"type":"string"},"price":{"type":"string"}}}}}},"404":{"description":"Requested location not found."},"409":{"description":"Conflict resource already exists."}}}},"/products/{id}":{"get":{"parameters":[{"name":"id","in":"path","required":true,"description":"Products ID","schema":{"type":"integer"}}],"summary":"Get a product.","description":"Returns a single product record based on its unique ID.","responses":{"200":{"description":"Product retreived successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"productname":{"type":"string"},"price":{"type":"string"}}}}}},"400":{"description":"Invalid product ID request."},"404":{"description":"Product ID not found."}}}},"/product/{id}":{"patch":{"parameters":[{"name":"id","in":"path","required":true,"description":"Products ID","schema":{"type":"integer"}}],"summary":"Update a product.","description":"Updates a single product record based on its unique ID.","responses":{"200":{"description":"Product updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"productname":{"type":"string"},"price":{"type":"string"}}}}}},"204":{"description":"No product exists at this location."},"404":{"description":"Product cannot be found or invalid product ID."}}},"delete":{"parameters":[{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"integer"}}],"summary":"Delete a product.","description":"Deletes a single product record based on its unique ID.","responses":{"200":{"description":"Product deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"productid":{"type":"integer"},"productname":{"type":"string"},"price":{"type":"string"}}}}}},"204":{"description":"This product does not exist."},"404":{"description":"Product cannot be found or invalid product ID."}}}},"/orders":{"get":{"summary":"Get all orders.","description":"Returns a list of all orders.","responses":{"200":{"description":"Returned all orders OK.","content":{"application/json":{"schema":{"type":"object","properties":{"customerid":{"type":"integer"},"orderdate":{"type":"string"}}}}}},"400":{"description":"Invalid request for orders."},"404":{"description":"Orders not found using your request."}}},"post":{"summary":"Create new order.","description":"Creates a new order and enters record into database.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customerid":{"type":"integer"},"orderdate":{"type":"string"}}}}}},"responses":{"201":{"description":"New order created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"customerid":{"type":"integer"},"orderdate":{"type":"string"}}}}}},"404":{"description":"Requested location not found."},"409":{"description":"Conflict resource already exists."}}}},"/order/{id}":{"get":{"parameters":[{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"integer"}}],"summary":"Get a order.","description":"Returns a single order record based on its unique ID.","responses":{"200":{"description":"Order retreived successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"customerid":{"type":"integer"},"orderdate":{"type":"string"}}}}}},"400":{"description":"Invalid order ID request."},"404":{"description":"Order ID not found."}}}},"/orders/{id}":{"patch":{"parameters":[{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"integer"}}],"summary":"Update a order.","description":"Updates a single order record based on its unique ID.","responses":{"200":{"description":"Order updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"customerid":{"type":"integer"},"orderdate":{"type":"string"}}}}}},"204":{"description":"No order exists at this location."},"404":{"description":"Order cannot be found or invalid customer ID."}}},"delete":{"parameters":[{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"integer"}}],"summary":"Delete a order.","description":"Deletes a single order record based on its unique ID.","responses":{"200":{"description":"Order deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"orderid":{"type":"integer"},"customerid":{"type":"integer"},"orderdate":{"type":"string"}}}}}},"204":{"description":"This order does not exist."},"404":{"description":"Order cannot be found or invalid order ID."}}}},"/orderdetails":{"get":{"summary":"Get all orderdetails.","description":"Returns a list of all orderdetails.","responses":{"200":{"description":"Returned all orderdetails OK.","content":{"application/json":{"schema":{"type":"object","properties":{"orderid":{"type":"integer"},"productid":{"type":"integer"},"quantity":{"type":"integer"}}}}}},"400":{"description":"Invalid request for orderdetails."},"404":{"description":"Orderdetails not found using your request."}}},"post":{"summary":"Create new Orderdetail.","description":"Creates a new Orderdetail and enters record into database.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"orderid":{"type":"integer"},"productid":{"type":"integer"},"quantity":{"type":"integer"}}}}}},"responses":{"201":{"description":"New Orderdetail created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"customerid":{"type":"integer"},"orderdate":{"type":"string"}}}}}},"404":{"description":"Requested location not found."},"409":{"description":"Conflict resource already exists."}}}},"/orderdetail/{id}":{"get":{"parameters":[{"name":"id","in":"path","required":true,"description":"Orderdetail ID","schema":{"type":"integer"}}],"summary":"Get a orderdetail.","description":"Returns a single orderdetails record based on its unique ID.","responses":{"200":{"description":"Orderdetail retreived successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"orderid":{"type":"integer"},"productid":{"type":"integer"},"quantity":{"type":"integer"}}}}}},"400":{"description":"Invalid orderdetail ID request."},"404":{"description":"Orderdetail ID not found."}}}},"/orderdetails/{id}":{"patch":{"parameters":[{"name":"id","in":"path","required":true,"description":"Orderdetails ID","schema":{"type":"integer"}}],"summary":"Update a orderdetail.","description":"Updates a single orderdetail record based on its unique ID.","responses":{"200":{"description":"Orderdetail updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"orderid":{"type":"integer"},"productid":{"type":"integer"},"quantity":{"type":"integer"}}}}}},"204":{"description":"No order exists at this location."},"404":{"description":"Orderdetail cannot be found or invalid customer ID."}}},"delete":{"parameters":[{"name":"id","in":"path","required":true,"description":"Orderdetail ID","schema":{"type":"integer"}}],"summary":"Delete a orderdetail.","description":"Deletes a single orderdetail record based on its unique ID.","responses":{"200":{"description":"Orderdetail deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"orderdetailid":{"type":"integer"},"orderid":{"type":"integer"},"productid":{"type":"integer"},"quantity":{"type":"integer"}}}}}},"204":{"description":"This orderdetail does not exist."},"404":{"description":"Orderdetail cannot be found or invalid orderdetail ID."}}}},"/blogs":{"get":{"summary":"Get all blog articles.","description":"Returns a list of all blog articles.","responses":{"200":{"description":"Returned all blog articles OK.","content":{"application/json":{"schema":{"type":"object","properties":{"blogtitle":{"type":"string"},"blogcontent":{"type":"string"}}}}}},"400":{"description":"Invalid request for blogs."},"404":{"description":"Blogs not found using your request."}}},"post":{"summary":"Create new blog article.","description":"Creates a new blog article and enters record into database.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"blogtitle":{"type":"string"},"blogcontent":{"type":"string"}}}}}},"responses":{"201":{"description":"New blog article created successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"blogtitle":{"type":"string"},"blogcontent":{"type":"string"}}}}}},"404":{"description":"Requested location not found."},"409":{"description":"Conflict resource already exists."}}}},"/blog/{id}":{"get":{"parameters":[{"name":"id","in":"path","required":true,"description":"Blog article ID","schema":{"type":"integer"}}],"summary":"Get a blog article.","description":"Returns a single blog article record based on its unique ID.","responses":{"200":{"description":"blog article retreived successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"blogtitle":{"type":"string"},"blogcontent":{"type":"string"}}}}}},"400":{"description":"Invalid blog article ID request."},"404":{"description":"Blog article ID not found."}}}},"/blogs/{id}":{"patch":{"parameters":[{"name":"id","in":"path","required":true,"description":"Blog article ID","schema":{"type":"integer"}}],"summary":"Update a blog article.","description":"Updates a single blog article record based on its unique ID.","responses":{"200":{"description":"Blog article updated successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"blogtitle":{"type":"string"},"blogcontent":{"type":"string"}}}}}},"204":{"description":"No blog article exists at this location."},"404":{"description":"Blog article cannot be found or invalid blog article ID."}}},"delete":{"parameters":[{"name":"id","in":"path","required":true,"description":"Blog article ID","schema":{"type":"integer"}}],"summary":"Delete a blog article.","description":"Deletes a single blog article record based on its unique ID.","responses":{"200":{"description":"Blog article deleted successfully.","content":{"application/json":{"schema":{"type":"object","properties":{"blogid":{"type":"integer"},"blogtitle":{"type":"string"},"blogcontent":{"type":"string"}}}}}},"204":{"description":"This blog article does not exist."},"404":{"description":"Blog article cannot be found or invalid customer ID."}}}}}}