Adding a single item through Zoho Books API returns {"code":4,"message":"Invalid value passed for bulk_update"}

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:

  1. if(found_invoice = true)
  2.     {
  3.         //Found invoice: add item on invoice.
  4.         //1. get access_token to use api
  5.         access_token = thisapp.getAccessTokenFromRefreshToken();
  6.         authorization_string = "Zoho-oauthtoken " + access_token;
  7.         //2. List invoices from customer:
  8.         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}]};
  9.         headers_data = Map();
  10.         headers_data.put("Authorization",authorization_string);
  11.         response = invokeurl
  12.         [
  13.             url :"https://www.zohoapis.eu/books/v3/invoices?organization_id=XXXXXXXXXXX"
  14.             type :PUT
  15.             parameters:parameters_data.toString()
  16.             headers:headers_data
  17.             connection:<connection>
  18.             content-type:"application/json"
  19.         ];
  20.         info response;
  21.     }

Many thanks in advance for your help :).

Kind regards,
Guillaume

    Zoho Desk Resources

    • Desk Community Learning Series


    • Digest


    • Functions


    • Meetups


    • Kbase


    • Resources


    • Glossary


    • Desk Marketplace


    • MVP Corner


    • Word of the Day


      Zoho CRM Plus Resources

        Zoho Books Resources


          Zoho Subscriptions Resources

            Zoho Projects Resources


              Zoho Sprints Resources


                Zoho Orchestly Resources


                  Zoho Creator Resources


                    Zoho WorkDrive Resources



                      Zoho Campaigns Resources

                        Zoho CRM Resources

                        • CRM Community Learning Series

                          CRM Community Learning Series


                        • Tips

                          Tips

                        • Functions

                          Functions

                        • Meetups

                          Meetups

                        • Kbase

                          Kbase

                        • Resources

                          Resources

                        • Digest

                          Digest

                        • CRM Marketplace

                          CRM Marketplace

                        • MVP Corner

                          MVP Corner




                          Zoho Writer Writer

                          Get Started. Write Away!

                          Writer is a powerful online word processor, designed for collaborative work.

                            Zoho CRM コンテンツ




                              ご検討中の方