Invalid value passed for JSONString

Invalid value passed for JSONString

Hello,

I am developing a React web app that connects to my Zoho Books backend. I can receive information into the app just fine, however, when I make a POST request, I am battling with sending the data required.

It is all in JavaScript and I use the Axios.js library to make Ajax requests, however I am not limited to using axios. I can use JavaScript's own network request capabilities if I have to.

How should I be posting the data into the JSONString using JavaScript? I have tried with a new FormData() instance but nothing works. I always get the same 'bad request' response from the server.

If I have a JavaScript object like this:

const invoice = {
      customer_id: 123456,
      line_items: [
            { item_id: 12345678 }
      ]
};

How should I modify that to make a post request to Zoho Books with that data?