Invalid json payload. Please check json input

javascript

#1

While adding a product to a cart

{ "data" : [{ "type" : "cart_item", "id" : "9bdc8b19-24b2-433f-888d-8c0b43570f97", "quantity" : 2 }] }
I’m getting the following error :-

{ "errors": [ { "status": 400, "source": "request", "title": "Bad Request", "detail": "Invalid json payload. Please check json input" } ] }


#2

Hey jintukumardas,

Your payload has an array - adding items requires an object…

remove the [] from the data and you should be good to go.


#3

Thank you so much. Its working perfectly now :slight_smile:


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.