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