Fetch All Items Invoice Zoho Books

Fetch All Items Invoice Zoho Books

Hi Team - how do I fetch all the line items in an Invoice in Zoho Books. Do I have to write a custom function to get all the items in a particular invoice?

If I am writing a custom function, is this the way to start?

itemslist = invoice.get("line_items");
for each  items in itemslist

Can you please advise how to get line items?