Can no longer update a product through the API v1 by using JSON


#1

Good morning,

I’m maintaining an application written in C# that synchronize products from SAP Business One to Moltin. After retrieving the product from SAP, I create a JSON with the fields I need to update on Moltin and I perform a PUT on https://api.molt.in/v1/products/ (with the Moltin Id of the product).

As a result, I receive no error code, just like if the update was performed. Additionally, I can see (by querying the product on the Moltin API) that the field updated_at was successfully modified when I launched my application. However, none of the fields and their values (as indicated in the JSON) were updated.

Here’s an example of what I transmit in JSON:
{ “title”:“TEST”,“slug”:“TRUC”,“sale_price”:1000 }

Once I filled my JSON, I set the parameters of your API with the token and the format of the transmitted data. I also convert my JSON into an encoded (in UTF8) array of bytes. I query your API and collect the answer.

Could you indicate me what is the correct JSON format used by the API please?

Thank you in advance.

Best regards,
Frédéric


#2

Ok, I answer to my own question if someone gets the same problem: There’s no need of indicating the flow as “data” or anything. The JSON format I mentioned above is enough. However, be careful of any missing characters, since the API will interpret the whole thing as one field.