Hi Guys,
I’m encountering a weird tax calculation issue which I can’t understand when I’m using the Create Orders API call.
I have define the following tax in my order (response),
"taxes": [
{
"uid": "6DAIYJD4V67I3KOQRL7A3AF6",
"catalog_object_id": "6DAIYJD4V67I3KOQRL7A3AF6",
"name": "State Tax",
"type": "ADDITIVE",
"percentage": "6.25",
"metadata": null,
"applied_money": {
"amount": 62,
"currency": "USD"
},
"scope": "LINE_ITEM"
}
],
And given below is how the above tax is calculated to line item one time where I pass two line items.
"line_items": [
{
"quantity": "1",
"uid": "urTG6vs4NkhxrfAjyp8KLD",
"name": "Bagels",
"quantity_unit": null,
"note": "",
"catalog_object_id": "**RFXMJ5IA3LM476CAFXYEDTCO**",
"variation_name": "Regular",
"metadata": null,
"modifiers": [...],
"applied_taxes": [
{
"tax_uid": "6DAIYJD4V67I3KOQRL7A3AF6",
"uid": "rwIjb9RsH7tmkXKN5hf4JB",
"applied_money": {
"amount": 16,
"currency": "USD"
}
}
],
"applied_discounts": null,
"base_price_money": {
"amount": 250,
"currency": "USD"
},
"variation_total_price_money": {...},
"gross_sales_money": {...},
"total_tax_money": {
"amount": 16,
"currency": "USD"
},
"total_discount_money": {...},
"total_money": {...}
},
{
"quantity": "3",
"uid": "CSlnySxdHstYZkFGzjL7ID",
"name": "Bagels",
"quantity_unit": null,
"note": "",
"catalog_object_id": "**RFXMJ5IA3LM476CAFXYEDTCO**",
"variation_name": "Regular",
"metadata": null,
"modifiers": [...],
"applied_taxes": [
{
"tax_uid": "6DAIYJD4V67I3KOQRL7A3AF6",
"uid": "equ0K4VYxX5TyNw6qzWQNC",
"applied_money": {
"amount": 46,
"currency": "USD"
}
}
],
"applied_discounts": null,
"base_price_money": {
"amount": 250,
"currency": "USD"
},
"variation_total_price_money": {...},
"gross_sales_money": {...},
"total_tax_money": {
"amount": 46,
"currency": "USD"
},
"total_discount_money": {...},
"total_money": {...}
}
],
Look carefully for the applied tax amount for each line item. I’m passing the same catalog item with different quantities (1 with a free modifier and 3 with another free modifier).
Now given below is another scenario where I pass same catalog object like above with another different quantity (2) including the above two quantities. So altogether I’m passing 3 line items with 3 different quantities. The only difference is each of them have unique modifier. They don’t have discounts also.
"line_items": [
{
"quantity": "1",
"uid": "UQCYNoI25TQ8aj0uVFt8s",
"name": "Bagels",
"quantity_unit": null,
"note": "",
"catalog_object_id": "**RFXMJ5IA3LM476CAFXYEDTCO**",
"variation_name": "Regular",
"metadata": null,
"modifiers": [...],
"applied_taxes": [
{
"tax_uid": "6DAIYJD4V67I3KOQRL7A3AF6",
"uid": "5c6FIdshNN3l0JOCPh6OwC",
"applied_money": {
"amount": 16,
"currency": "USD"
}
}
],
"applied_discounts": null,
"base_price_money": {
"amount": 250,
"currency": "USD"
},
"variation_total_price_money": {...},
"gross_sales_money": {...},
"total_tax_money": {
"amount": 16,
"currency": "USD"
},
"total_discount_money": {...},
"total_money": {...}
},
{
"quantity": "2",
"uid": "ZFybcPBulZkN3yegtFkKWC",
"name": "Bagels",
"quantity_unit": null,
"note": "",
"catalog_object_id": "**RFXMJ5IA3LM476CAFXYEDTCO**",
"variation_name": "Regular",
"metadata": null,
"modifiers": [...],
"applied_taxes": [
{
"tax_uid": "6DAIYJD4V67I3KOQRL7A3AF6",
"uid": "AJB6EjBvISliFmx9rs9RX",
"applied_money": {
"amount": 31,
"currency": "USD"
}
}
],
"applied_discounts": null,
"base_price_money": {
"amount": 250,
"currency": "USD"
},
"variation_total_price_money": {...},
"gross_sales_money": {...},
"total_tax_money": {
"amount": 31,
"currency": "USD"
},
"total_discount_money": {...},
"total_money": {..}
},
{
"quantity": "3",
"uid": "r4OWcyUxCmt42aS64iBCGB",
"name": "Bagels",
"quantity_unit": null,
"note": "",
"catalog_object_id": "RFXMJ5IA3LM476CAFXYEDTCO",
"variation_name": "Regular",
"metadata": null,
"modifiers": [...],
"applied_taxes": [
{
"tax_uid": "6DAIYJD4V67I3KOQRL7A3AF6",
"uid": "myfiBDHTGOgUs6E7SGHGa",
"applied_money": {
"amount": 47,
"currency": "USD"
}
}
],
"applied_discounts": null,
"base_price_money": {
"amount": 250,
"currency": "USD"
},
"variation_total_price_money": {...},
"gross_sales_money": {...},
"total_tax_money": {
"amount": 47,
"currency": "USD"
},
"total_discount_money": {...},
"total_money": {...}
}
],
In the line items where I pass the quantity as 3 in above two cases see how the applied tax amount change? The only difference between the two orders are I pass a extra line item with another unique modifier. But for the same line item, tax gets applied in different manner.
Given below is the overall taxes response for second case
"taxes": [
{
"uid": "6DAIYJD4V67I3KOQRL7A3AF6",
"catalog_object_id": "6DAIYJD4V67I3KOQRL7A3AF6",
"name": "State Tax",
"type": "ADDITIVE",
"percentage": "6.25",
"metadata": null,
"applied_money": {
"amount": 94,
"currency": "USD"
},
"scope": "LINE_ITEM"
}
],