wc-api-node icon indicating copy to clipboard operation
wc-api-node copied to clipboard

"nonce is already used"

Open natanavra opened this issue 9 years ago • 6 comments

Using the NodeJS woocommerce-api package + woocommerce 3.0.0 + wp 4.7.4.

  • Tried multiple endpoints, product related, e.g.: http://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-product
  • Tried multiple API keys with different permissions and different users.
  • Not using https.

Getting "nonce is invalid, already used" error "woocommerce_api_authentication_error".

  • Tried curl but getting "401 - woocommerce_rest_cannot_view".

Any advice?

**** UPDATE ****

Using the node package 'woocommerce' which is not official from the woocommerce team and uses the legacy API -> works well!

natanavra avatar May 03 '17 14:05 natanavra

This could be related to the timezone from where you are doing requests and the shop timezone. Are you using a different timezone?

Should be always more easy if using HTTPS, will avoid a lot of errors like it.

claudiosanches avatar May 03 '17 16:05 claudiosanches

Hi Claudio, The server is in USA and I'm in a GMT+3 timezone, but doesn't it work on UTC timestamp? I've checked the times sync it's exactly 3 hours difference.

Don't have the option to install an SSL certificate at the moment, any other workarounds?

@claudiosanches comment?

natanavra avatar May 03 '17 16:05 natanavra

A fix for this would be greatly appreciated!

dan7554 avatar May 10 '17 18:05 dan7554

@dan7554 please feel free to submit a Pull Request.

claudiosanches avatar May 10 '17 19:05 claudiosanches

@natanavra I need to check the timestamps, not sure now if uses UTC or not.

claudiosanches avatar May 10 '17 19:05 claudiosanches

This library is now deprecated, you should try https://github.com/woocommerce/woocommerce-rest-api-js-lib

claudiosanches avatar Jul 29 '19 21:07 claudiosanches