Can't POST/PUT/DELETE any products into WooCommerce by REST API Can't POST/PUT/DELETE any products into WooCommerce by REST API wordpress wordpress

Can't POST/PUT/DELETE any products into WooCommerce by REST API


This https://github.com/woocommerce/woocommerce/wiki/Getting-started-with-the-REST-API#server-does-not-support-postdeleteput do the trick for me.

Some times, Server does not support POST/DELETE/PUTIdeally, your server should be configured to accept these types of API request, but if not you can use the _method property.

See https://developer.wordpress.org/rest-api/using-the-rest-api/global-parameters/#_method-or-x-http-method-override-header

Doing a POST request, and passing _method=PUT as a query parameter works for me.


You are using an old version API method. Use the latest version with the updated woocommerce plugin.You can also follow this link https://woocommerce.github.io/woocommerce-rest-api-docs/?php#delete-a-product


What are the roles of the user that is associated with the API keys?

I had some authorization errors with the Woocommerce API, even though the API keys had read/write permissions. After I checked the Woocommerce API keys settings in Wordpress, I noticed that the user that was associated with the keys I used, didn't have any Woocommerce roles, such as Customer, Shop Manager or Admin.

After associating an admin user to some new API keys, I resolved the issue and could authorise with all API endpoints.

Since you are authorised for only some of the endpoints, it could be the same issue. The user that is associated with the API keys probably doesn't have a role with permissions to delete.