How can we update the Inline Tax in a Purchase Item using deluge?

How can we update the Inline Tax in a Purchase Item using deluge?

Dear All,

I am trying to update a Purchase Order using deluge. I can update all the fields except of the Line Tax.


I would like to put 0% on it using deluge.

I have tried the below but it does not work. What I have to change? Is the problem the field names in the Purchase_Item? I am not sure if the "line_tax" is the correct name. I have also tried as "Tax" but again it did not work

  1. productDet = ifnull(respMap.get("Product_Details"),"");
  2. pdlist = List();
  3. for each  eachProd in productDet
  4. {
  5. productvalue = eachProd.get("product");
  6. proid = productvalue.get("id");
  7. proname = productvalue.get("name");
  8. mp = Map();
  9. mp.put("product",{"name":proname,"id":proid});
  10. mp.put("quantity",ifnull(eachProd.get("quantity"),"0").toLong());
  11. lineTaxList = List();
  12.         lineTax = Map();
  13. lineTax.put("percentage",0.00);
  14. lineTax.put("name","VAT");
  15.         lineTaxList.add(lineTax);
  16. mp.put("line_tax", lineTaxList); // Add the updated line_tax list
  17. mp.put("Description","Test");
  18. pdlist.add(mp);
  19. }

  20. paramap = Map();
  21. paramap.put("Purchase_Items",pdlist);
  22. data = {"data":{paramap}};
  23. createResp = invokeurl
  24. [
  25. url :"https://www.zohoapis.eu/crm/v7/Purchase_Orders/"+POID
  26. type :PUT
  27. parameters:data.toString()
  28. connection:"crmconnectionnew"
  29. ];