I use the calculateOrder API to calculate the amount to charge the credit card, and then use that sum for create order
I got a weird case where the calculated totals do not match
One item had no taxes and another had 13%.
The calculate order returned correct amount, submit order and weebly applied taxes to both items.
example:
This is the result from calculate order → $12.23
Weebly and create order expect → $12.66 (I guess it also applied 13% to the first item (why?) )
Since I send "autoApplyTaxes": true
, shouldn’t calculate order return the same amount as the others?
2022-06-28T11:03:44.575Z 09043249-ff35-4c42-b7bc-7c4f1ec32b94 INFO 2022-06-28 11:03:44,575 DEBUG [service] Calculated square order is: {
"order": {
"locationId": "L83WZEPK92V0X",
"referenceId": "916e9314-0b20-4435-8bd1-6450ea42e9e8",
"source": {
"name": "XXX"
},
"customerId": "XXX",
"lineItems": [
{
"uid": "916e9314-0b20-4435-8bd1-0",
"name": "XXX",
"quantity": "1",
"catalogObjectId": "AFENX4S2NFVFCZ7I6DNO7SHJ",
"catalogVersion": 1656382969533,
"variationName": "16oz",
"itemType": "ITEM",
"modifiers": [
{
"uid": "qZuch7mOrhLnb67yvgJnO",
"catalogObjectId": "ANVKNJMTOG7KV4IPJ3MHUV52",
"catalogVersion": 1656382969533,
"name": "No Creamer (Black)",
"quantity": "1",
"basePriceMoney": {
"amount": 0,
"currency": "CAD"
},
"totalPriceMoney": {
"amount": 0,
"currency": "CAD"
}
},
{
"uid": "wpryT68kXq7gexVDXrDOUB",
"catalogObjectId": "QNPQLRBV7QP2P4DQ4JAMJ27Z",
"catalogVersion": 1656382969533,
"name": "No Sugar",
"quantity": "1",
"basePriceMoney": {
"amount": 0,
"currency": "CAD"
},
"totalPriceMoney": {
"amount": 0,
"currency": "CAD"
}
},
{
"uid": "woslV6QhV6sOa2v50dGpmB",
"catalogObjectId": "OYPS2536SJE54XRHYEMGKUYF",
"catalogVersion": 1656382969533,
"name": "None",
"quantity": "1",
"basePriceMoney": {
"amount": 0,
"currency": "CAD"
},
"totalPriceMoney": {
"amount": 0,
"currency": "CAD"
}
}
],
"basePriceMoney": {
"amount": 325,
"currency": "CAD"
},
"variationTotalPriceMoney": {
"amount": 325,
"currency": "CAD"
},
"grossSalesMoney": {
"amount": 325,
"currency": "CAD"
},
"totalTaxMoney": {
"amount": 0,
"currency": "CAD"
},
"totalDiscountMoney": {
"amount": 0,
"currency": "CAD"
},
"totalMoney": {
"amount": 325,
"currency": "CAD"
}
},
{
"uid": "916e9314-0b20-4435-8bd1-1",
"name": "XXX Sandwich",
"quantity": "1",
"catalogObjectId": "DBTSHQ7NUKIDSIPOSJIW7E6T",
"catalogVersion": 1656382969533,
"variationName": "Regular",
"itemType": "ITEM",
"appliedTaxes": [
{
"uid": "qT8D2Ta5ohTBEil7pO7Ky",
"taxUid": "TXGHnFvpcjYM7EExZdRalB",
"appliedMoney": {
"amount": 103,
"currency": "CAD"
}
}
],
"basePriceMoney": {
"amount": 795,
"currency": "CAD"
},
"variationTotalPriceMoney": {
"amount": 795,
"currency": "CAD"
},
"grossSalesMoney": {
"amount": 795,
"currency": "CAD"
},
"totalTaxMoney": {
"amount": 103,
"currency": "CAD"
},
"totalDiscountMoney": {
"amount": 0,
"currency": "CAD"
},
"totalMoney": {
"amount": 898,
"currency": "CAD"
}
}
],
"taxes": [
{
"uid": "TXGHnFvpcjYM7EExZdRalB",
"catalogObjectId": "A6AOVPBRCXMQQQWIARNSNTU2",
"catalogVersion": 1592824635652,
"name": "HST",
"type": "ADDITIVE",
"percentage": "13.0",
"appliedMoney": {
"amount": 103,
"currency": "CAD"
},
"scope": "LINE_ITEM",
"autoApplied": true
}
],
"netAmounts": {
"totalMoney": {
"amount": 1223,
"currency": "CAD"
},
"taxMoney": {
"amount": 103,
"currency": "CAD"
},
"discountMoney": {
"amount": 0,
"currency": "CAD"
},
"tipMoney": {
"amount": 0,
"currency": "CAD"
},
"serviceChargeMoney": {
"amount": 0,
"currency": "CAD"
}
},
"createdAt": "2022-06-28T11:03:44.131Z",
"updatedAt": "2022-06-28T11:03:44.131Z",
"state": "OPEN",
"version": 1,
"totalMoney": {
"amount": 1223,
"currency": "CAD"
},
"totalTaxMoney": {
"amount": 103,
"currency": "CAD"
},
"totalDiscountMoney": {
"amount": 0,
"currency": "CAD"
},
"totalTipMoney": {
"amount": 0,
"currency": "CAD"
},
"totalServiceChargeMoney": {
"amount": 0,
"currency": "CAD"
},
"pricingOptions": {
"autoApplyDiscounts": true,
"autoApplyTaxes": true
}
}
}