Passing Order from iOS to backend

I again appreciate the help as I try and navigate learning the backend coding. I believe I am finally beginning to understand the concept. I’m just looking to get some advice if I’m moving in the right direction.

My plan is to place an order and charge a card through the backend. I’ve got the quick start’s backend code up and believe this is a way to go about building the line item to send through the API.

function getOrderRequest() {
  var num;
  for ( num =0; num < totalItems; num++){
    line_items: [num]=
    {
      name: requestBody.name[num],
      modifiers: requestBody.modifiers[num],
      quantity: requestBody.quantity[num],
      base_price_money:{
        amount: requestBody.amount[num],
        currency: "USD"
      }
    }
  }
  return {
    idempotency_key: crypto.randomBytes(12).toString('hex'),
    order: {
      line_items: []
    }
  }
}

And I would pass the name, modifiers, quantity, etc in array’s inside httpBody function in swift i.e.

let json = ["nonce": nonce, "name": [item1, item2, etc], "modifiers": [mod1,mod2,etc]

I am unable to test until I get my new macbook in a week or so and can test with an updated version of swift and xcode

Once you get through testing, if you have any questions, please feel free to ask here in the forums.