What is the difference between using \Magento\Catalog\Model\ProductRepository and \Magento\Catalog\Api\ProductRepositoryInterface?
Which one is better and recommended to use?

  • API folder used for handle Interface related classes,contains any PHP classes exposed to the api & Model use to handle module related logic & Datamodel (CRUD) Commented Jan 22, 2018 at 7:07

1 Answer 1


I am not 100% deep knowledge of this.

But i am pretty sure that you should use


As it can use for both api and model layer

See the magento document:



How to implement service contract for a custom module in Magento 2?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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