How to add multiple products to cart using Shopify API?

let formData = {
'items': [{
'id': {{ product.variants.first.id }},
'quantity': quantity
}]
};

await fetch('/cart/add.js', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(formData),
})
.then(data => {
window.location.href = '/cart';
}).catch(error => {
console.error('Error adding item to cart:', error);
});

The code above is working on the product page and it’s working fine but when i add to formData another product the cart is empty and it doesn’t work even if i just change the current product ‘id’: {{ product.variants.first.id }}, with another one it does not work.