This API is responsible for processing new orders within T-Gate's system.
Order Constraints
It's crucial to learn about all ordering constraint and validations that T-Gate considers while creating an order.
For more details on order constraints and prerequisites, please refer to the Partner API → Create Orders Constraints Guides. This guide covers essential information that partners need to be aware of to successfully create orders, including validation rules, required fields, and other important considerations.
Order total price calculation
Calculating the total price of an order can be done manually using the formula provided in the General → Order Calculation Formula Guides.
Another approach is to use the Calculate order total price API to get the precise total price of your order.
Order total priceIt is crucial that the total price sent in the order creation request matches the total price returned by Calculate order total price API, with at 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
Order Creation Success
If all order constraints are met, the API will respond with a 201, created status and the order object that contains the default estimated time. However, This only means that the order has been sent to the waiter app of the company and in the pending acceptance status (not yet started and the company has the right to reject the order), you should listen to the Order Webhook and use the Show Order API to get updates on the status of your orders..