Hi. We want to add a flat delivery charge for an order over the REST API. We did the following suggestions to support this:
However, now we face a different issue. In the scenario where order level amount discount is present, this discount gets divided across all line items which now include the delivery charge line item as well. This in turn causes the tax calculation of the line items with applicable taxes to change since tax is applied on the item price after discounts.
For example, let's say we have 4 line items with taxes and a delivery charge which we also add as a line item. Also lets say we have an amount discount as $20. A correct calculation will allocate the discount across the 4 items and charge tax on the price after discount for each of them.
However, by adding delivery charge as a line item, the same discount amount is now allocated across 5 items, resulting in lower discount allocation per item leading to higher item price after discount resulting in higher tax charged (even though the delivery charge line item has no assigned taxes).
The real problem occurs when we use the values calculated in the former scenario in a clover e-commerce payment. Even though we charge the proper total, the order shows up as partially paid since clover internally recalculates and arrives at some totals that reflect the latter scenario. We could make the same calculation error in our side so that the values match, but this would mean we are charging a wrong tax amount from our customers.
Is there a way to create a line item over the REST API with a price that should be discount excluded and tax excluded?
Or is there a better way to add a flat charge for an order so we can call it a delivery charge? (other than service charge. We already use that to capture service charges)
The following response https://community.clover.com/questions/14159/custom-line-items-for-delivery-charge.html on 2018 says that this is not possible and I would like to know if any developments have been done in this area to support this scenario since then.