Apply Vendor Credits On Bill Zoho Books

Apply Vendor Credits On Bill Zoho Books

Hello Team,

Several developers are encountering difficulties when applying credits to bills.

If you refer to the Zoho Books API documentation, there is a body error, and the data we need to pass is not very clear. In this article, I am providing the correct body parameters and addressing the errors that align with the Zoho Books' actual document.

Error:- {"code":1038,"message":"JSON is not well formed"}

Sample Code

  1. datalist = List();
  2. param= Map();
  3. param.put("bill_id", "2755065000013265055");
  4. param.put("amount_applied", 100);
  5. datalist.add(param);
  6. finalmap = Map();
  7. finalmap.put("bills", datalist);
  8. creditid = "2755065000013265107";
  9. response = invokeUrl
  10. [
  11. url: "https://www.zohoapis.com/books/v3/vendorcredits/"+creditid +"/bills?organization_id="+organizationID
  12. type: POST
  13. content-type: "application/json"
  14. parameters: finalmap.toString()
  15. connection: "zohobooks"
  16. ];
  17. info response;
We have to pass the data in the final as a list but in the document, this is showing in the Map, that is the error that we have encountered.

@Anonymous User @Anonymous User  please look into this and correct the document.

Thanks & Regards
Piyush Goyal
Zoho Developer || Zoho CRM and Creator Certified
+91-8619164837