libracore / WooCommerceConnector

Integration App for ERPNext to connect to WooCommerce
Other
82 stars 140 forks source link

Error: WooCommerce get error 401 && sync has terminated #33

Open asharamseervi opened 4 years ago

asharamseervi commented 4 years ago

Hello there,

I would like to thanks Libracore team for making this connector. I've faced some challenges as follows:

Testing on Version: Frappe & ERPNext: v13 Beta4 but the error is same on v12,11.2

wc-connector-error-401

&

wc-connector-terminated-error

I want to assure you, that this was working as expected on v13 with staging woo-commerce site, but when I tried same with production self-hosted ERPNext instance, and production site, this was producing these errors. Also, adding to note, earlier I've used native woocommerce integration that was working with same site, also tried with fresh/blank erpnext as well as having some items in erpnext.

And, aboe all, I am able to access data with get method: https://www.woocommerce-site.com/wp-json/wc/v3/orders?consumer_key=ck_0b40XXXXXXXXXXXXXXX0bXX8b&consumer_secret=cs_75f75f0a29eXXXXXXXXXX35b5fb17ac04

Can you point, what could be wrong?

lasalesi commented 4 years ago

Thanks for your kind words!

401 is an access issue/permission error. Is the API accessible and are headers forwarded? We use the headers for the access details, as this is safer than uri encoding, but if the server does not forward headers, it gives you an issue.

The below error could come from a connected shop that has no products. Does it have products?

abrarpv97 commented 3 years ago

@lasalesi i am also facing same issue

in get request getting error as below {"code":"woocommerce_rest_cannot_view","message":"Sorry, you cannot list resources.","data":{"status":401}}

xoojulian commented 3 years ago

same issue @lasalesi @joelios

lasalesi commented 3 years ago

Can you please check you access permissions in WooCommerce and the key & secret? The 401 error from WooCommerce states "cannot list resources" on access permission issue - no valid access...

popenko-ikrok commented 6 months ago

I had this error, when I try to clone production Woocommerce and sync with ERPNext. SSL/TLS-certificates will solve this problem.