How to Create / Update a Basket
This API lets you create and manage baskets by defining the order type and adding menu items. Baskets can be updated with customer details, items, discounts, or fulfillment before checkout.
The storeId needs to be retrieved before basket creation. Similarly, menuId needs to be provided in order to add items to the basket; see this guide here for more information.
Order Types
Types of orders to be included inside on the fulfilllment object.
| OrderType | Description |
|---|---|
| pickup | takeaway orders |
| delivery | delivery handled by the ordering platform |
| eatIn | dine in orders |
| dispatch | delivery handled by a dispatch system connected via Deliverect. A call to the validation endpoint will be needed to confirm availability form the dispatch provider before basket checkout. |
The minimum required structure when creating a basket should includestoreIdand fulfillment.type.
{
"storeId": "668f7fbc4144aa9d78c8dd5e",
"fulfillment": {
"type": "delivery"}
}Adding items to the basket
The unique identifier for each item is the plu ; the PLUs are retrieved via GET Menus endpoint.
On the example below, the item ordered would be a Burger with Tomatos as modifer. At subItem level, the "customizationPlu" refers to the PLU of the modifier group.
"items": [
{
"menuId": "668f7ff64dc853e9c96a4877",
"plu": "BURGER",
"quantity": 1,
"note": "extra salt please"
,
"subItems": [
{
"plu": "TOMAT",
"customizationPlu": "INGRD",
"quantity": 1
}
]
}
]
Anidwill be returned as response after making a POST Call to the Create basket endpoint. This id will be included later during the the checkout process asbasket.id(basket ids cannot be re-used)
Update basket
Certain information can be provided or updated after creating the basket via a patch request via the following endpoints:
- Update customer: allows providing customer details
- Update Items: allows adding, modifying or deleting existing items.
- Update Discounts: percentage , flat-off , free item, bogof.
- Update Fulfillment: allows updating fulfillment details such as delivery address
- Update Tips
Basket updates can only be provided before basket checkout.
Updated 5 days ago