question

Jai avatar image
Jai asked Jai commented

Remove tax from lineItem

Is there any way to delete tax from a LineItem ?

as per documentation I have tried,

lineItem.clearTaxes();

after that if I call

orderConnector.UpdateLineItems()

I am getting client exception as no valid line item was found. And if I call

orderConnector.updateOrder()

getting server error : "Cannot update the fields".

OrdersTaxes
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Mark Mullan avatar image
Mark Mullan Deactivated answered Jai commented

[EDIT] Discussed privately with this dev through dev@clover.com. We don't support tax rate modification at the lineItem level when working with lineItems that are instantiated from a merchant's Inventory. That being said, if the merchant does not care about reporting, inventory management, etc., one potential workflow is:

  • Use the orderConnector to get the Order.
  • For the lineItem that you want to remove taxes for, store that LineItem object locally, so we can make a copy of it later.
  • Use the orderConnector to remove that particular LineItem from the Order.
  • Instantiate a new LineItem from the old one, and clearTaxRates() on it.
  • Call orderConnector.addCustomLineItem() to add back the revised line item which now doesn't have any taxes.

The downside is that now this lineItem will no longer be associated with an Inventory item. Its stockCount will not decrement, Clover Reporting will not work on it, etc.

1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jai avatar image Jai commented ·

Hi Mark,

Thank you for your valuable response

0 Likes 0 ·

Welcome to the
Clover Developer Community