I am trying to create the magento default REST API for add simple product to cart like this way.
First I generate the customer token with the use of this API Call. https://www.domain.com/rest/default/V1/integration/customer/token And it will successful return the token.
Now with the use of that token, I call another API to added the product to the existing cart like this : https://www.domain.com/rest/default/V1/carts/mine/items
Headers:
Content-Type: application/json
Authorization: Bearer "CUSTOMER TOKEN"
And Pass the parameter as POST
{
"sku": "PO-002",
"qty": 1,
"quote_id": "4"
}
And it always return the error like this :
{
"message": "\"%fieldName\" is required. Enter and try again.",
"parameters": {
"fieldName": "cartItem"
}
}
See the image :
Can any one help me here?
raw
+JSON(application/json)