Hi @freecook
The error you’re encountering is due to a missing argument in the REST API route definition. As of WordPress 5.5, a permission_callback is required when registering a REST route.
You can resolve this issue by adding a permission_callback to your register_rest_route function. If your REST API route is public, you can use __return_true as the permission_callback.
Please try this solution and let us know how that goes.
Please note that writing or providing custom code is not within the scope of our support policy. If you are still having problems, we recommend asking development questions on the #developers channel of the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question. You can also seek help from the following:
I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.
How can I fix this? What function I can add this?
-
This reply was modified 2 years, 6 months ago by
Free Fast.
Hello @freecook,
How can I fix this? What function I can add this?
Could you please specify where you’re encountering this error? It seems to relate to WordPress’s REST API rather than WooCommerce.
If you don’t already have a screenshot service installed, here are a few free options:
Could you also attach a copy of your site’s System Status report? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support” (after you scroll down a bit)”. Once done, please paste it here in your reply or via a text-sharing service like https://gist.github.com/.
Look forward to hearing back from you,