Magento 2 CatalogProductRepositoryV1SaveRequest not available in API

When you’re starting out with the Magento 2 API in c# (c sharp) you’ll notice it’s quite different from the previous version.

The API has been split up into different pieces to, among other things, address security concerns. This means you’ll probably need to add several Service References to get the job done.

My goal was to insert products trough the Web API. To my surprise it seemed the CatalogProductRepositoryV1SaveRequest method was missing from the service…

I have not found any other solution than to override security in the file /vendor/magento/module-webapi/Model/AbstractSchemaGenerator.php.

Allowing anonymous web access does not help…

Now before you start making changes, it’s best to backup the file. Also note that this should be a temporary solution and it creates a security issue. Anyone can now see (but not use) this method when requesting the wsdl from the service.  Also, when updating Magento there is a probability it will be overwritten. You have been warned.

The two changes are highlighted in yellow.


Leave a Reply

Your email address will not be published. Required fields are marked *