I would like to add new API to Magento Customer module -> AccountManagementInterface.

I have created my custom module but I don't know how should my di.xml be written?



You just need to add below code in di.xml

<?xml version="1.0"?>
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Customer\Api\AccountManagementInterface"
                type="Vendor\ModuleName\Model\Myaccountmanagement" />

Add your vendor and modulename in above code

Using above code you can implement AccountManagementInterface in your module which is defined in di.xml

| improve this answer | |

You should not extend Interfaces of other modules. Just add new calls in your.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.