When I try to add taxrate to lineitem and add that lineitem to order the following error occured :
com.clover.sdk.v1.ClientException: cannot update one or more of these fields: LineItem{json='{"taxRates":{"elements":[{"id":"SVhhhyStrq","isDefault":true,"name":"Service Tax","rate":5}]},"id":"GC8H6QN3MHPSJ","price":3799}', bundle=null, changeLog=null} at com.clover.sdk.v1.ServiceConnector.throwOnFailure(ServiceConnector.java:280) at com.clover.sdk.v1.ServiceConnector.execute(ServiceConnector.java:213) at com.clover.sdk.v3.order.OrderConnector.addCustomLineItem(OrderConnector.java:252) at com.SocketService$CreateOrdedrClover.run(SocketService.java:1465)
The executed code was like :
TaxRate taxRate = new TaxRate();
taxRate.setId(id);
taxRate.setRate(rate);
taxRate.setName("Service Tax");
taxRate.setIsDefault(true);
List<TaxRate> taxRates = new ArrayList<TaxRate>();
taxRates.add(taxRate);
currentLineItem.setTaxRates(taxRates);
orderConnector.addCustomLineItem(order.getId(),currentLineItem,true);
Please help me to solve this issue. can i add taxrate to each line item ? Can i add taxamount for an order?