Adding a single item through Zoho Books API returns {"code":4,"message":"Invalid value passed for bulk_update"}
Hello,
I need to update an invoice with hidden items (rate = 0) in order to have the inventory updated accordingly, as well as monitoring the full project's economical efficiency.
To do so, I am passing the Zoho CRM customer ID, Project Name, Article ID and name to a function. From there I can find the latest invoice linked to our customer and project.
I then try to update the invoice by adding a single line item with quantity = 1 and rate = 0 but get a code = 4 response :(
Here is the part where I try to update the invoice:
- if(found_invoice = true)
- {
- //Found invoice: add item on invoice.
- //1. get access_token to use api
- access_token = thisapp.getAccessTokenFromRefreshToken();
- authorization_string = "Zoho-oauthtoken " + access_token;
- //2. List invoices from customer:
- parameters_data = {"customer_id":customer_id,"invoice_number":invoice_number,"line_items":[{"item_id":article_id,"name":article,"description":article,"quantity":"1.00","rate":0}]};
- headers_data = Map();
- headers_data.put("Authorization",authorization_string);
- response = invokeurl
- [
- url :"https://www.zohoapis.eu/books/v3/invoices?organization_id=XXXXXXXXXXX"
- type :PUT
- parameters:parameters_data.toString()
- headers:headers_data
- connection:<connection>
- content-type:"application/json"
- ];
- info response;
- }
Many thanks in advance for your help :).
Kind regards,
Guillaume