分类
后端

Magento2 rest api customer extension_attributes

# /etc/extension_attributes.xml

<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
    <extension_attributes for="Magento\Customer\Api\Data\CustomerInterface">
        <attribute code="mobile" type="string"/>
    </extension_attributes>
</config>
#请求数据
{
    "customer": {
        "firstname": "222",
        "lastname": "333",
        "group_id": "1",
        "gender":"2",
        "extension_attributes":{
        "mobile":"15980000000"
        },
        "website_id": "1",
        "email": "124124124@qq.com",
        "id": "34838"
    }
}