Zoho Inventory // Lineitems from sales order

Zoho Inventory // Lineitems from sales order

Hi There, 

Hope I haven't missed something obvious (as a newbie). 

When a sales order is created, I am trying to loop through the line_items and then trigger a fetch product to search for item (based off the line_item_id) and see if it is a composite item, and then if so use the create bundle to create it (based off the composite_item_id from the Sales order.)

Wondering if anyone can provide guidance on how to get line item's.