我在我的Cordova应用中使用woocommerce rest Apis,在“添加到购物车”部分中,api是:
https://{websit_url}/wp-json/wc/v2/cart/add?consumer_key={key}&consumer_secret={key2}
通过api的json正文是
{
"product_id":"3022","quantity":"1","variation" : {
"size" : "small",
"color": "blue"
}
}
在上述情况下,我得到了错误
{
"code": "rest_invalid_param",
"message": "Invalid parameter(s): variation",
"data": {
"status": 400,
"params": {
"variation": "Invalid parameter."
}
}
}
我该如何解决?