How to create a new package in Zoho inventory using deluge?

How to create a new package in Zoho inventory using deluge?

I'm attempting to create a new package in Zoho Creator through deluge by calling the Zoho inventory API. Here's what my code looks like. 

  1. packageMap = Map();
  2. packageMap.put("package_number","PA-00004");
  3. packageMap.put("date","02/25/2022");
  4. lineItemList = List();
  5. for each  item in lineItems
  6. {
  7. itemId = item.getJson("line_item_id");
  8. lineItemMap = Map();
  9. lineItemMap.put("so_line_item_id",itemId);
  10. lineItemMap.put("quantity",1);
  11. lineItemList.add(lineItemMap);
  12. }
  13. packageMap.put("line_items",lineItemList);
  14. newPackage = invokeurl
  15. [
  16. url :"https://inventory.zoho.com/api/v1/packages?salesorder_id=2839102000008709273&organization_id=918273645"
  17. type :POST
  18. parameters:packageMap
  19. connection:"packages_oauth"
  20. ];
Whenever I run this code, I keep getting the same error. 

  1. {"code":4,"message":"Invalid value passed for JSONString"}
Does anyone know why I keep getting this error?