Inserting invoice to Zoho CRM via Zoho Creator methods

Inserting invoice to Zoho CRM via Zoho Creator methods

Hi guys,
I can't find any documentation on adding product details to an invoice via Zoho Creator. Here's what I've tried so far based on this forum post for the XML API. In that post, it seemed that you needed to nest <productDetails> within the invoice payload. That doesn't seem to work for Zoho Creator. 

Am trying to import invoice data from InfusionSoft and this is the stumbling block.

  1. void add_invoice_to_CRM(Invoice_Forecast_from_InfusionSoft forecast)
  2. {
  3.     //create the CRM vs Creator fields map to push data to the CRM module.
  4.     invoice_map = map();
  5.     //add values to the map. CRM fields first and then Creator fields ( without the quotes ). Creator field’s deluge name is used here. 
  6.     invoice_map = map();
  7.     invoice_map.put("Due Date", forecast.Invoice_Date);
  8.     invoice_map.put("Subject", forecast.Renewal_Type + " Invoice for " + forecast.Account_Name);
  9.     invoice_map.put(("Account Name"), forecast.Account_Name);
  10.     //add product to invoice
  11.     product_map = map();
  12.     product_map.put("Product Name", forecast.Product_Description);
  13.     product_map.put("Quantity", 1);
  14.     product_map.put("Unit Price", forecast.Invoice_Amount);
  15.     product_map.put("Unit Price", forecast.Invoice_Amount);
  16.     product_details_map = map();
  17.     product_details_map.put("product", product_map);
  18.     invoice_map.put("Product Details", product_map);
  19.     //function to push data to CRM 
  20.     response = zoho.crm.create("Invoices", invoice_map);
  21.     forecast.CRM_response = response.toString();
  22. }