I am trying to build a simple application in Zoho Creator where a person inputs the data of a sales order. This has to be translated into Zoho Books along with the integration of the manual orders sent via Zoho Books.
I have done every single step mentioned in this link: https://github.com/TheWorkflowAcademy/Zoho-Books-Custom-Connections
Plus whatever Zoho is telling here: https://help.zoho.com/portal/en/community/topic/integreat-03-integrating-zoho-creator-with-zoho-books
Here is my code:
listVar = List();
//iterating each row in the subform
for each line in Items_to_Order
{
mapVar = map();
mapVar.put("item_id", line.Item_ID);
mapVar.put("name", line.Item_Name);
mapVar.put("rate", line.Price);
mapVar.put("quantity", line.Quantity);
listVar.add(mapVar);
}
values = map();
values.put("customer_id", input.Sales_Order_ID);
values.put("line_items", listVar);
response = invokeurl
[
url : "https://books.zoho.com/api/v3/salesorders?organization_id=762389459"
type :POST
parameters:mapVar
connection:"zoho_books"
detailed:true
];
// To see all headers and content
info response;