Need assistance with Twilio Gather for cart input

I am trying to create a Twilio script for iterative input collection using the Gather verb to confirm or remove items from a shopping cart.I would appreciate a more detailed code example, including session or state management in the context of this flow.
Basically,I need to collect content from a website using a webhook and then use twilio and say there are these many items and allow the user to confirm the item one by one and record the user responses and store it in excel.The workflow used is shown in the pic..I would like to get a detailed explanation on it..The received cart items are also shown but it not fixed it will change.