Looping through a list and doing math

Hi, Can I know the best way to iterate through a list and do operations on the values from each index of the list. Is there any built-in functionality or please suggest a best plugin.
My use case is, I need to decrease the stock for every item in every order created.

Backend api workflow on a list

The API Workflow is accepting only Bubble data types. But I am using data from external data source. Please advice how to handle a list and update items within a list where the data type is external DB

Set the api workflows parameters as the objects fields and pass them as text.

Can you please explain in detail…?