1
如何使用REST API更新/添加客户的EAV属性?Magento 2.1使用REST API更新客户自定义EAV属性
我试图做使用[PUT] /V1/customers/{id}
这个URL
http://<website>/rest/V1/customers/1
它,并以此为主体数据:
$data = array(
'customer' => array(
'id' => 1,
'email' => '[email protected]',
'firstname' => 'John',
'lastname' => 'Doe',
'website_id' => 1,
'custom_attributes' => array(
'attribute_code' => 'my_custom_attribute_code',
'value' => 'my_custom_attribute_value'
)
)
);
我能够编辑客户的默认属性,例如firstname
和lastname
但我还没有能够编辑EAV属性。
是否可以使用默认的customerCustomerRepositoryV1
接口来完成? 如果不是,您如何扩展以便可以编辑/添加客户的EAV属性?
谢谢。
Magento的2.1 REST API接口: http://devdocs.magento.com/swagger