All responses will have the form
{
"data": "Mixed type holding the content of the response",
"message": "Description of what happened"
}ROUTE
GET /orders
Response
200 OKon success.
{
"data":[{
id:
store_id:
total_price:
},
{line_items: [
id:
name:
unit_price:
quantity:
]
}
]
}
ROUTE
POST /add/store
Arguments
"id":intUnique identifier for this store."name":stringA name for this store."address":stringThe location of this store.
Response
201 Createdon success.
ROUTE
GET /store/<id>
Arguments
"id:intUnique identifier for this store.
Response
404 Not Foundif the store does not exist.200 OKon success.
{
"data": [ {"Store Information" }]
}ROUTE
GET /store/<id>/orders
RESPONSE
-404 Not found if the store id does not exist.
-200 Ok on success.
ROUTE
DELETE /store/<id>/delete/order/<order_id>
Arguments
"id:intUnique identifier for this store."order_id:intUnique identifier of an existing order.
RESPONSE
-404 Not found If the store or order id does not exist.
-204 No content on success.
ROUTE
DELETE /delete/store/<id>
Arguments
"id":intUnique identifier for this store.
Response
404 Not Foundif the store id does not exist.204 No Contenton success.
ROUTE
POST /store/<id>/add/product
Arguments
"id":intUnique identifier for this store."product_id":intUnique identifier for the product."product_name":stringName of the product."product_price":floatPrice of the product."quantity":intAmount.
Response
201 Content Createdif the product exists, the quantity will be updated. -404 Not foundIf the store id does not exist.
ROUTE
POST /store/<id>/buy/product
Arguments
"id":intUnique identifier for this store."product_id":intUnique identifier for this product."quantity":intAmount. -"order_id":intUnique identifier for the generated order.
Response
-204 No content If the quantity of the product is 0 or less than the quantity ordered by the user.
-404 Not found If the product or the order id does not exist.
-200 Ok On sucess. An order will be generated > /store/<id>/orders.
ROUTE
DELETE /store/<id>/delete/product/<product_id>
Arguments
"id":intUnique identifier for this store."product_id":intUnique identifier for the product.
Response
204 No contenton sucess. -404 Not foundIf the store id or the product id does not exist.