Woocommerce and woocommerce conector sync problem

Hello @lasalesi

Thanks for all the efforts you’ve been giving to support this integration, here I have some troubles, hopefully you may have some way to know what’s going on

Current versions:

  • ERPNEXT V12.10.1
  • Frappe 12.8.3
  • Woocommerce 4.3.1

For now

  1. ‘Sync Woocommerce IDs to ERP’ duplicate products in draft in woocommerce every time you sync, ( all items with the sync to woocommerce check selected*).

  2. Sync woocommerce ends in error:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py”, line 132, in sync_erpnext_items
sync_item_with_woocommerce(item, price_list, warehouse, woocommerce_item_list.get(item.get(‘woocommerce_product_id’)))
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py”, line 243, in sync_item_with_woocommerce
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py”, line 270, in sync_item_image
post_request(“products/{0}”.format(item.woocommerce_product_id), image_info)
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/woocommerce_requests.py”, line 69, in post_request
File “/home/frappe/frappe-bench/env/lib/python3.7/site-packages/requests/models.py”, line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://[[ WEBSITE LINK]]/wp-json/wc/v3/products/169

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/api.py”, line 41, in sync_woocommerce_resources
sync_products(woocommerce_settings.price_list, woocommerce_settings.warehouse)
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py”, line 19, in sync_products
sync_erpnext_items(price_list, warehouse, woocommerce_item_list)
File “/home/frappe/frappe-bench/apps/woocommerceconnector/woocommerceconnector/sync_products.py”, line 139, in sync_erpnext_items
make_woocommerce_log(title=e.message, status=“Error”, method=“sync_woocommerce_items”, message=frappe.get_traceback(),
AttributeError: ‘HTTPError’ object has no attribute ‘message’

  1. Also I wanted to ask, is there a way to sync pictures too?

@EnSeal @zerodiscount

Are you using the barcode field wo match the items? This is usually a rather stable way and should not give you double products. The bad request error occurs when you are trying to sync stock against an invalid product key in WooCommerce. Please check the WooCommerce Ids stored in ERPNext, you will find an ID that actually is not in WooCommerce (or a product that is set to sync stock but has no WooCommerce-ID).

The image function in WooCommerce is somewhat more powerful than in ERPNext, therefore, a simple sync of the images. However, the first image from WooCommerce should be synced to new items created in ERPNext. Is that what you are looking for (or the other way round)?

Yes I am using barcode fields, but is my first sync so I won’t have any products in WooCommerce end, Do I have to make a first product upload first maybe through CSV?

Awesome working! I had to match the barcode.

Can we use item_code instead of the barcode?

Also can you point me out in the code where can I add more fields to sync, like tags, item group, item group parent?

Great to hear! I guess especially the latest release with the improved error handling should have brought light into this.

We do not use item code because it is used more freely within ERPNext. But you can use any unique code.

Look at the sync_products.py file for the variables on the interface:

hi @lasalesi

Does WooCommece also sync images? Currently we set images on WooCommerce website not on ERPNext. I get this error in ERPNext WooCom log however sync of all other information is perfectly fine.

Error Title
WooCommerce post error 400

http://XXXXX/wp-json/wc/v3/products/5747?oauth_consumer_key=ck_cf06cbe4b9f0de1827cd4fb9fd2dd30c4f533efd&oauth_timestamp=1627214457&oauth_nonce=b1eb75bf4cab4484f30677db7a704d8fbd41da7f&oauth_signature_method=HMAC-SHA256&oauth_signature=7uTz5FazRywo6Ltb7weDWVBkfZ1L%2BUKCd2%2FiZPl3LnY%3D: {'code': 'woocommerce_product_image_upload_error', 'message': 'Error getting remote image https://woocom.com/files/CP_SMOKEGREEN%202020-10-12%2013:21:42.JPG. Error: cURL error 7: Failed to connect to woocom.com port 443: Connection refused', 'data': {'status': 400}}

Request Data
{"images": [{"src": "https://woocom.com/files/CP_SMOKEGREEN 2020-10-12 13:21:42.JPG", "position": 0}]}

FYI we have not set SSL on WooComm yet but I see that message is showing https instead of http. This error is on all products. Kindly let me know what your thoughts are and where should I start to fix the issue. Thank you.

Hi @Muzzy,

thanks for your message. Yes, images should also be synced from the WooCommerce image to ERPNext (mostly, pictures are rather in WooCommerce than ERPNext). It will only take the first (feature image) image…

The connector will always try to connect with https…

Thank you for the clarification. Now I get it. I have image on ERPNext as well as it is used for quotation and sales invoice print for retail (POS) and B2B sales. WooCommerce is 3rd sales channel.

So i guess the error is due to image already existing in ERPNext and image also coming in from WooCommerce site.

I guess the error message needs to be more self explanatory

We are in testing phase that’s why no domain yet or SSL. We are using IP. In production we will set domain and SSL.

One more issue we find is that if Item is ticked first without WooCommerce sync occuring and WooCommerce ID not being set then stock transfer to WooCommerce warehouse is not getting through. So we sync to get ID then it works fine. Else we make sure stock is transferred, price and description is set and then tick the 2 WooCommerce fields.


I see this in my Error Log on every sync. Sync works fine. Checked everything, not able to make anything of it.

        FROM `tabItem`, `tabItem Price`
        WHERE `tabItem Price`.`price_list` = 'WooCom' 
        AND `tabItem`.`name` = `tabItem Price`.`item_code`
        AND `tabItem`.`sync_with_woocommerce` = 1 
        AND (`tabItem`.`disabled` IS NULL OR `tabItem`.`disabled` = 0) AND `tabItem Price`.`modified` >= '2021-07-29 01:00:58.378009' ```

Good day everyone

I keep getting the error message below when connecting ERPNext to a particular woocommerce site

/wp-json/wc/v3/settings: {‘code’: ‘woocommerce_rest_cannot_view’, ‘message’: ‘Sorry, you cannot list resources.’, ‘data’: {‘status’: 401}}

Has anyone else experienced this ? I have succesfully integrated a number of woocommerce sites to ERPNext, but this particular site is a pain.


I am also getting this error. It did work at some point and then suddenly stopped. Maybe connected to a newer version of ERPNext. We really can’t identify that right now.

Check the connection credentials in Woocommerce and in the connector.

thanks for the input. We have recreated the tokens/keys and reset URL to. No change :confused:

Mainly issue is from WooCommerce. Never could find which version works best. Have seen latest version to be fine while older version giving random issues which we never understood.