cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2 how can i add custom functionality to rest API rest/v1/products/:sku | PUT

Magento 2 how can i add custom functionality to rest API rest/v1/products/:sku | PUT

 I want to add custom functionality to this API like when this API hit wants to delete all previous tier price records of this product. Can anyone help me to achieve this?

1 REPLY 1

Re: Magento 2 how can i add custom functionality to rest API rest/v1/products/:sku | PUT

Hello @rohanks22296e0 

 

Yes you can customize functionality of rest API by override below model function:

 

vendor/magento/module-catalog/Model/ProductRepository.php

You need to override public function save(ProductInterface $product, $saveOptions = false) in your custom module.

 

It may help you!
Thank you

 

Problem solved? Click Accept as Solution!