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

                                  • two columns layout

                                    it's actually frustrating to not have this feature, I actually had to convince my employer to subscribe to zoho forms and integrate it with zoho crm, but because of this feature not beeing provided, our forms looks unnecessarly long and hideous. 
                                  • Sync Zoho Desk Help Center Category Icons to SalesIQ Articles

                                    Dear Zoho SalesIQ Team, Greetings, We are using the integration between Zoho SalesIQ and Zoho Desk to sync articles from our Zoho Desk Knowledge Base into SalesIQ. While this integration works well for syncing article content, we’ve noticed a visual inconsistency:
                                  • Company Name not pre-populating when using Quick Create: Contact

                                    Hi Devs, This has bugged me for a long time, and it's a simple UX design change to solve it. Problem: Users creating Contacts not linked to Companies/Accounts Cause: When a user creates an Opportunity where after browsing the Contacts they realise they
                                  • Spell Checker in Zoho desk

                                    Is there a way to set always check spelling before sending? Outlook does this and it is a handy tool to avoid typos
                                  • Enable Sync of SalesIQ Article Interactions to Zoho Analytics for Unified Knowledge Base Reporting

                                    Dear Zoho SalesIQ and Zoho Analytics Teams, Greetings, We’d like to formally request an enhancement to enable SalesIQ article interaction data to be synced with Zoho Analytics, so that we can obtain a unified view of our knowledge base performance metrics
                                  • How to enter membership share, sold or reimburse

                                    Hello, First, I am just begining taking care of the accounting of my organisation, and new also to Books. In Books, our accounting plan has an account #3900 - Share capital, that cumulates the share our member pay. How do I write a sale or a reimbursement
                                  • Ability for me to take the issued PDF certification on successful completion of a course then push to zoho sign in order that it is digitally certified

                                    How can I take the issued PDF certification on successful completion of a Zoho Learn course then trigger a workflow to push to Zoho Sign in order that it is digitally certified, hosted on the blockchain and then push to Zoho Workdrive to be hosted off
                                  • Candidates rejection process

                                    Is there a way to get ZOHORecruit to automatically send out an email to candidates that are rejected?
                                  • Multi file upload

                                    Hi, I just wonder if one could upload multiple files in one shot, say between one and three files, without adding multiple File Upload fields? Thanks, Alalbany
                                  • Passing the image/file uploaded in form to openai api

                                    I'm trying to use the OpenAI's new vision feature where we can send image through Api. What I want is the user to upload an image in the form and send this image to OpenAI. But I can't access this image properly in deluge script. There are also some constraints
                                  • Calendar Year View?

                                    Is there a way I can view the calendar in year view? Maybe create a page with a view like this?
                                  • ABN Amro

                                    Hi, We are trying to add Abn AMRO as a bank in Zoho Books. However we get the following error: Type of Error: User Action Required Description: The request cannot be completed because the site is no longer supported for data updates. Possible workaround: Please deactivate or remove the account. Suggested Action: The site will no longer be supported by Zoho Books and should be removed. Does that mean it's no longer supported? Thanks!
                                  • Add bank transfers via a webhook or API

                                    Hello ZOHO Books Community, is there anyway to add single transactions to bank accounts via an API or webhook? I found in docs to upload a bank statement. But i want to add a transaction from an external (unsupported bank) in the moment there is a transaction
                                  • Books does not allow 19% tax rate for invoice - Please help!

                                    Hi there, I need to do an import of invoices into Zoho Books. The process worked smoothly before we migrated to the Books Germany Edition in December 2024. It does import 13 out of 14 invoices from my csv-file. For the one it does not import I get the
                                  • When will Zoho Books offer native NFS-e issuing, now with Brazil's National Standard?

                                    Hello Zoho Team and Community, I'd like to follow up on my previous suggestion regarding the critical need for Zoho Books to natively issue Brazilian Service Invoices (NFS-e). My original idea was that this could be achieved by extending the same integration
                                  • API 500 Error

                                    Hello amazing ZOHO Projects Community, I get this message. How can we solve this? { "error": { "status_code": "500", "method": "GET", "instance": "/api/v3/portal/2010147XXXX/projects/2679160000003XXXX/timesheet", "title": "INTERNAL_SERVER_ERROR", "error_type":
                                  • Admin Access to Subscriber Information for System/Default Bots in Zoho Cliq

                                    Dear Zoho Cliq Team, Greetings, We would like to request an enhancement to Zoho Cliq's bot management capabilities. Specifically, we are asking for the ability for organization administrators to view the list of subscribers for system/default bots, such
                                  • zoho webmail keeps opening an empty tab when on log in/vist webmail

                                    as the the title says, whenever i log in or visit the page in a new tab, zoho webmail with open a new tab, but it errors out (see attachment). how do you stop it from doing this?
                                  • FSM work order creation on books quote approval

                                    I have followed https://help.zoho.com/portal/en/kb/fsm/custom-integrations/zoho-books/articles/perform-actions-in-zoho-fsm-on-estimate-approval-in-zoho-books#Step_1_Create_a_connection_for_Zoho_FSM_in_Zoho_Books in order to create a work order in FSM
                                  • How to View Part Inventory and Warehouse Location When Creating a Work Order in Zoho FSM

                                    Hi everyone, We’re currently setting up Zoho FSM and would like to improve how our team selects parts when creating a Work Order. Right now, when we add a part or item to a Work Order, we can select it from our Zoho Inventory list but we don’t see any
                                  • Tip of the week #46 - Stay more organized by moving threads between inboxes

                                    Have you ever come across a thread in your inbox that should have been handled by a different team or inbox? Or maybe you've wrapped up your part of the conversation, but another team needs to step in to finish the task or assist further? Keeping such
                                  • Desktop app doesn't support notecards created on Android

                                    Hi, Does anybody have same problem? Some of last notecards created on Android app (v. 6.6) doesn't show in desktop app (v. 3.5.5). I see these note cards but whith they appear with exclamation mark in yellow triangle (see screenshot) and when I try to
                                  • Text summarization and field detection with Zia, Zoho's AI assistant

                                    Have lengthy documents that take forever to read and sign? Tired of placing fields into hundreds of pages? Here's a single solution to solve both challenges: Zia, Zoho's AI assistant. With Zia's integration with OpenAI, you can summarize long documents
                                  • Sending Links to Functions in CRM

                                    Maybe I'm crazy, but currently there's no way to send someone a link to a custom function. The only link you can get is to the myfunctions page, which is very frustrating. This should work like workflow rules where when you click on one, it should have
                                  • zohoからの自動メールについて

                                    zohoからの自動メールにおいてちょっと困ったことが起こっており、サポートにも相談中なのですが ほかの方にも同現象が発生していないか相談したい。 ▼事象 zohoからの自動メールにおいて時折「このメールが送信者からのものであると確認できないため、このメールに安全に返信できない可能性があります」とメーラーから警告が出る。 ▼状況 発信元:設定した独自ドメイン SPF/DKIM設定:済 利用メーラー:outlook 発生頻度:稀(連続するときもあるが、パタッとでなくなる時もある) サポートへの連絡:ただいま継続相談中
                                  • Using Deluge scripting to create/update data in TabularSections

                                    I am having following Form structure with some other usual fields, and a tabular section which allows putting question, self rating and lead rating. (pic below) I am trying to create a record of this form via Deluge, but can't figure out way to populate
                                  • Zoho Recruit: How to link lookup fields using record ID instead of name during import?

                                    Hi, I'm having an issue with lookup fields in Zoho Recruit during data import. When I import records into a module that includes a lookup field (e.g., to an Interview record), Zoho Recruit matches the lookup by the display name (string) instead of the
                                  • Add a "Success" Route to the "Forward to Operator" Card in Zobot

                                    Hello Zoho SalesIQ Team, We hope you're doing well. We would like to request an enhancement to the "Forward to Operator" card in Zobot. Current Limitation: At present, the "Forward to Operator" card provides the following routes: Operator Not Available
                                  • Power of Automation :: Auto-update Project status based on Tasklist completion

                                    Hello Everyone, A Custom function is a user-written set of code to achieve a specific requirement. Set the required conditions needed as when to trigger using the Workflow rules (be it Tasks / Project) and associate the custom function to it. Requirement:
                                  • Multi Module Lookup Fields

                                    🎯 Use Case: In many custom implementations, especially those involving financial tracking, service operations, or project-based work, a single record (e.g. an invoice or bill) often relates to one of several different modules — but only one at a time.
                                  • How to Download a File from Zoho WorkDrive Using a Public Link

                                    How to Download a File from Zoho WorkDrive Using a Public Link If you're working with Zoho WorkDrive and want to download a file using a public link, here's a simple method to do so using API or a basic script. This approach helps developers or teams
                                  • Facturation électronique 2026 - obligation dès le 1er septembre 2026

                                    Bonjour, Je me permets de réagir à divers posts publiés ici et là concernant le projet de E-Invoicing, dans le cadre de la facturation électronique prévue très prochainement. Dans le cadre du passage à la facturation électronique pour les entreprises,
                                  • Introducing AI Modeler—a no-code approach to adding AI to your business applications

                                    Forward-thinking businesses today are embracing AI to make life easier for themselves, their employees, and their customers. But if you haven't started yet, you might be concerned that your business will be left behind. Or maybe you're worried because
                                  • Tip #20 - Three things you probably didn't know you can do with picklists

                                    Hello Zoho Sheet users! We’re back with another quick tip to help you make your spreadsheets smarter. Picklists are a great tool to maintain consistency in your spreadsheet. Manually entering data is time-consuming and often leaves typos and irregular
                                  • Zoho People how do i view the history of leave taken

                                    Hi All What is the report that i am unable to view the history of the leave taken for an individual and team?
                                  • UK Registration for VAT with existing stock/inventory

                                    We have an existing inventory of stock and are investigating how to handle the conversion from a UK VAT unregistered company to a UK VAT registered company. Enabling VAT registered status looks extremely easy, but we cannot find any way within Books to
                                  • Trigger action after workflow

                                    I would like to trigger a deluge function after the approval workflow is complete. Is this possible? The objective is to take the approved document and move it over to Zoho Contracts to send out to our customer for review and signature. The reason we
                                  • Is it possible to create a meeting in Zoho Crm which automatically creates a Google Meet link?

                                    We are using Google's own "Zoho CRM for Google" integration and also Zoho's "Google Apps Sync" tools, but none of them provide us with the ability to create a meeting in Zoho CRM that then adds a Google Meet link into the meeting. Is this something that
                                  • Unable To Enable Google Calendar Sync

                                    Hi Folks, I am unable to enable google calendar sync. I get Internal Error, Problem Occurred Internally. Screenshot attached. How do I solve this?
                                  • Export to Zoho CRM Not Triggering Workflow Rules

                                    Hello, I have set up an automated export from DataPrep to Leads in CRM but none of my Workflow Rules are triggering once the leads are created. The Timeline history is completely empty in every lead. How can I fix this issue? Do I need to set up a Schedule
                                  • Next Page