Having referred couple of videos on AL with JSON and reading 1-2 community Q&A here, I still haven't figured out the correct way to read multiple line items from a Invoice record, which is being fetched into Business Central via an API.
Notes:
1. Read from the Response text, the first node, which starts with 'list', Invoice header is entered successfully
2. Each header now has multiple "line_items" associated
3. For some reason, my AL code is unable to fetch/read/recognize "line_items" array from the Response Text, but successfully recognizes "list" array. Only the header record in BC is created successfully with no lines associated
Present Outcome: Can read & insert header values, but cannot locate/read line values from the API, due to nested API
Expected Outcome: To be able to fetch each line_items "ID" and corresponding line_items data in a loop and insert all the line_items values into a table, whenever each/single header is inserted
Below Images showcase, 1-2 AL code trials which I have conducted, all with no positive results. Also pasted image of the Incoming JSON structure
I know I am doing something incorrect, either logically or syntactically. Community, please advise / assist




Stefano Demiliani waldo Marco Mels ajkauffmann yzhums Nitin Verma