POST /cart/add.js returns error 500

Hello there,
I got 500 internal server error when using post cart add.js.
I wrote like that page, Example API calls.
https://shopify.dev/api/ajax/reference/cart

Could you tell me how to fix?

my code is

fetch(window.Shopify.routes.root + 'cart/add.js', {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json'
      },
      body: JSON.stringify(toSend)
    })
    .then(response => {
      console.log(response.status);
      response.json;
    })
    .then(data => {
      console.log(data);
    })
    .catch((error) => {
      console.log('error:', error);
    });

Sorry, I found the mistake…

that was ‘toSend’. toSend has to be the array.