["error"] => array(2) {["code"] => string(14) "BUSINESS_ERROR"["message"] => string(12) "业务异常"}
文档:https://open.shop.ele.me/openapi/apilist/eleme-product/eleme-product-item-updateItem
本次错误原因:提交原材料参数格式不正确。
正确代码
$materials_object = array();$materials_object["id"] = 18962;$materials_object["name"] = "鸡肉";$properties['materials']= materials_object;
错误代码
$properties['materials']['id'] = 18962;$properties['materials']['name'] = '鸡肉';
如果你也出现这个,认真看下开发文档参数格式。
https://open.shop.ele.me/openapi/debug/eleme-product/eleme-product-item-getIngredientGroup
实在不懂的,可以这样排查。
打开接口测试,修改成功后,把提交参数拷贝到本地,转换成数组格式,再进行对比,就知道是哪里问题了。