1.Update your WooCommerce to the latest version. This is compulsory.
2. Make sure your store has a valid SSL certificate.
3.Make sure you are using Pretty permalinks in Settings > Permalinks so that the custom endpoints are supported. Default permalinks will not work. Learn more
4. Go to WooCommerce > Settings > Advanced > Legacy API and Enable the option.