Kaizen #9 - Handling Product Line Items in the Inventory Modules #API

Kaizen #9 - Handling Product Line Items in the Inventory Modules #API

Hello everyone!

Welcome back to another post in the Kaizen series!
This week, we will discuss handling product line items associated with the inventory modules—Quotes, Invoices, Purchase Orders, and Sales Orders.

What is a product line item?

On the Quote, Invoice, Purchase Order, Sales Order create or edit page, you add individual products in the Product Details section. This section also contains other details like the List Price, Quantity, Amount, Discount, and Tax. Every product and the corresponding details are called product line items.

In this post, we will discuss 
  1. Adding product line items while inserting a quote (through the Insert Records API)
  2. Updating a quote by adding another product line item (through the Update Specific Records API)

The JSON input is similar while adding/updating an invoice, purchase order, and sales order.

1. Adding Product Line Items to a Quote

While adding a product to a quote you can,
      a. Select a price book to associate with the product
      b. Specify a different list price for the product

1. a. Selecting a price book to associate with the product
To associate a price book with the product, you must pass the ID of that price book in the input.

What happens when you pass the Price Book's ID?
  • The discount on the product is automatically applied based on the range you specified in the price book.
  • The cumulative tax (specified for the product) is automatically calculated based on the amount (after the discount).
  • The List Price of the product specified in the associated price book is automatically taken for calculating the amount.

The sample input for Product_Details is as follows.

"Product_Details": [
    {
      "product": {
        "id": "3652397000000491147"
      },
      "quantity": 100,
      "product_description": "product_description",
      "book": "3652397000000616007"
    }
  ]

The following table gives information about each key in the Product_Details JSON Array.
Key
Data Type
Description
product
JSON Object
The ID of the product in the quote.
quantity
Number
The number of units of the product the quote is generated for. Accepts only positive integer values. The amount is calculated based on this number and the price for each unit.
book
String
The ID of the Price Book you have associated with the product.
product_description
String
Description of the product.

Here is a screenshot from the UI.


1.b. Specifying a different list price for the product
When the product does not have an associated price book or you want to give a different list price, you must specify the list price and the discount in the Product_Details array. 
Otherwise, the system enters the value for the discount as 0 and takes the list price you specified while creating that product.
The sample input for the Product_Details JSON array is as follows.
"Product_Details": [
    {
      "product": {
        "id": "3652397000000491147"
      },
      "quantity": 150,
      "product_description": "product_description",
      "Discount": 1000,
      "list_price": 1100,
      "line_tax": [
        {
          "percentage": 1,
          "name": "VAT"
        }
      ]
    }
  ]

The following table gives information about each key in the Product_Details JSON Array.

Key
Data Type
Description
Product
JSON Object
ID of the product the quote generated for.
quantity
Number
The number of units of the product the quote is generated for. Accepts only positive integer values.
Discount
Currency
The discount, in decimals, you want to apply for the product. Accepts up to 16 digits before the decimal, and up to 9 digits after the decimal. This limit may vary based on the value configured in 'Maximum digits allowed' in the properties pop-up of the field, in the UI.
product_description
String
Description of the product.
list_price
Currency
The list price of the product.
line_tax
JSON Array
Contains the percentage and the name of the tax associated with the product.
percentage
Percent
The percentage of tax applied on the product. Accepts only numeric values, up to 5 digits.
name
String
The name of the tax applied on the product.

As mentioned earlier, the Product Details section encompasses the taxes applied for each product and the aggregate tax applied to the Sub Total of the quote or any other inventory module.

You can specify the different taxes you want to apply for your products in the CRM UI.
You can add them under Setup > Customization > Modules and Fields > Products as shown in the below image.


You can use these configured values as inputs in the API.

Adding taxes to the product while creating/updating an inventory module
When you add a product to an inventory module, to apply the taxes to that product, you must specify the tax details in the line_tax JSON array inside Product_Details.

You must specify the percentage and the name of the tax associated with the product as JSON objects.
You cannot specify the amount as the system calculates it automatically based on the quantity.

Example:

"Product_Details": [
    {
      "product": {
        "id": "3652397000001363004"
      },
      "quantity": 100,
      "Discount": 20.1,
      "product_description": "product_description",
      "line_tax": [
        {
          "percentage": 10,
          "name": "Sales Tax"
        },
        {
          "percentage": 1,
          "name": "Vat"
        }
      ]
    }
  ]

