Warenkorb API scheint nicht zu funktionieren

Hallo Community,

ich würde gerne Shopware als Headless System benutzten und teste dafür die Cart-API.
Hierzu habe ich folgendes testscript geschrieben:

async function postData(url = '', data = {}) {
    const response = await fetch(url, {
      method: 'POST',
      mode: 'cors',
      cache: 'no-cache',
      credentials: 'same-origin',
      headers: {
        'sw-access-key': 'SWSCD0PCVVLNZ3PMOUPWNNVBQQ', //lokale vm
        'Content-Type': 'application/json'
      },
      redirect: 'follow',
      referrerPolicy: 'no-referrer',
      body: JSON.stringify(data)
    });
    return response.json();
  }

async function testmethod(){
    const createCartEndpoint = "http://localhost/store-api/checkout/cart";
    const response = await postData(createCartEndpoint, {name: "some-cart-name"});
    console.log("first: ");
    console.log(response)
    return response.token
}

async function postCart(url = '', data = {}, token) {
    const response = await fetch(url, {
      method: 'POST',
      mode: 'cors',
      cache: 'no-cache',
      credentials: 'same-origin',
      headers: {
        'sw-access-key': 'SWSCD0PCVVLNZ3PMOUPWNNVBQQ',
        'sw-context-token': token,
        'Content-Type': 'application/json'
      },
      redirect: 'follow',
      referrerPolicy: 'no-referrer',
      body: JSON.stringify(data)
    });
    return response.json();
  }

async function addItemMethod(token) {
    const addItem = "http://localhost/store-api/checkout/cart/line-item";
    let product = {
        "type": "product",
        "referencedId": "b99fd1d942d147dfa4fa709f818e4009",
        "quantity": 2
    }
    const response = await postCart(addItem, product, token);
    console.log("after adding: ");
    console.log(response)
}

async function start(){
    const token = await testmethod()
    console.log(token)
    addItemMethod(token)
}

start()

In der Konsole habe ich dann leider Festgestellt, dass bei den 2 Einkaufswagen das „token“ gleich ist, jedoch der name sich ändert und keine Items im Wagen zu finden sind. In der Doku kann ich leider nichts mehr finden.
Habt ihr ggf. eine Idee?

LG,
Rosario