/connect
: In case a cookie is passed then the session is updated then user's shopping cart is retrieved. If no cookie were provided, a new session and basket is created then the new basket is sent.
{ "items": [string, ] }
/basket
: Retrieves the user's shopping cart.
{ "items": [string, ] }
/basket
: Updates the user's cart then retrieve the updated basket. Request's body:
{ "items": {item_id: int, } }Response's body:
{ "items": {item_id: int, } }
/item?id=<item_id#1>[, <item_id#2>, ...]
: Retrieves all attributes from item_id, all item ids should be separated by a comma. If no attribute exists, the list of all item ids available in the shop is sent.
{ "item_id": string, "image": string, "display_name": string, "description": string, "price": decimal }
In case no id is provided, you'll get the list of item ids to be queried from this route
[ { "item_id": <item_id#1>, }, { "item_id": <item_id#2>, }, ... ]
/order
: Retrieves the user's previous orders. If no orders are found an empty json object is returned.
{ "command_id": string, "item_count": integer, "items": [string, ], "address": string, "postal_code": string, "country": string, "name": string, "first_name": string, "mail": string, "phone": string, "processed": bool }
/order
: Adds a new order to the orders table then returns the status of the query: 200 if successful, 500 otherwise. Only one order can be posted at a time.
/order?id=<item_id>
: Removes an order from the table then returns the status of the query: 200 if successful, 500 otherwise.
In case a request cannot be completed or fails the response will update the status accordingly to the error type and contain an error message under a json format:
{ "error": "Error description" }