Order Calculation Formula
The total order price is calculated from the bottom to the top of the order structure. Each item in the order considers the price of all its children plus its own price, multiplied by the quantity needed.
Key Attributes for Price Calculation
basic_price_per_unit
: The base price of a single unit without any additional charges.total_basic_price_per_unit
: The price of a single unit plus the total price of all its children.total_price
: The product oftotal_basic_price_per_unit
and thequantity
.
TaxesT-Gate does not add any taxes or extras to the calculated price, so the final total order price is equal to the
total_price
.
Example Calculation
Consider an order for a Meat Lovers Pizza:
-
Meat Lovers Pizza (Product): (2 * 120)
-
Extra Sauces (Modifier Group) (1 * 0)
- BBQ Sauce(1 * 7)
- Garlic (1 * 10)
- Ranch (1 * 7)
- Ketchup (1 * 5)
-
Extra Toppings (Modifier Group) (1 * 0)
- Beef Bacon (1 * 25)
-
Calculation Breakdown
- Modifiers: Modifiers do not have children, so their
total_basic_price_per_unit
is equal to theirbasic_price_per_unit
.- Ketchup: 5
- BBQ Sauce: 7
- Garlic: 10
- Ranch: 7
- Modifier Groups: The total price of a modifier group is the sum of all its children's
total_basic_price_per_unit
multiplied by the quantity.- Extra Sauces: (0 + 5*1 + 7*1 + 10*1 + 7*1)*1 = 29
- Extra Toppings: (0 + 25*1)*1 = 25
- Products: The
total_basic_price_per_unit
for a product is the sum of its own price plus the total of all its children's prices.- Meat Lovers Pizza: (120 + 29*1 + 25*1) = 174
- Total Price Calculation: The total price of the order is the sum of all product
total_basic_price_per_unit
multiplied by the quantity.- Total Price: 174*2 = 348
The complete formula is as follows:
(120 + (0 + (10 * 1 + 5 * 1 + 7 * 1 + 7 * 1)) * 1 + (0 + (25 * 1)) * 1) * 2 = 348
Order Total PriceFor an order to be successfully created, it is mandatory that the
total_price
sent by partner applications in the order creation request matches the value obtained from the Partner API → Calculate Order Total Price API with two decimal points of precision.
Updated 7 months ago