Running incorrect javascrpt script on Parse Server

I created the tables on the Parse Server and installed the b4a application on my Windows operating system and configured it correctly to be able to deploy it from my computer. Then I created a file with the command b4a new, and I wrote the following lines of code.

Parse.Cloud.define("create-product", async (request) => {
    const stock = request.params.stock;
    if(stock == null || stock > 999) throw "Quantidade inválida";
    const product = new Product();
    product.set("name", request.params.name);
    product.set("price", request.params.price);
    product.set("stock", request.params.stock);
    product.set("isSelling", false);
    const savedProduct = await product.save(null, {useMasterKey: true});
    return savedProduct;
});

And then run the b4a deploy command to send the code to the server.

After I did that, I decided to perform the test and the result was the one below

It wasn’t supposed to cause this problem, can someone please see where I went wrong?

How are you sending this request? Via REST API? Could you please share the curl command that you are using? I guess stock is null on the cloud code function for some reason. You can also try to console log it to make sure.

Thus.

In the Parse Server table the price field is mandatory

If you could export a curl command it might be easier to understand and help. Otherwise, could you share the request headers? I guess it is missing "Content-Type: application/json". Reference: REST API Guide | Parse