Adding aggregate tax to the quote or other inventory modules
This is the tax that you want to apply to the Sub Total of the line items while generating the invoice, quote, sales order, or purchase order. The taxes you specify in the $line_tax key are added to the ones already applied to the product through the line_tax key.
The $line_tax key is present outside the Product_Details JSON array.

The structure for this JSON array is as follows.

"Product_Details": [
    {
      "product": {
        "id": "3652397000001363004"
      },
      "quantity": 100,
      "product_description": "product_description",
      "line_tax": [
        {
          "percentage": 10,
          "name": "Sales Tax"
        },
        {
          "percentage": 1,
          "name": "Vat"
        }
      ]
    }
  ],
  "$line_tax": [
    {
      "percentage": 1.5,
      "name": "Common Tax",
      "id": "3652397000001376005"
    }
  ]

Key
Data type
Description
$line_tax
JSON Array
Contains the name, ID, and the percentage of the tax you want to apply to the quote.
percentage
Percent
The percentage of tax applied on the quote. Accepts only numeric values, up to 5 digits.
name
String
The name of the tax.
id
String
The unique ID of the tax.

Note
Make a GET request to "{{api-domain}}/crm/v2/org/taxes" to obtain the IDs of all the taxes for your organization.

The below image shows the data corresponding to the line_tax and $line_tax keys in the UI for a quote.


Points to note
  • For Product_Details
    When you have associated a price book with an inventory module, and you include the key and value for Discount inside Product_Details, this discount value overrides the discount calculated from the price book.
  • For line_tax
    You must specify the percentage of tax in every JSON object inside the line_tax array.

2. Updating a Quote by adding Product Line Items
You can associate multiple products to a quote.
While updating a quote, you can add/update/remove a line item.
Let us consider an example where you have five line items in a quote, and you want to remove two line items, and add a new one.
In this case, you must
  • Pass the IDs of the line items you want to retain as individual JSON objects.
  • Add the new line item with the required details as a new JSON object.
  • Do not include any details about the line item you want to remove. When you do not specify the ID of any line item, the system deletes it automatically.
A sample JSON structure for the above scenario is as follows.         

"Product_Details": [
    {
      "id": "3652397000001377174"
    },
    {
      "id": "3652397000001378168"
    },
    {
      "id": "3652397000001379172"
    },
    {
      "product": {
        "id": "3652397000001351002"
      },
      "quantity": 100,
      "book": "3652397000000616007"
    }
  ] 

To obtain the ID of the existing line item, make a GET request to fetch the Quote you want to update. The response contains the ID of the existing line item in the Product_Details array.

Note
  • You can add a maximum of 200 line items to an inventory module.

We hope you found this post useful. Please reach out to us if you have any questions, or let us know in the comment section.

