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

                                  • How to Initiate WhatsApp Message on SalesIQ?

                                    I've just activated a Business WhatsApp phone number through SalesIQ because of its touted omnichannel chat approach. Sounds exciting. I understand that when a customer sends me a WA message, I can reply to it on SalesIQ and keep the chat going, perfect.
                                  • Episode IV:Handling User Inputs in custom functions

                                    Hi Everyone, We've been exploring custom functions which help in performing advanced automation tasks. Custom functions enable you to achieve possibilities based on your organization's requirements. Custom functions require user inputs that allow the
                                  • Set a lead as non-marketing if they opt out of email marketing

                                    I'm gathering Lead data via an enquiry form and wish to give them the option to opt out of marketing emails (which we send from Marketing Automation) whilst retaining the ability to send them non-marketing emails - so the email opt-out field doesn't work.
                                  • Set up multiple IMAP email addresses

                                    Hi, I just started using CRM and its great, but I just found out I can only add one imap email address for incoming mail in the included salesinbox ...this is ridiculous. All companies have different email such as sales@domain, info@domain , personal@domain
                                  • Zoho Recruit to Zoho People integration

                                    In the mapping of field from Zoho Recruit to Zoho People i am unable to map all fields What can i do
                                  • Zoho Recruit > Career Site > Customisation

                                    Hi All I have created multiple career site to represent my different organization In my Quanta Media career site > I set it with the with Quanta Malta view In my job opening : Quanta Malta view 2 job opening In my URL for quanta media https://lri.zohorecruit.eu/jobs/Quanta-Malta
                                  • Formatting Blueprint Stages (buttons)

                                    Is there a way to format Blueprint transition buttons in Creator like background colour, text colour etc.
                                  • Disable Default Value in Multi-Select field

                                    Hello, Is there a way to disable the default value feature when setting up a custom Multi-Select field? When creating tickets I would like it so there isn't a value pre-selected in the multi-select custom field that was created.
                                  • How to set custom business hours for different teams in Zoho Desk?

                                    Hi Zoho Team and Community, I’m trying to set different business hours for multiple departments in Zoho Desk. For example, our tech support team works 24/7, while our billing team is only available from 9 AM to 5 PM (Mon–Fri). Is there a way to assign
                                  • Zia Auto Tag Keyword Clusters

                                    Is there a way to remove a keyword from a keyword cluster? We're finding that Zia auto-tag is tagging things incorrectly based on some words that don't really make sense.
                                  • Centralized Domain Verification in Zoho CRM Plus

                                    Hi Team, I have a suggestion regarding Zoho CRM Plus. It's quite frustrating to verify the same domain separately for each application within the suite. It would be really helpful if you could introduce a centralized admin console—similar to what's available
                                  • HOw do I make a refund?

                                    I have a client that needs a refund. I see a refund history in the Report area... but where do I go to make a refund?
                                  • Creating a work order for dispatch

                                    We currently uses ZOHO for CRM and Intuit Field Service for creating Work orders and dispatching. This is causing double entry and is not efficient use of time.  I would like to use ZOHO for all customer related activities so can you tell me if you can :  Create a work order that we could manipulate to meet our needs.  Also if you could then dispatch that would be ideal. Thank you
                                  • "code": "500","description": "Account not exists", mail api

                                    I have been through all the steps and have a functioning Oath access_token etc etc... I then GET https://mail.zoho.com/api/organization And get my zoid then GET http://mail.zoho.com/api/organization/<hidden>/accounts and get the account details, which
                                  • Residual Formatting in Text Boxes After Undoing Pasting of Formatted Text

                                    Hi, guys! I have another problem to report. Actually, I have been aware of this for many months, possibly years, but I have been too lazy to report it to you. My apologies! Let's say you've pasted a formatted string into a text box. You change your mind
                                  • Feature Request: Stripe Terminal Integration

                                    I would like to request the addition of Stripe Terminal integration to Zoho Books, which will help process in-person payments. While Zoho Books already supports online payments through Stripe, extending this functionality to include Stripe Terminal would
                                  • Customer Parent Account or Sub-Customer Account

                                    Some of clients as they have 50 to 300 branches, they required separate account statement with outlet name and number; which means we have to open new account for each branch individually. However, the main issue is that, when they make a payment, they
                                  • Improved Security in SAML/OIDC Sign-in Redirection Flow

                                    To enhance the security of our authentication system, we’ve made a change to how SAML and OIDC sign-in redirections are handled. This update resolves a potential open redirection vulnerability and adds an extra layer of protection during the sign-in process.
                                  • GA4 data

                                    Hi, I have data being pulled from GA4 into numerous tables. There are a few major errors in the source data. Eg for a period of time GA4 reported ecommerce sales that were $98 as $9,800 and $42 as $4,200. It's not happening now but my historical data
                                  • Ask the Experts: Five-hour live Q&A session with Zoho WorkDrive product experts

                                    Have questions about WorkDrive 5.0? Let’s talk! We recently launched Zoho WorkDrive 5.0, packed with powerful updates to help your team work smarter, stay secure, and get more value from your business content. From content-centric workflows and AI-powered
                                  • Allow the usage of Multi-Select fields as the primary field on "Layout Rules"

                                    We want to force our users to enter some explanation strings when a multi-select field has been utilized. I can't understand the reason for the usage restriction of Multi-Select fields as a primary field. This is a simple "Display hidden mandatory field
                                  • Lost Search Box with new UI Design

                                    I would like to suggest bringing back the Search Box in the new Zoho Project UI.  I use the search feature a lot and having to click the magnifying glass to type for a search is one extra click that we did not have with the old UI.
                                  • Adaptación de zoho books a la nueva regulación de facturación electrónica

                                    La facturación electrónica será obligatoria para todas las empresa en España en 2025, en Francia probablemente también e imagino pronto en todos los países europeos. Ya en 2024 todas las empresa grandes tienen que utilizar el sistema de facturación electrónica.
                                  • ZOHOBOOK Sales_QUOTE: To Add Discount At Each Line Item Table

                                    Hi, Our quote need to display with discount at each line item level as well. Try to edit template, >CUSTOMISE>EDIT TEMPLATE> Table, I can see template view with discount column, but when hit SAVE the template, view in PDF the discount column not shown.
                                  • How to account for vat with postponed VAT accounting

                                    Hi everyone, looking for some help with postponed VAT accounting, I use DHL express for my imports and they used to pay the VAT for me and then invoice me. I could then log this as a bill and the VAT element from import was recorded as input VAT, all
                                  • Weekly Automation Trigger for Equipment Calibration Reminder

                                    Dear Team, I’m currently working on an automation in the Equipment module. The goal is to track calibration schedules for tools — all of which require regular calibration. I’ve created an automation that sends email reminders for tools that are due for
                                  • Want to use Zoho Books in Switzerland. CHF support planned?

                                    Hi, We're a Swiss company using other Zoho suite software and I discovered Zoho Books and other accounting SaaS when looking for an accounting tool. Do you intend to cover Switzerland and CHF based accounting anytime soon? Roy
                                  • ADDDATE formula using 2 calculations

                                    Hello, I want to create an ADDDATE formula using 2 calculations, add 1 month and deduct 1 day. the formula that I need should look like this: ADDDATE(due_date, 1, "Months")+ ADDDATE(due_date, -1, "Days") Each row itself works fine, but when I'm trying
                                  • Upgrading from Zoho Invoice to Books was a major downgrade in functionality for me

                                    I have been a user for many years of a free plan on Zoho Invoice for my personal consulting business. I recent upgraded my organization to Books since some of the additional functionality looked useful to me, and played around with the free trial for
                                  • 🎉 Dynamic Org Chart for Zoho CRM Extension Published [2025]

                                    Hey Zoho CRM Community! We're thrilled to unveil our latest Zoho extension:🥁 Dynamic Org Chart for Zoho CRM 🎊 This extension is now available to transform the way your teams visualize, manage, and interact with org chart directly inside any Zoho CRM's
                                  • Detailed General Ledger has problem of exporting out to excel and missing ledger details for some accounts

                                    I have been encountering some problems generating Detailed General Ledger report with Zoho books. Firstly, I cannot export out the report of Detailed General Ledger to Excel. It will show this error message "invalid value passed for sort column", and
                                  • Upload a file to a File Upload Field through API

                                    Hello, Is there any way to upload a file to a custom file upload field in a module when doing an Update using the Record API? I've found and I am able to upload files to attachments but I don't know how to upload them to a field. I've checked the documentation at  https://www.zoho.com/crm/help/api/v2/#update-specify-records but the File Upload field type does not appear in the examples. Thanks
                                  • Kaizen #131 - Bulk Write for parent-child records using Scala SDK

                                    Hello and welcome back to this week's Kaizen! Last week, we discussed how to configure and initialize the Zoho CRM Scala SDK. This week, we will be exploring the Bulk Write API and its capabilities. Specifically, we will focus on executing bulk write
                                  • Automatic pricing feature for sales orders

                                    I am currently setting up my Zoho Inventory system and would like to implement an automatic pricing feature for sales orders. We have created a custom field called "brandline" for our items. All products with the same brandline value should have the same
                                  • Ability to access VAT returns and submit them has disappeared.

                                    I have been using Zoho books successfully to submit quarterly VAT returns. Without reason I have lost that facility. I have followed all available instructions eg going into settings, taxes, VAT etc. without success. My registration number is there and
                                  • How to automatically schedule a meeting After Blueprint Transition

                                    As part of our sales process, we require a technician to go to the customer's site and perform an installation prior to advancing to the next stage of the blueprint.  So this will require (a) scheduling a meeting for the technician to visit the customer's site and (b) a reminder phone call the day before the scheduled meeting. As I'm designing the Deal Blueprint, I see that I can automatically add a Task to the deal, but I can't add a Meeting or a Call. What am I missing?  There seem to be 3 types
                                  • Zoho Recruit > Workflow

                                    I have created a workflow for my application module Whenever a record is created The condition , application status is 1st call invitation I have set this OI do not receive the email that was suppose to be send out
                                  • [Webinar] Zoho Writer for SCM and logistics

                                    Creating, sharing, and distributing complex documents are constant challenges in the SCM and logistics industry. That's why our next webinar is focused on how to simplify these document workflows. Join us on Jul 10, 2025 for a Zoho Writer webinar designed
                                  • Multiple locations but one parent company

                                    I am trying to configure my accounts that have multiple locations under one parent company to show separate locations in the portal.   
                                  • Stock Count History in Product Details – Zoho Inventory

                                    Hello Zoho Team, When I perform a Stock Count for a product in Zoho Inventory, I would like to view the history of those stock counts later — especially from the product details page. Currently, I can perform the count and update the quantity, but I’m
                                  • Next Page