How do I migrate to the new line_items structure to use Headers via API?
You can add headers as rows in the Item Table when you create transactions in Zoho Books. Headers add a title to group related items.
You can add headers in the following transactions:
Sales: Quotes, Sales Orders, Sales Receipts, Invoices, Recurring Invoices, and Credit Notes.
Purchases: Purchase Orders, Bills, and Vendor Credits.
Previously, for API users, every entry in the line_items array represented a regular item. The same array now also includes header rows, identified by a new field called line_item_category. Items and headers are ordered by item_order.
If you want to create, update, or read transactions with headers via the API, update your payloads to the new structure.
Insight: This migration is needed only if you want to use headers via the API. Your existing integrations will continue to work without any changes.
Key changes in the line_items structure:
line_item_categoryacceptsheader. Regular items can omit this field.item_ordersets the position of the row in the Item Table.- Header rows need only
description,item_order, andline_item_category: "header". - GET responses include header rows in
line_items. If your code assumes every entry is an item, add a check online_item_categoryto skip or handle these rows.
Note:
Refer to the Zoho Books API docs for the updated line_items schema. For further assistance, reach out to our support team at support@zohobooks.com.