Cheers!











      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          • Sticky Posts

          • Kaizen #197: Frequently Asked Questions on GraphQL APIs

            🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
          • Kaizen #198: Using Client Script for Custom Validation in Blueprint

            Nearing 200th Kaizen Post – 1 More to the Big Two-Oh-Oh! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
          • Celebrating 200 posts of Kaizen! Share your ideas for the milestone post

            Hello Developers, We launched the Kaizen series in 2019 to share helpful content to support your Zoho CRM development journey. Staying true to its spirit—Kaizen Series: Continuous Improvement for Developer Experience—we've shared everything from FAQs
          • Kaizen #193: Creating different fields in Zoho CRM through API

            🎊 Nearing 200th Kaizen Post – We want to hear from you! Do you have any questions, suggestions, or topics you would like us to cover in future posts? Your insights and suggestions help us shape future content and make this series better for everyone.
          • Client Script | Update - Introducing Commands in Client Script!

            Have you ever wished you could trigger Client Script from contexts other than just the supported pages and events? Have you ever wanted to leverage the advantage of Client Script at your finger tip? Discover the power of Client Script - Commands! Commands

          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 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 コンテンツ








                                ご検討中の方

                                  • Recent Topics

                                  • Look Up Field Type not available for events and tasks?

                                    Look Up Field Type not available for events and tasks?    
                                  • I cannot check out to Zoho People.

                                    When I tried to check out today, there's prompt that inhibits me to check out: To add entry in Attendance, log time for any of your jobs
                                  • Digest Juin - Un résumé de ce qui s'est passé le mois dernier sur Community

                                    Bonjour à toutes et à tous, Ce mois-ci encore, tout s’est enchaîné à toute vitesse ! On vous fait un petit récap de ce qui a marqué ces dernières semaines. Zoho RPA est une solution robuste d’automatisation des processus, conçue pour s’intégrer aux systèmes
                                  • Different Transaction Series for Different Types of Sales

                                    Is there any way I can create multiple transaction series for different type of Sales? Say B2B-001 and B2C -001 for respective type of Sales.?
                                  • Unable to charge GST on shipping/packing & Forwarding charges in INDIA

                                    Currently, tax rates only apply to items. It does not apply tax to any shipping or packing & forwarding charges that may be on the order as well. However, these charges are taxable under GST in India. Please add the ability to apply tax to these charges.
                                  • Customer Advance Zoho Book API

                                    All I could find was Customer Payment API, it does not have facility to add customer advances, where those are not linked to any invoice as such. How to do it?
                                  • Even though the received amount+tax is equal to or lesser than the invoice value, zoho doesnt allow to record

                                    Even though the received amount+tax is equal to or lesser than the invoice value, Zoho mentioned the error- you've recorded more payment than the actual invoice balance. please check again. screenshot also attached.  You've recorded more payment than
                                  • Multiple deductions in invoice

                                    I issue invoices to a customer that include multiple deductions that I would like to track in different expense accounts. But that is not possible in Zoho Books as there is only one Deduction field and even that I don't have control over to assign it
                                  • #BiginnersTips | How to bulk update closing dates for multiple deals in Bigin

                                    Hello Biginners! Keeping your CRM data accurate is crucial for any business- big or small. One key aspect is ensuring that closing dates for deals are always up to date. Why? Because if a deal is closed but not updated, your dashboards and reports would
                                  • 采购里出现付款通知 的错误

                                    采购里面出现付款通知错误,怎么调整,我找不到路径,好像是ZOHO 自动生成的,请问怎么调整
                                  • {"code":1002,"message":"Statement of Accounts does not exist."}

                                    Hello Zoho team, I faced an issue while trying to POST a sales order from sap to zoho books, using the below data packet: {   "customer_id": "4322967000027451968",   "line_items": [     {       "item_id": "2154170000010847685",       "rate": "752.00",
                                  • Add Custom Fields only in Customer module and not on supplier module!? Is not there a way to do that!?

                                    I am trying to create custom fields on clients module but it also gets created on suppliers module; which of course does not make sense at all as a lot of custom fields are client or supplier specific but never both. I am missing something? This seems
                                  • Logging website service fees

                                    Hello, I do a lot of freelance work on sites like Upwork and Wyzant and others and those companies take a small cut from what I pay or what I earn and I am wondering what is the correct way to log this in my books. For example if I charge $55 per hour
                                  • How do i clear a liability account without making a payment?

                                    I have a liability account with a provision for an expected bill from previous years. However the bill never arrived and the provision/liability account with Cr balance has been carried forward for many years now. How do i know clear the provision made
                                  • 2 Transactions for single Expense

                                    I have make 2 payments and have 1 Invoice containing both the items. My Bank Feeds show 2 Transactions, How can i associate them with Single Expense? I tried adding them to Advance Payment, but advance payment I can only apply to Bills It seems. Why cant
                                  • Everything AI in Zoho Recruit – Webinar Recording Available!

                                    AI is transforming the way recruiters find, engage, and hire top talent. In our latest webinar, we explored how Zoho Recruit’s AI-powered features can help streamline hiring, automate workflows, and improve decision-making. Missed the session? No worries
                                  • Introducing the FTP task in Deluge

                                    Hello everyone, We're excited to announce the launch of the FTP task, a powerful addition to Deluge that enables you to effortlessly transfer files between various Zoho apps and your own servers. Unlike the invokeUrl task, which supports various HTTP
                                  • The Social Wall: June 2025

                                    Hello everyone, We’re back with June Zoho Social highlights. This month brought some exciting feature updates—especially within the Social Toolkit—to enhance your social media presence. We engaged with several MSME companies through community meet-ups
                                  • Custom widgets on Zoho one dashboard

                                    Is it possible to create custom widgets on the Zoho One dashboard? I see there is a widget name My Open Tickets to display open tickets in my view, but I would also like to have a widget to display unassigned tickets. A widget to display unfinished projects
                                  • Data privacy concerns

                                    Does Zoho team have access to my data in the database e.g. Balance Sheet, Bank account transactions, Profit & Loss statement etc.
                                  • Ability to Remove/Change Zoho Creator Admins via Zoho One Interface

                                    Dear Zoho One Team, Greetings, We would like to request a feature enhancement in Zoho One. Currently, it is not possible to remove or downgrade a user with the Admin role in Zoho Creator from the Zoho One admin interface. Unlike other Zoho apps where
                                  • Zoho Sheets

                                    Are they ever going to set up the feature "where I left off" just as you can do in Microsoft Excel online ? For me that is the only feature missing from Zoho sheets other than that I think they are terrific and use them every day. I only occasionally
                                  • Canvas Detail View Related List Sorting

                                    Hello, I am having an issue finding a way to sort a related list within a canvas detail view. I have sorted the related list on the page layout associated with the canvas view, but that does not transfer to the canvas view. What am I missing?
                                  • Mass Update in Zoho CRM

                                    Hello, I want to update my past update records by using deluge on some conditions. anyone can please tell me how can I do it.
                                  • Admin asked me for Backend Details when I wanted to verify my ZeptoMail Account

                                    Please provide the backend details where you will be adding the SMTP/API information of ZeptoMail Who knows what this means?
                                  • Action requested: Retain your sales journey configuration in Path Finder

                                    Dear Customers, We hope you're well! As you might know, we're completely overhauling our journey management suite, CommandCenter, and are in the last leg of it. As a means of getting ready to go live, we will be announcing a series of requests and updates
                                  • search layout in new version

                                    Hello where is the menu for customizing search fields (module search layout) in the new zoho version (2016) ?? thanks nono
                                  • Zoho Marketplace Analytcis

                                    Hi Team, Our Zoho Marketplace Dashboard is not showing any data. What do you think we could do?
                                  • if i have zoho one can i upgrade some of my staff from crm to crm plus within my organisation?

                                    if i have zoho one can i upgrade some of my staff from crm to crm plus within my organisation? Or because I have many licenses of ZOHO ONE , IF I upgrade some staff to ZOGO CRUM PLUS. they will not be on the same organisat
                                  • The problem with Commerce ownership changing

                                    Hi, I am changing the ownership of the company and trying to delete the previous user-owner. I changed the owner of the company from user Tatiana to user Eugene. Eugene is the owner of the organization. It's OK. I am now trying to remove the user Tatiana.
                                  • Secondary Emails

                                    I am having issues deleting a secondary email address from a couple of our users and need help. When in Directory, manage email addresses, I click the trash icon by the email address and confirm I am trying to delete the email. I click continue and I
                                  • Kaizen #121 : Customize List Views using Client Script

                                    Hello everyone! Welcome back to another interesting Kaizen post. In this post, we can discuss how to customize List Views using Client Script. This post will answer the questions Ability to remove public views by the super admin in the Zoho CRM and Is
                                  • Page Layouts for Standard Modules like CRM

                                    For standard modules like quotes, invoices, purchase orders, etc, it would be a great feature to be able to create custom page layouts with custom fields in Zoho Books similar to how you can in Zoho CRM. For example, and my current use case, I have a
                                  • Zoho Books | Product updates | June 2025

                                    Hello Users, We’ve rolled out new features and enhancements in Zoho Books, from the option to record advances for purchase orders to dynamic lookup fields, all designed to help you stay on top of your finances with ease. Introducing Change Comparators
                                  • Widget Upload to CRM Fails with “Page Not Found” – Even with Correct Index Path

                                    I'm building a simple widget to export Contact data to CSV in Zoho CRM, triggered via a custom button. The widget uploads cleanly, appears in the widget list, and is successfully assigned to a Contact detail view via a custom button. But when clicked,
                                  • Account disabled

                                    I have an issue I need help with. Whilst trialing ZOHO CRM I created the following: Account1 (-------------) using m__ame@m__rg___s__i__.___.__ and 2 personal emails Account2 (-------------) using a personal email and 2 users _al__1@______________._o_.__
                                  • How can we manage the tags in ticket

                                    Allowing agents to use Tags indiscriminately can cause havoc. We could not find tag management where 1. The admin can create Tags beforehand for use by Agents 2. Permission can be allocated which roles/profiles can use existing tags or add new tags 3.
                                  • Feed Notifications filter?

                                    I'd like to have filter settings for Feed Notifications just like we have for Personal Email. If someone dumps a bunch of files into a project, we get a notification for every file!
                                  • Custom fields and filters for Timesheet

                                    HI Zoho Projects team. IT would be great and useful if we can add custom fields to the Timesheet design And is needed more options for filtering the timesheet dashboard, like "Milestones" and task list asociated to the record. Thank you
                                  • How do I rename the dropdown that contains a form and a report?

                                    I want to rename this, but I can't find how
                                  • Next Page