Magento 2 REST API 文档解释了在更新或创建客户时设置custom_attributes 的方法。http://devdocs.magento.com/swagger/index_20.html#/ http://devdocs.magento.com/swagger/index_20.html#/
不幸的是我无法让它发挥作用......
我的 POST 和 PUT JSON 请求数据是:
{
"customer": {
"custom_attributes": [
{
"attribute_code": "firstname",
"value": "TEST"
}
],
"email": "[email protected] /cdn-cgi/l/email-protection",
"extension_attributes": [],
"firstname": "Someone",
"gender": null,
"lastname": "Else",
"middlename": null,
"taxvat": null,
"website_id": "1"
}
}
客户已创建,但名字不是“TEST”。
有没有人遇到同样的问题并解决了?请让我知道如何做。
我最好的猜测是,因为Firstname
是现有的开箱即用属性 - OOTB 属性名称-值映射分配将优先。
您可以使用唯一的自定义属性名称(即不与 OOTB 属性名称冲突的名称)重试吗
您需要先定义自定义客户属性,然后才能使用 M2 API 对该自定义客户属性执行操作。
这个 StackExchange 线程 -https://magento.stackexchange.com/questions/88245/magento2-create-a-customer-custom-attribute https://magento.stackexchange.com/questions/88245/magento2-create-a-customer-custom-attribute- 有关如何设置自定义客户属性的附加信息。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)