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

                                  • Microsoft PowerPoint files Extremely slow to save

                                    I and others on my team have noticed that Microsoft PowerPoint documents are extremely slow to save when using WorkDrive. It always takes over 30 seconds to save a file. Word and Excel files seem to save in a typical length of time, but PowerPoint is
                                  • How can users unblock their blocked Zoho Mail accounts?

                                    After the reason for the account block (storage exceeded, spam detection etc.) has been rectified, the user can unblock the account from the UnBlock Me page. Account support@edu2review.com  Edu2Review is an education review platform, we rate the quality
                                  • Adding additional fields for batch information

                                    Hello, I am looking at adding additional information into our inventory module. we would like to be able to see up to 8 attributes that will be individual & different for each batch (i.e. batch specific information) but currently I seem to only be able
                                  • Dynamic Pickup List Values using Deluge and Client Script

                                    I would like to dynamically show Pickup List Values For example we need to fetch some data from an on premise application and display it so they can choose and pick This can be done in Creator but I didn't find anything for CRM
                                  • Validation Rule for Controlled Stage Movement in Deals Module (Deluge Script)

                                    For keeping a control over module stage or status, you can use the below deluge script. The below deluge script defines validation control over deals module stages: // Function to validate allowed stage transitions in the Deals module map validation_rule.LeadStatustValidation1(String
                                  • Pick List Issues

                                    I have created a pick list that looks at a table in a sheet, it selects the column I want fine. Various issues have come along. The option to sort the pick list is simplistic, only allows an ascending alphabetical sort. Bad luck if you want it descending.
                                  • Four types of task dependencies

                                    "Nothing is particularly hard if you divide it into small jobs."                                                                                                                  - Henry Ford Projects, small or large, are driven by simple work units called tasks. Monitoring standalone tasks might look simple but as the workflow becomes elaborate, tasks may start relying on one another. In project management, this relationship between tasks is termed as "Task Dependencies". Dependency between tasks arise
                                  • 1099 tracking

                                    Do zoho books offer feature of tracking for 1099's for contractors, etc? Quick books offers this feature and wondered when/if Zoho books will do same
                                  • VAT-type Taxes in US Edition?

                                    I'm located in the US, and I use the Zoho One US edition of Books. We are in the process of registering with Canadian authorities for their GST / HST, which is a VAT-type of scheme. It is not immediately obvious to me how one would deal with input tax
                                  • 2 users editing the same record - loose changes

                                    Hello, I'm very new to Zoho so apology if this has been addressed somewhere i can't find. I have noticed the following: If we have 2 users put an inventory item in edit mode at the same time: say user1 click on edit and user2 while user1 is still in edit,
                                  • Schedule sms to be sent later

                                    When will you make available an option to send sms's at a later time??? You finaly have this option available on emails, so it will be very useful to have it also with sms. Our sms provider, has already this available but we cannot use it because you
                                  • Ecommerce integration with prestashop

                                    Development of campaigns integration with prestahop. When???
                                  • How to create an article containing images and rich text via the api?

                                    Hi, I'm trying to migrate our kb articles from our previous helpdesk service, and import them to ZohoDesk. Is there any way to create an article that contains images?  Is it possible to add formatting to articles created via the API? Thanks, Adam.
                                  • Number of statement execution limit exceeded on deluge scheduled function

                                    I'm working on a send email functionality in creator that sends out crew work orders at the end of the day each day for the next day. I'm running into the issue that zoho is unable to handle the number of statements that I am doing to be able to successfully
                                  • Color of Text Box Changes

                                    Sometimes I find the color of text boxes changed to a different color. This seems to happen when I reopen the same slide deck later. In the image that I am attaching, you see that the colors of the whole "virus," the "irology" part of "virology," and
                                  • Zoho SignForm In Progress But Cannot Be Completed

                                    If a person starts signing a document (via SignForm), but closes the window before submitting, Zoho marks the document "in progress", but how do they finish signing it?
                                  • How to show Assemblies AND component items in a report

                                    Hi Is there any way in Analytics to create a report that shows the Composite Item AND the Component Items with mapped quantity? It seems that the component item is not exposed in any table that I can find. Also, the same question but for Stock on Hand.....this
                                  • Mandatory Messages for Specific Members in Zoho Cliq Channels

                                    Hello Zoho Cliq Team, We hope you're doing well. We would like to request a feature enhancement to Zoho Cliq that would allow marking certain messages in a channel as mandatory for specific members — with built-in tracking and reminders. 🎯 Use Case:
                                  • Admin Access to Message Read Statistics in Zoho Cliq

                                    Hello Zoho Cliq Team, We hope you're doing well. We would like to request a feature enhancement that would allow admins or channel owners to view read/unread statistics for messages, even if they were not the original sender. 🎯 Use Case: Currently, in
                                  • Online Member Visibility in Channels (Similar to WhatsApp Group Presence)

                                    Hello Zoho Cliq Team, We hope you're doing well. We’d like to request an enhancement to Zoho Cliq’s channel experience by introducing online presence indicators for channel members — similar to how WhatsApp shows how many people in a group are currently
                                  • Show ticket field in Zoho Desk only if that same field is not empty (API‑created records)

                                    Zoho Team , We have a ticket workflow where every ticket is created via API based on dynamic logic from an external form. That form has complex logic and already decides what’s relevant to ask, and the API only populates fields in Zoho Desk based on that
                                  • Multiple Products on Ticket

                                    Good morning. We will classify all tickets based on the product. Users sometimes send different requests on the same ticket, so we are facing some challenges. Is there a way to add more than one product to the ticket, or is there a way to tie the product
                                  • Não recebo Email de confirmação e validação de cadastro do PagSeguro

                                    Olá, utilizei uma das minhas contas de email Zoho para criar um cadastro no PagSeguro, contigo o email com o link de confirmação da conta não chega no meu email Zoho (nem.ma caixa de spam, nem na lixeira, e nem em outras pastas). Outros emails do PagSeguro
                                  • Does Thrive work with Zoho Billing (Subscriptions)?

                                    I would like to use Thrive with Zoho Billing Subscriptions but don't see a way to do so. Can someone point me in the right direction? Thank you
                                  • accounts payable and receivable subaccounts

                                    How to create accounts payable and receivable subaccounts? Being that I have several clients and in my balance sheet have to specify the accounts of each client and not only appear "accounts receivable or accounts payable" ??
                                  • DUPLICATING WORKFLOWS IN CREATOR

                                    Hi all, I want to duplicate and slightly amend 3 workflows in Creator so that I don't have to keep typing in all the rules and properties each time. I can see lots of videos on CRM with the 3 dots at the top of the workflow, but nothing like that in Creator.
                                  • Add SKU to query options in `items` API endpoint

                                    It would be very useful to be able to pull items by SKU in the API as this is a commonly used unique ID that tends to be consistent across systems.
                                  • Estimates and invoices being sent from company-wide address, rather than individual

                                    In our organization, team members send estimates and invoices through Zoho Books by using the "Send Email" function. However, for certain users, the system defaults to sending estimates and invoices from a shared organizational email address (e.g., company@example.com)
                                  • Need profit margins for books in estimates & invoice

                                    https://help.zoho.com/portal/en/community/topic/show-my-cost-or-profit-while-creating-estimate
                                  • Decimal places settings for exchange rates

                                    Hello, We are facing issues while matching vendor payments with banking feeds. As we often import products/services exchange rate comes into play. Currently, ZOHO allows only six digits for decimal places. We feel that conversions like JPY to INR require
                                  • Item Level Notifications

                                    I need to create a custom workflow based on the creation of an estimate that has a SKU/Item name that matches certain criteria. I can have it generated based on a total amount, but not at the item level. Is this possible?
                                  • Cannot categorize a bank deposit to an income sub-account

                                    When I go to categorize a bank deposit, I am not able to see any income sub-accounts. If I set up an income account without a parent, then I am able to categorize a transaction into that account, but as soon as I make it a child account, it disappears
                                  • ZV Extension passkey changes in v5.7.0

                                    Has there any changes to the how passkeys are managed in ZV - Chrome extensions v5.7.0? Namely, if the passkeys were already implemented/enforced as 2FA on a certain webpage, but ZV does not track them yet. Would that be the issue for my use case?
                                  • What's New in Zoho Billing - August 2025

                                    Hello everyone, We are excited to share the latest updates and enhancements made to Zoho Billing in August 2025 to improve your overall billing management experience. Keep reading to learn more. Notify Customers About Subscriptions via WhatsApp Business
                                  • How do I get my account id?

                                    Hello, I followed the instructions to get a list of accounts of the currently authenticated user (which is me, and I am logged in). But when I follow the below instructions I get the following error: ERROR: {"data":{"errorCode":"INVALID_TICKET","moreInfo":"Invalid ticket"},"status":{"code":400,"description":"Invalid Input"}} Instructions that I am following: GET - User account details Purpose The API retrieves the list of accounts of the currently authenticated user.  Request URL  http://mail.zoho.com/api/accounts
                                  • Why are tasks not showing in Zoho Calendar?

                                    Hi there, I updated the Zoho calendar preferences for Task records to show on the calendar together with Meetings and Calls - see attached screenshot. Despite of that, Task records still won't show on the calendar. Is there a specific reason why this
                                  • Zoho Payroll: Product Updates - July 2025

                                    Over the past month, we've focused on making Zoho Payroll more flexible, compliant, and easier to use—whether you're processing complex payouts, ensuring accurate calculations, or meeting local tax regulations. Here's what's new: One-Time Payments and
                                  • Discussion for “sub product”, “sub item” or “child products”

                                    Hello everyone, In some CRM systems, there is the ability to associate products in a hierarchical manner within a quote. For example: Product A: Gold Plan Product B: Setup Product C: Connector Product D: Silver Plan Product B: Setup Product C: Connector
                                  • Retrieve Accidental Deleted User

                                    Is there a way to undelete a user who accidentally deleted themselves?
                                  • Request for Support - CRM Integration Issues

                                    I’m reaching out to request assistance with the following items: 1. Zoho Forms Integration with Zoho CRM We are currently using Zoho Forms to send the Global Credit Application form to our customers. The intended workflow is for the form submissions to
                                  • Next Page