AJAX API - Add items to cart, order of items changed

@jtaylormatchles @Liam I am experiencing similar behaviour. I am following the documentation of the Cart API to add multiple items to the cart with one click. When I started experiencing the issue within my theme, I decided to test this manually by entering the same code from my theme into my browser console, effectively bypassing any other apps/processes. Here is my code for comparison:

fetch(Theme.routes.cart_add_url + ".js", { method: "POST", headers: { "content-type": "application/json", accept: "application/json" }, body: `{"items":[{ "id": "45473501315388", "quantity": "1" }, { "id": "45473501348156", "quantity": "1" }]}`})

I have attached screenshots of the request and response, both which indicate a successful addition to the cart (note the order of the items)

Next, I manually fetch the contents of the cart with the following code:

fetch(Theme.routes.cart_url, { headers: { "accept": "application/json" }})

Here is the response from the server (note the order of the items has changed)

Since I am entering the same code used by theme manually, what could be causing the order of the items to change server side? I am testing some Cart Transform and Discount Functions, but the apps are not running, so they can’t be affecting this behaviour.

Any insights as to what might be causing this would be greatly appreciated.