A common cause for this error is improperly configured permalinks. In WordPress, the REST API relies on human-readable (pretty) permalinks rather than the default “Plain” setting. To resolve the issue, navigate to Settings > Permalinks in your WordPress dashboard and choose a permalink structure such as “Day and name” (or any option other than Plain). This should allow the REST API to function correctly.
For more details, please refer to the WooCommerce REST API documentation.