WooCommerce order error 'woocommerce_rest_cannot_view'

Error 'woocommerce_rest_cannot_view' is thrown when syncing orders from WooCommerce.

Issue:

The user who created the webhook on WooCommerce is not an admin user.

Applies to:

woocommerce

Solution:

  1. Ensure that the user associated to the webhook is an admin user
  2. If the user is not an admin, request that your user is updated to an admin or log in with an admin account and recreate the webhook
  3. Navigate to the webhook on WooCommerce
    • On WooCommerce, go to WooCommerce > Settings
    • Click on Advanced > Webhook
    • Open the S2S/Stock2Shop webhook
    • Copy the Delivery URL from the existing webhook and revoke the webhook
    • Sign into WooCommerce as an admin, or request this from an admin user
  4. Add a new webhook with the admin user signed in
    • Navigate to WooCommerce > Settings > Advanced > Webhooks
    • Add a new webhook, choose a name that mentions this is the S2S webhook
    • The status should be set to “Active”
    • For the topic, choose “Order updated”
    • The delivery URL is the URL you copied from the old webhook, the secret should be left blank
    • The API version would be “WP REST API Integration V3”
    • Save the webhook
  5. Retry the order from the S2S queue