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

                                  • Attention: Upcoming changes to Zoho Assist support for older windows versions

                                    At Zoho Assist, our goal is to provide you with secure, reliable, and feature-rich remote support experiences. To maintain this standard, we periodically align our platform with the latest technology and security updates from the broader software ecosystem.
                                  • Send again email with link for signup

                                    Hello, I have a lot of problem to send contract my email, also missing the features "share link". How can I send again email to client and me wit link for signup a contract? Everytime it's a disaster!
                                  • How do I synchronize a quote to an opportunity?

                                    Hi everyone, We don't quote anything via Zoho but we use it to track services/products so that I can see what was actually sold, vs an opportunity with just shows an amount.  We use the quotes for other purposes, mostly to request a quote from Salesforce but we don't invoice or do sales orders or anything. (Basically a user makes a quick quote in Zoho, adds items and pricing, and then exports to PDF which gets emailed to our Quote Desk who then enters the request into Salesforce). Just wondering
                                  • Zoho Sprints Android app update: Tags and Epic search

                                    Hello everyone! We are excited to introduce tags and an option to search items within Epic module on the latest Android version(v2.0.2) of the Zoho Sprints mobile app. Let's take a look at these features: Tags You can now create, edit, and delete tags,
                                  • Zoho CRM Webhooks - Dynamic URL

                                    Hi Zoho, We've noted a gap in the webhooks function that if improved would increase use cases significantly. The "URL to Notify" field in "Create a Webhook" only supports static information. We have a number of use cases where we could use webhooks more
                                  • Work Order Creation Issue

                                    Dear Team, I would like to inquire about the daily limit for Work Order creation in Zoho FSM. Yesterday (02/05/2025) at around 6:30 PM GST, I attempted to create a Work Order, but I have been unable to do so since then. Please find the attached image
                                  • Tracking on Zoho Booking

                                    Hi We want to use Zoho Booking for our appointment management. We're using Calendly as of now that lets us track sources of the appointments made including UTM parameters. Is there a way for us to do same with Zoho Bookings?
                                  • Pre-created Popular Zoho Flows returns with 404 Error

                                    Your popular Zoho Flows are returning with a 404 page error. This applies to all work flows in your Gallery Space. See video here for further clarification. When will this be fixed? https://drive.google.com/drive/folders/1kDl4ni5EQeLHWeaoIDdtRqoUbW8FNLfO?usp=sharing
                                  • CRM Feature Request

                                    When enabling Translation in Zoho CRM I would like to see the ability to remove the language "English (US)". I have encountered a user experience issue with a client recently. The client uses English (UK) but they are based in Spain, so they have activated
                                  • Import your Google Docs Spreadsheets into Zoho Sheet

                                    You can now import your Google spreadsheet into Zoho Sheet. This will be useful if you want to switch to Zoho Sheet or if you want to simply try out Zoho Sheet.  If you don't have an account with Zoho, you can still try this by signing in with your Google account. Here is a video on how to do this.  Note: Existing charts won't appear in spreadsheets you import from Google Docs as the Export functionality of Google Docs doesn't give out the charts. Check out the announcement in our blog: https://blogs.zoho.com/general/import-google-docs-into-zoho-productivity-suite
                                  • Support Mixed Visibility Settings in Knowledge Base Categories

                                    Hello Zoho Desk Team, We hope you're all doing well. We’d like to submit a feature request regarding visibility settings in the Knowledge Base module. 🎯 Current Limitation As of today, when a category is set to a specific visibility level (e.g., Public),
                                  • Will a campaign send duplicates is same email is on two separate lists

                                    Hi I have two lists to which I want to send campaign. One list is ALL leads and other is list of opportunities and current students. There is overlap between the two lists My question is if I send one campaign to all, will zoho automatically know only to send the email once to the duplicate email?
                                  • Time Based Report / Dashboard

                                    We measure our support agent's KPI based on their response time and resolution time from the time the ticket is assigned to them The time based dashboard should provide this information however there is a problem with us referring to this dashboard We
                                  • Zoho Learn API Access?

                                    We love using Zoho Learn to manage our internal trainings and knowledge base. What we'd really love is to be able to query Learn via API so that in Zoho Projects, Zoho Creator, or Zoho Desk, we can recommend relevant Learn articles and manuals to team
                                  • creating buttons in zoho site

                                    the connection between zoho site and zoho learn will be awesome and amazing feature so the user instead of registering himself twice just one time register on zoho site will be enough and creating accout on zoho learn instead of registering on zoho learn
                                  • Two Problems with the Description Field

                                    Our ticket workflow is often like this. Client calls or emails (to a personal email address) reporting a problem. We create a ticket and enter a description. Problems: 1. By my way of thinking when we enter a description, that is an internal comment (unless we mark it public). Yet it seems there is no way to mark it internal, and Desk just starts inserting it into communications. 2. Additionally, in the conversation view it makes it appear it was emailed by the customer and inserts their name on
                                  • Lookup Field limitations

                                    Good day all, Is anyone else frustrated with the lookup field limitation? I have an enterprise license, but I only get 10 lookups. Additionally, the custom module has been available for a while and is still in diapers. If you want good reporting, you
                                  • Automation#36: Auto-create time-entry after performing the Blueprint transition

                                    Hello Everyone, This week’s edition focuses on configuring a custom function within Zoho Desk to streamline time tracking within the Blueprint. In this case, we create a custom field, and request the agent to enter the spending time within the single
                                  • Dynamically Sync zoho.adminuserid with Current App Admin

                                    Hello Zoho Team, We hope you're doing well. We’d like to request an important enhancement to the Deluge sendmail task functionality. As per the current behavior, in most Zoho services (excluding Zoho Cliq, Zoho Connect, Zoho Mail, and Zoho Sheet), the
                                  • "Improper Statement" Error on Deluge Loops (while/for) when Processing a Date Range

                                    Hello, Zoho Community, I'm facing a very specific issue with a Deluge script and would appreciate any insights from the community. The Goal: I have a form (ausencia_visitadoras) where a user inputs a start date and an end date for a period of absence.
                                  • Zoho Meeting iOS app update: Hearing aid, bluetooth car audio and AirPlay audio support.

                                    Hello everyone! We are excited to announce the below new features in the latest iOS update(v1.7.4) of the Zoho Meeting app: 1. Hearing aid support: Hearing aid support has been integrated into the application. 2. Bluetooth car Audio, AirPlay audio support:
                                  • Automating Daily Lottery Result Publishing with Zoho Creator or Flow – Any Best Practices?

                                    Hello Zoho Community, I run a results-based informational website in Brazil called CaminhoDaSorte.com, where we publish daily Jogo do Bicho results. Right now, we're doing this process manually every day — but we’re looking to automate the backend using
                                  • issues with manually shipping sales orders - advise needed please

                                    we are new to zoho inventory. we are going to roll the program out to our company within a couple of weeks and during the implementation process we have come into a roadblock with manually packaging and shipping sales orders. its important to note important
                                  • I do not see the “Lead Forms” option under Integrations

                                    Hi, I’m using Zoho Social on a Premium plan. I’ve connected LinkedIn Company Page and have a valid LinkedIn Ad Account with Lead Gen Forms. However, I do not see the “Lead Forms” option under Integrations, so I can’t enable LinkedIn Lead Generation. Please
                                  • STOCK function showing #N/A! even thought the Stock symbol is valid

                                    Zoho Team, I use STOCK function on Zoho Sheet to fetch the recent Last Closing Price. Some stock symbols are valid but when the STOCK function is applied, it shows #N/A! Attaching an image for reference.
                                  • What’s the Correct Integration Flow Between Zoho Inventory, ShipStation, and Multi-Channel Sales Platforms?

                                    Hi Zoho Community, I’m currently implementing Zoho One to manage all of my business processes, and I’d appreciate some guidance on the correct integration flow for the tools I’m using. Here’s my current setup: Zoho Inventory is my central system for managing
                                  • Beyond Email: #4 Note taking done right with Notes

                                    With her favorite links now saved in Bookmarks, Sarah is feeling even more at home in Zoho Mail. As her day fills up with meetings and project discussions, she often finds herself scribbling quick ideas and reminders—only to lose track of them later.
                                  • When will Sales Order and Invoice Synchronisation with Zoho CRM be Available?

                                    When will Sales Orders and Invoices, created in Zoho Books or Inventory be made available in Zoho CRM? John Legg Owner: The Debug Store
                                  • Generate Unique Customer ID for Each for All Contacts

                                    Generate Unique Customer ID for Each for All Contacts
                                  • Bookings to Books automation using Flow

                                    I'm using Zoho Flow to automate a process between Bookings and Books. When someone uses Bookings to schedule time with me I use Flow to automatically add the person as a customer in books, then create a Quote in Books for the type of consultation they
                                  • Different Canvas for Different account type

                                    I would like to have a separate canvas for Customers and Resellers that auto-applies when I enter an ACCOUNT. Is this do-able?
                                  • IMAP sync issues in Zoho CRM

                                    We are using the Zoho CRM for a while, and we sync (via IMAP) our Google Apps email system. The sync works properly when looking at emails per account, contact or deal, etc. However, it does not function well in the "Messages" and "SalesSigns" features.
                                  • Reporting tags for custom modules

                                    Hi, it could be very useful. At field level and at sub table level. Thanks, Eduardo
                                  • Can't pass Dates and use date filtered Charts in Pages?

                                    I don't mess with pages very much, but I'm trying to build a dashboard. I have a search element and several charts that need to be filtered. I also have a stateless form for a start/end date picker I am trying to use to filter data for the charts. Here
                                  • ZOHO FSM Trial - Assets

                                    Hi I am currently using Zoho CRM and looking at adding FSM. I am trialing FSM at the moment, to potentially move away from my current programme (SimPro) but have a query on the Asset system within FSM It looks like you can only create 1 asset "type";
                                  • Customize User Invites with Invitation Templates

                                    Invitation Templates help streamline the invitation process by allowing users to create customized email formats instead of sending a one-size-fits-all email. Different invitation templates can be created for portal users and client users to align with
                                  • Sending Email with Attachment (PDF, Excel file)

                                    Hi, I'm new to Zoho CRM and I'm setting up a flow to send an Email with Attachment when user reaching a certain stage of a Deal. In detail, I've created a Blueprint which requires user to attach a PDF file when reaching a certain point of the stage and
                                  • A letter to the unsung heroes of the internet

                                    Dear social media marketers, this one’s for you! From the outside, it may look like you're just scrolling through feeds or switching between tabs. But we know better. Team Zoho Social sees the real story. We understand the challenges you face—and we’ve
                                  • Based on the Assign To time task want to trigger also reminder for the task still move form fresh lead

                                    If the leads is assigned To 1 am to 10.55 am task want to create 11am Then reminder want to go the person at 4pm If lead status not moved from fresh lead. From next on wards Reminder want to go 11 Am and 4pm Every day still the person moved to fresh lead
                                  • Emails Not Sending

                                    This has happened before. I contacted Zoho and it seemed to work, but now my emails are not sending or taking a long time to send and half the time attachments don't attach. It just keeps saying Sending... and I have to keep clicking it to make it send.
                                  • Next Page