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

                                  • Set Conditional and Dependent Rules for Issues in Zoho Projects

                                    An Issue Layout is a customizable form to add and update information about a specific issue. The fields in the issue layout can be changed dynamically based on user requirement using the issue layout rules. Consider a scenario where an electrical fluctuation
                                  • Accounting on the Go Series-56: e-Way Bill Module in the Mobile App – A Handy Solution for Indian Businesses

                                    Hello everyone, Managing e-Way bills just got more convenient with the Zoho Books mobile app! For businesses operating under the GST regime, e-Way bills are essential for tracking the movement of goods. Previously, you had to log in to the web app to
                                  • Copying records from a Custom Module into Deals

                                    Hello, I recently created a custom module to handle a particular type of order/transaction in our business. Having got this up and running I've realised that it would be much better to use the Deals module with a different layout instead. We've entered
                                  • Creator App on Mobile - Workflow "On Create / Edit - On Load" not triggered ?

                                    Hi Everyone, I built an application to track assets, which is used both at the office (desktop) an in the field by technicians (mobile app). In the field, technicians open an existing form and add rows to a subform at some point. One field they have to
                                  • HOW TO VIEW INDIVIDUAL COST OF NEWLY PURCHASED GOODS AFTER ALLOCATING LANDED COSTS

                                    Hello, I have been able to allocate landed costs to the purchase cost of the new products. however, what i need to see now is the actual cost price (original cost plus landed cost), of only my newly purchased products to enable me set a selling price
                                  • Custom Function to get custom field of lookup type in Books

                                    Hi, Here's the situation. In Purchase Order, there is a custom field (lookup) to SO. The requirement is to update to the related SO if PO get updated Right now facing challenge to get the id of custom field (lookup) in PO. Please find below the sample
                                  • Custom From Address is now Organizational Email

                                    We're introducing a small yet meaningful change in Zoho Recruit, one that sets the foundation for bigger improvements coming your way. What’s changed? We’ve renamed the Custom From Address to Organizational Email. The new name was chosen to better reflect
                                  • What's New in Zoho Billing Q2 2025

                                    Hello everyone, We are excited to share the latest set of updates and enhancements made to Zoho Billing in Q2 2025, ranging from image custom fields to support for new languages. Keep reading to learn more. Upload Images From Your Desktop to Email Notifications
                                  • Map dependency on Multiselect picklist

                                    I need help in Zoho CRM. I have 2 multi-select picklists. For example, Picklist A has country names. Picklist B has state names. Now I want to show states on the basis of the selected country from Picklist A. Both are multi-select fields, so the standard
                                  • Tip of the Week #63 – Keep personal emails out of team view.

                                    Shared inboxes are great for teamwork—they let everyone stay on the same page, respond faster, and avoid duplicate replies. But not every message needs to be shared with the entire team. Think about those one-on-one chats with a manager, a quick internal
                                  • Episode III : Powering Automation: Custom Functions in Action

                                    Hello Everyone, In our previous episodes, we explored custom functions and the Deluge programming language. If you’ve been wondering why the Episode series have been quiet, here’s the reveal! On our community, we've been showcasing custom functions integrated
                                  • Narrative 2 - Understanding Organizational Departments

                                    Behind the scenes of a successful ticketing system - BTS Series Narrative 2 - Understanding Organizational Departments A ticketing system's departments are essential because they provide an organized and practical framework for handling and addressing
                                  • Zoho Projects Plus for the healthcare industry

                                    The global healthcare industry is complex and diverse; from patient record maintenance, healthcare supply chain, to manufacturing complex medical equipment, the industry functions on many layers. Managing all these layers requires tested out techniques
                                  • Missing Outlook calendar option in Calendar

                                    Hi all I don't have an Outlook Calendar option in the Settings > Synchronise settings of Calendar. Any ideas why not?
                                  • Zoho Meeting Android app update: Breakout rooms, noise cancellation

                                    Hello everyone! In the latest version(v2.6.1) of the Zoho Meeting app update, we have brought in support for the following features: 1. Join Breakout rooms. 2. Noise cancellation Join Breakout rooms. Breakout Rooms are virtual rooms created within a meeting
                                  • Whats App Automation

                                    It would be nice to be able to send out an automated whats app message template on moving stages or creation of a ticket (same as you can do for automated emails). Currently only automated emails can be sent. Also, if whats app could be used more effectively
                                  • Zoho Projects Android app update: Enhanced Documents module within the projects.

                                    Hello everyone! In the latest Android version(v3.9.35) of the Zoho Projects app update, we have enhanced the documents module within the projects. Now, you can view all the attachments that you have added across the project in tasks, bugs, comments, etc,
                                  • Lead Source Disappears

                                    When adding a new lead and saving the page, the page refreshes itself and the lead source field becomes blank. We set the "Lead source" as a required field to see if it would help, but the problem persists and we always have to re-enter the lead sou
                                  • Inquiry Regarding Monitoring ZOHO CRM API Credit Usage

                                    Hello ZOHO Community, I hope this message finds you well. I have a question regarding monitoring the usage and remaining credits of the ZOHO CRM API. I recently discovered that within ZOHO CRM, by navigating to Settings ⇒ Developer Hub ⇒ APIs & SDKs,
                                  • Payment Gateways - A unified hub to manage all your payment integrations in Zoho Creator

                                    Hello everyone, We're thrilled to announce that we've completely reimagined the way payment gateways are handled in Creator. The result is a centralized Payment Gateways section that provides a clean, user-friendly interface to configure and manage all
                                  • Community Digest Julio 2025 - Todas las novedades en Español Zoho Community

                                    ¡Hola, Español Zoho Community! Ha pasado un tiempo desde el último Digest pero, ¡ya estamos de vuelta con las novedades más relevantes en las aplicaciones de Zoho y su universo! Si no te quieres perder ninguna de las novedades que vamos publicando, te
                                  • Tip #35- How to use Notifications in Zoho Assist to stay on top of session activities- 'Insider Insights'

                                    Hello Zoho Assist Community! This week, we’re exploring Zoho Assist’s built-in notification system for improved visibility and accountability. Keeping track of session activity is crucial, especially when you're managing multiple remote devices and technicians.
                                  • Assistance with Exporting Specific Data from Zoho CRM

                                    Hi, Could you please guide me on how to export specific information, such as the model number and serial number, from the Accounts module in Zoho CRM? Thank you in advance for your assistance.
                                  • Coming Soon in Zoho Invoice: Send Invoices Instantly via WhatsApp

                                    We're working on bringing a new level of convenience to your invoicing experience. Introducing a much-requested feature in Zoho Invoice: You can now share invoices directly to your customers via WhatsApp! With this new option, you can: Share invoices
                                  • field update from the value of another field

                                    Hello, I need to do a field update from the value of another field, but i don´t know how can i do it. In the mass update option it is not possible... I need to put the last name value form the leads module to other custom field that i have created. thanks for your help
                                  • What is a realistic turnaround time for account review for ZeptoMail?

                                    On signing up it said 2-3 business days. I am on business-day 6 and have had zero contact of any kind. No follow-up questions, no approval or decline. Attempts to "leave a message" or use the "Contact Us" form have just vanished without a trace. It still
                                  • Playback and Management Enhancements for Zoho Quartz Recordings

                                    Hello Zoho Team, We hope you're all doing well. We would like to submit a feature request related to Zoho Quartz, the tool used to record and share browser sessions with Zoho Support. 🎯 Current Functionality As of now, Zoho Quartz allows users to record
                                  • Is there any way to prevent the row cloning feature(on edit page)

                                    My initial requirement is to prevent some users from adding new rows in the subform. For that, I have implemented the client script, and the script is working fine. But users are able to clone the row and make changes. For that, I was unable to find any
                                  • Using Another Field Value for Workflow Field Update

                                    I'm trying to setup a Workflow with a "Field Update" action on the Lead module, but I would like the new value to actually be taken from a DIFFERENT Field's on the Lead record (vs just defining some static value..) Is this possible? Could I simply use
                                  • How Do I Change Business Location

                                    Ive just shifted my business to a new country and would like to update my address and Business location in the "Organisation Profile" page but it is locked in the previous country. How do I unlock it / change it? Thanks
                                  • Verify details pop-up windows

                                    Hi, Is it possible to turn-off the anoying "Verify details" window that ask for closing date, "Reason for Lost" or other concepts. If I would like the user to enter such data, I will implement a rule .... How can I turn-off such pop-up? it's not necessary
                                  • Monthly overtime wrong after adding/changing attendance time for past month

                                    Hi there, as I understand it, the montly overtime overview under attendance is calculated at the end of each month. If someone was not able to enter his attendance in time but entered it in the new month, this time will not be considered in the overview.
                                  • As a security measure, you need to link your phone number with this account and verify it to proceed further.

                                    I want to disable this feature as my one staff travels with different phone numbers so it is hard to verify by phone. How do I do that?
                                  • Asset Tracking

                                    I am looking to create custom modules to track customer assets. We install serialized and non-serialized equipment into customers vehicles. So we will have vehicles belonging to the customer then equipment that will belong to a vehicle (if installed)
                                  • Will zoho thrive be integrated with Zoho Books?

                                    title
                                  • 【参加無料】8月8日(金) 福岡 ユーザ交流会 参加登録 受付開始!

                                    ユーザーの皆さま、こんにちは。コミュニティチームの藤澤です。 8月8日(金)に1年ぶりに、福岡でZoho ユーザー交流会を開催します! ユーザー事例セッションでは、CreativeStudio樂合同会社の前田 美知太郎さまが、労働時間を削減したZoho活用のリアルな工夫を語ります。 Zoho社員セッションでは、データ収集から自動処理まで一気に効率化できるZoho Formsの最新活用アイディアをお届けします。 ▷▷詳細はこちら:https://www.zohomeetups.com/Fukuoka2025#/?affl=fuk2508forumpost
                                  • Unusable due to "server" issues but there's nothing on Zoho or Down Detector saying there's an outage

                                    I just started the Zoho trial and I cannot do anything because no apps or even the "contact support" will actually load. I tried to create a project but it keeps giving me the error "server is unable to process your request at this time". I tried to load
                                  • Issue After Updating to Zoho Desk Android SDK v4.5.0 – Authentication Fails (Status Code 204)

                                    Hi Zoho Support Team, I was previously using the Zoho Desk Android SDK with the following dependency: implementation 'com.zoho.desk:asapsdk:3.0_BETA_17' Everything was working as expected — including user authentication, the tickets section, and the
                                  • add another department to helpcenter

                                    After activating multi-brand, how to add another department to help center? For example department A has associated with help center 1. We have another department B and would like user to be able to submit ticket to department B via help center 1, how
                                  • Task and Milestones - Dependency feature needed

                                    I'm sure we're not the first to bring this up. We've been using zoho project for a while. Every project manager knows that to manage a successful project you need option to stack tasks and milestones and be able to create dependencies between tasks and milestones. I think you get the idea... Can you let us know if this feature is in the making or not? any chance we'll see this in future releases? If you need customer feedback about this feature or other enhancements, we'll be happy to test new products
                                  • Next Page