The format of line items is a little more difficult. Again, look at the Zoho Books API Doc.
You must add the Item ID, the Quantity, and the rate. Here, we are hard-coding all these except for the rate, where we put in our variable “dealAmount”.
You could increase the complexity, but also the elegance, of the function by creating more conditional rules for which items to call up and add, how many, etc. These could come from the Deals record in the CRM or somewhere else.
For now though, we keep only hard-code some values and simply show how the code works.