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 update task start date when project start date changes?

                                    Hi there, When the start date of a project changes, it's important to update the start dates of the tasks associated with that project to reflect the new timeline. Is there a way to shift the start date of all project tasks when the start date of a project
                                  • ZOHO DESK | SET PERMISSION NOT TO ALLOW SPECIFIC AGENTS TO CREATE TICKET

                                    Hi Zoho Team, I have a question regarding this: "Team Desk are the ones to have the permission to create a ticket, Team OPS resolvers must not create a ticket." - How to set permission to Team OPS resolvers for not creating a ticket? Only Team Desk should
                                  • On success Workflow not triggering from external Zoho Form submission

                                    Hello everyone, I'd really appreciate your help. I'm building a system, where I'm using Zoho Creator as a crm/spreadsheet to manage movements of inventory. I have 3 "forms" or tables, where one is a main table for obersving status on all inventory, another
                                  • Add Comprehensive Accessibility Features to Zoho Desk Help Center for End Users

                                    Hello Zoho Desk Team, We hope you're doing well. We’d like to submit a feature request to enhance the client-facing Help Center in Zoho Desk with comprehensive accessibility features, similar to those already available on the agent interface. 🎯 Current
                                  • Tax is missing in expense unable to submit report

                                    Im getting the above error when submitting a report with an expense. Its complaining about the Tax is missing but there is no Tax area just "Amount". And if I try to Itemize the amount to break out the tax portions with the initial product portion it
                                  • Time-based Automations updates does not trigger Webhook

                                    Hi, When a ticket is updated by Time-based automation, it doesn't seem to trigger the webhook event. I looked at the ticket history for the problematic tickets, they were all changes made by action with this label: `Ticket was updated through a Time-based
                                  • Can't find parent child ticketing

                                    Hi I can't find parent child ticketing under tickets in this new organization... I have in the past on other organizations
                                  • Filtering Parent and Child Tickets in Analytics

                                    Hello Zoho Support Team, We’ve noticed that when checking our ticket analytics in Zoho Desk, the data merges both parent and child tickets for key metrics like the number of new tickets, closed tickets, and first response time. This results in inaccurate
                                  • Link Zoho Inventory Sales Order with Zoho Desk Ticket

                                    I'd like to, in a Zoho Inventory Sales Order, see linked/related Zoho Desk tickets. When I'm in Zoho Desk, I can look up related tickets to the sales order, but I can't seem to do it in the reverse manner (where when I'm in a Zoho Inventroy Sales Order,
                                  • Shopify integration

                                    I need to integrate Shopify with Zoho Books
                                  • Function #32: Schedule low stock notifications on a timely basis to specific users of the organization

                                    Hello everyone and welcome back to our series! For a business that heavily relies on inventory, monitoring the stock levels and getting timely notifications of low stock items will ensure a smooth sail. Zoho Books allows you to always keep a check on
                                  • Can't type latin characters Mac x Windows

                                    I access a Win XP machine using Chrome on Mac OS X High Sierra and I can't get special characters like á é ó â ê ô ã õ à í ú to work. I tried a few different keyboard layout setups, but nothing worked. I end up having to type a lot of stuff in a local notepad for further copy and paste, which is not convenient at all. Am I missing anything? How can I make this work? Thanks.
                                  • Zoho People & Zoho CRM Calendar

                                    Hi, Does anyone know if it is possible to link Zoho People and the calendar in CRM? I would like when holidays are approved they automatically appear in the calendar on CRM. Thanks 
                                  • How to add Leave Type Permission Start Time

                                    Hi, I have a requirement to add Leave Type : Permission Start Time on the email template to which is end to the reporting manager. But I am unable to find the field in the list of fields. How to achieve this?
                                  • How to get batch number of item by api?

                                    Hi there, Is there any way to get batch number of item by api? Batch number is the batch reference number in https://www.zoho.com/inventory/help/advanced-inventory-tracking/batch-tracking.html . When I call the https://www.zoho.com/books/api/v3/#Items_Get_an_item
                                  • Questions about ACH in Zoho Billing

                                    We have ACH enabled for subscriptions in Zoho Billing and we have the option enabled for users to be able to log in to their bank to add the account to their payment methods. Questions: 1) If the user's bank isn't supported via the log-in method, will
                                  • Zoho Writer Default Publish Setting for Mail Merge

                                    Hello, I was thinking of using Mail Merge to create documents from CRM and automatically link them. However, I noticed the "publish" function and it seems the default is "to the world". This creates some anxiety as it is not clear what this "to the world"
                                  • Contacts Profile

                                    Is there a way to add a picture to my contacts profile? You have an outline of a person but no way I can see to import a picture.
                                  • Tip 46: View resource allocation while adding or editing tasks

                                    Keeping track of employees workload can be daunting but also necessary. Overloading employees with work can cause burnout and reduce productivity.  Managers should be able to identify resources who are less engaged when assigning tasks. This will ensure a balanced workload and also improve employee's efficiency. Zoho Projects lets you identify resources who are available to take up a job when you add or edit a task.  ​ Assign the task to team members and the calendar in the Start Date field will display
                                  • Switching Between Multiple Zoho One Organizations in New UI

                                    Here’s a polished version in English that you can use on Zoho’s support or community forum: Subject: Switching Between Multiple Zoho One Organizations in New UI Hello Zoho Community / Support Team, I’m currently managing two independent Zoho One organizations.
                                  • .ds import error from .ds file

                                     Problem encountered while creating the application Exception occured while publishing message to the topic :: [DataModelTopic]
                                  • Fully functional FSM workflow

                                    I am using Books, FSM, Begin and Desk. At this moment, FSM is not fully functional even on its own. For example, Customer A buys 4 air-cons and 3 brackets from us. We are fine to create WO manually in FSM. This should be the full loop for a FSM workflow:-
                                  • Connect Woocommerce new order to zoho books via zoho flow

                                    Hello i want help to create a flow to create a new sales order from woocommerce to zoho books. Can someone send me step by step flow, functions and fields?
                                  • What's New in Zoho Invoice | April - June 2025

                                    Hello everyone! We're excited to share the latest feature updates and enhancements we've made to Zoho Invoice from April to June 2025. In this, you will learn more about the following features: New Integrations via Zoho Marketplace Add Images to Email
                                  • PROJECTS - More flexibility with task and pricing

                                    Hi Everyone, I would like to use PROJECTS in my Zoho Booking app but it does not fit into my business. For example: I charge per sessions fixed price. My session usually are 2 hours and I bill the customer on the end of the month. My session can have
                                  • Is it possible to change default payable account for a bill?

                                    We have a case where we need to change a bill account from the default accounts payable to another account (it can be current asset or current liability, depending on the case). However, Zoho Books has set default account for bills, (accounts payable)
                                  • how to upload a reviewed price list in zoho to replace the existing price list

                                    Price list upload for my zoho books
                                  • Company details and emails

                                    Our company has recently been rebranded and we have new email address - How do I update information for users. I have tried to re invite users with new email but it sends me to organization and there is no where I can change the email or invite with new
                                  • Linking Resale Certificates to Customer Locations

                                    Florida Resale Certificates must be on every customer invoice. We have customers with multiple locations and each location has a seperate FL Resale Certificate. The FL Resale Certificate makes the transaction EXEMPT from Sales Tax. Can FL Resale Certificate
                                  • Notebook App Not Opening

                                    I love this app but for the last 2 days it recuses to open. My phone tells me the app is bugged and I must wait for a new update. Is anyone else having this problem or is something going on with me? I have many important notes that I can't necessarily
                                  • Admin and Dispatcher Users show as Field Technicians in Dispatch Module?

                                    Hi Zoho, Our Admin and Dispatch user both show up as Fied Technicians / Field Agents in the Dispatch module, but they most certainly should not be assigned to any of the work orders and service appointments. These users are NOT service resources. How
                                  • Copy Sales Order Reference# to Purchase Order#

                                    Hello, We use our customer's purchase order number as the order number on our purchase order to the supplier.  We direct ship everything from our suppliers and the customers then see their PO number on the packing notes (instead of a sequentially-generated one). Therefore, is it possible to use automation to copy the Sales Order Reference# (customer PO) to the respective Purchase Order# (our PO) when converting the Sales Order to a Purchase Order?
                                  • Free webinar: Zoho Sign in Q2 2025: A quick walkthrough

                                    Hi there! We’re halfway through the year—and Zoho Sign has some exciting enhancements to show for it! Join us in our upcoming webinar to discover what's new and what you can look forward to. What will this session cover? Explore the newest features introduced
                                  • Using a Webhook as an Action

                                    I have been able to setup where I can use a webhook as a Trigger, but I am wondering how I can use a webhook as an Action. In the Zoho Flow Builder when using Zoho CRM as a trigger, I do not see a way to invoke a URL to POST json data that can be used
                                  • Adding commas to a numeric value

                                    Hi, I want to add commas to numeric values so that they look like money E.g 1234.56 to 1,234.56 12345.67 to 12,345.67 12345678.90 to 12,345,678.90 How do you do that in Deluge? Thanks for the help
                                  • Pushing Zoho People leave into Microsoft calendar: how to chose how "event" is shown (busy, free etc)

                                    Hi, how can I select how a "leave" event is pushed into Microsoft calendar? I want for leave "working elsewhere" to show as working elsewhere and NOT as busy.
                                  • Custom Bulk Select Button

                                    Zoho CRM offers the ability to select multiple records and invoke a Custom Button This functionality is missing from Recruit Currently we can only add buttons in the detail page and list But we cannot select Multiple Records and invoke a function with
                                  • Tiktok and Instagram Carousel with Music

                                    Is it possible to add music or sound (can be downloaded or uploaded or attached) when we upload carousels in IG and Tiktok?
                                  • [Product Update] Locations module migration in Zoho Books integration with Zoho Analytics

                                    Dear Customers, As Zoho Books are starting to support an advance version of the Branches/Warehouses module called the Locations module, users who choose to migrate to the Locations module in Zoho Books will also be migrated in Zoho Analytics-Zoho Books
                                  • Once again, non-admins can no longer revise the site map

                                    Not sure when this change happened, but it's a problem now. This appears to be a regression on this issue: https://help.zoho.com/portal/en/community/topic/bug-non-admins-can-no-longer-revise-the-site-map ... which was solved. That issue was also a regression.
                                  • Next Page