Shopify Integration Problem (Unprocessable Entity for url)

Once I save my shopify settings configuration I get the following error in the log file:

Message:

422 Client Error: Unprocessable Entity for url: https://5ba1c64727f27616b46a0fba1bb81c28:fc464e740f63df3a437e7992eebf8ec4@redacted.myshopify.com/admin/api/2019-04/webhooks.json

Traceback:

Traceback (most recent call last):
File “/home/gkis/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py”, line 43, in register_webhooks
d.raise_for_status()
File “/home/gkis/frappe-bench/env/lib/python3.5/site-packages/requests/models.py”, line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://5ba1c64727f27616b46a0fba1bb81c28:fc464e740f63df3a437e7992eebf8ec4@redacted.myshopify.com/admin/api/2019-04/webhooks.json

Any ideas what could be the problem?

Some more information.

This happens with ERPNext 12.5.0.

The ERPNext is hosted on an https domain so it’s probably not a case of Shopify rejecting the request due to it coming from an unsecure source (as I read somewhere on the forum).

Also I’m not sure what’s the exact names that should go into the “Map Shopify Taxes / Shipping Charges to ERPNext Account” table. It’s not very clear through looking at the shopify panel options, so any help would be appreciated here.

Facing same problem too.

I installed the latest ERPNext 11 to test and I seem to get the same error. But since I now get more details I am appending it here:

Traceback (most recent call last):
File “/home/gkis/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py”, line 58, in register_webhooks
d.raise_for_status()
File “/home/gkis/frappe-bench/env/lib/python3.5/site-packages/requests/models.py”, line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://5ba1c64727f27616b46a0fba1bb81c28:fc464e740f63df3a437e7992eebf8ec4@gkiserptest2.myshopify.com/admin/webhooks.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/gkis/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 296, in _save
self.run_before_save_methods()
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/gkis/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py”, line 20, in validate
self.register_webhooks()
File “/home/gkis/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py”, line 61, in register_webhooks
make_shopify_log(status=“Warning”, message=e.message, exception=False)
AttributeError: ‘HTTPError’ object has no attribute ‘message’

Traceback (most recent call last):
File “/home/gkis/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py”, line 58, in register_webhooks
d.raise_for_status()
File “/home/gkis/frappe-bench/env/lib/python3.5/site-packages/requests/models.py”, line 941, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 422 Client Error: Unprocessable Entity for url: https://5ba1c64727f27616b46a0fba1bb81c28:fc464e740f63df3a437e7992eebf8ec4@gkiserptest2.myshopify.com/admin/webhooks.json

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/home/gkis/frappe-bench/apps/frappe/frappe/app.py”, line 61, in application
response = frappe.handler.handle()
File “/home/gkis/frappe-bench/apps/frappe/frappe/handler.py”, line 21, in handle
data = execute_cmd(cmd)
File “/home/gkis/frappe-bench/apps/frappe/frappe/handler.py”, line 56, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/gkis/frappe-bench/apps/frappe/frappe/init.py”, line 1036, in call
return fn(*args, **newargs)
File “/home/gkis/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 22, in savedocs
doc.save()
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 260, in save
return self._save(*args, **kwargs)
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 296, in _save
self.run_before_save_methods()
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 876, in run_before_save_methods
self.run_method(“validate”)
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 772, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 1048, in composer
return composed(self, method, *args, **kwargs)
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 1031, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/gkis/frappe-bench/apps/frappe/frappe/model/document.py”, line 766, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/gkis/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py”, line 20, in validate
self.register_webhooks()
File “/home/gkis/frappe-bench/apps/erpnext/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py”, line 61, in register_webhooks
make_shopify_log(status=“Warning”, message=e.message, exception=False)
AttributeError: ‘HTTPError’ object has no attribute ‘message’

I tried after installing SSL and it starts working for me,
You should try by creating new app on shopify.

@shahid I created a new app and have SSL enabled on the site but still have the same issue.

What did you put in the Mapping table?

Because i’ve these two Shipping titles in shopify.
but it will throw error while syncing orders, not now.

Try to update app setting in shopify like below, and try by re enabling your shopify settings.

1 Like

@shahid Thank you very much, that worked. It probably was a permission issue.

What kind of error do you get while syncing orders? I tried to create a new test order on shopify but it didn’t sync, didn’t give an error either.

Orders syncing is also working for me, if Shopify shipping accounts title or Tax accounts title didn’t match with provided titles in shopify settings, it will create shopify log with status as error.

@shahid Oh so everything is working fine for you now?

What do you have set as the shopify tax name? The name of the country or something different?

yes and everything is working fine and right now I am not managing taxes on shopify.

Strange, not sure where the issue lies then. I’ll try again in v12 in a multibench setup and see how it goes.

Nope, same issue in ERP 12. I create an order in the shopify store and nothing happens in ERPNext. Nothing is synced and nothing shows in the Shopify log either.

@shahid I wonder if my issues have something to do with choosing Cash on Delivery (COD) on checkout of the shopify order (I don’t want to set up a paypal business account just for testing purposes). Does COD work for you, does it sync to erpnext fine as well?

Yes COD is working for me, and orders will not sync until unprocessable entry log don’t come when saving shopify settings.

dear i am having same 422 client error i did the four permission in shopify also but still its giivng waring.

one error message i am getting when i am saving the shopify setting
Reverting length to 255 for ‘name’ in ‘Address’; Setting the length as 140 will cause truncation of data.

anyone can help me on this issue please