This API is responsible for determining the total price of an order. It processes the entire item hierarchy, including any modifiers and customizations, to return the accurate total cost of the order. This ensures that all pricing rules and calculations are consistently applied.
Order total price calculationThis API uses the same calculation formula described in the General → Order Calculation Formula Guides. Our partners can use this API or they can calculate the total price by themselves. However, It is crucial that the total price sent in the order creation request matches the total price returned by this API, with a precision of two decimal places.
Items
After specifying the brand, branch and menu from which the order is taking place, an attribute items is used to select all the products of your order with their children hierarchy of modifier groups and modifiers.
the Item object should follow the following format:
Attribute name | Description | Type |
---|---|---|
quantity | specifies the quantity of a given item, this attribute can be neglected in the case of selecting a modifier_group as it's always considered to be 1 in that case however, it's mandatory for all other item types. | Integer or NULL |
item_id | the id of the item to be selected | Integer |
children | JSON Array that represents all the children to be selected under this item, the children object should follow the same attribute format of the items object having a quantity, item_id and children attributes | Object Array |
childrenIt is crucial that all items objects follow the exact same format and having all 3 attributes.
the last level of items that has no children should have an attribute of children that is an empty array.
modifier_groupsthe quantity of a modifier_group is always 1 and the children items of that modifier group should follow the min, max and max_num_of_same_item specified by that modifier_group