frappe / ecommerce_integrations

Ecommerce integrations for ERPNext
https://frappecloud.com/marketplace/apps/ecommerce_integrations
GNU General Public License v3.0
109 stars 144 forks source link

Error when attempting to setup ecommerce integrations #304

Closed Cai-Staggs closed 9 months ago

Cai-Staggs commented 10 months ago

Hi, I am seeking assistance with this issue. I am running frappe ErpNext 15 on a bare metal setup of ubuntu 22.04.

I have installed all necessary dependencies such as redis, mariaDB, python ETC.

I created a new bench, then installed the ERPNext and ecommerce_integrations apps. I installed both of these to a new site, and ran the site.

I was able to do all functions of ERPNext as usual, but when attempting to use the shopify connector I am getting an error.

I setup an app in my shopify store and actually gave it all permissions to avoid any permission issues.

I copied in the API Key and API Secret to the settings, but when I try to save it I get this error...

App Versions

{
    "ecommerce_integrations": "1.17.0",
    "erpnext": "16.0.0-dev",
    "frappe": "16.0.0-dev"
}

Route

Form/Shopify Setting/Shopify Setting

Traceback

Traceback (most recent call last):
  File "env/lib/python3.10/site-packages/pyactiveresource/connection.py", line 286, in _open
    http_response = self._handle_error(self._urlopen(request))
  File "env/lib/python3.10/site-packages/pyactiveresource/connection.py", line 316, in _urlopen
    return urllib.request.urlopen(request, timeout=self.timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/usr/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/usr/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/usr/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "apps/frappe/frappe/__init__.py", line 1718, in call
    return fn(*args, **newargs)
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
  File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 334, in save
    return self._save(*args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 370, in _save
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1085, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 954, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1320, in composer
    return composed(self, method, *args, **kwargs)
  File "apps/frappe/frappe/model/document.py", line 1302, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
  File "apps/frappe/frappe/model/document.py", line 951, in fn
    return method_object(*args, **kwargs)
  File "apps/ecommerce_integrations/ecommerce_integrations/shopify/doctype/shopify_setting/shopify_setting.py", line 45, in validate
    self._handle_webhooks()
  File "apps/ecommerce_integrations/ecommerce_integrations/shopify/doctype/shopify_setting/shopify_setting.py", line 70, in _handle_webhooks
    connection.unregister_webhooks(self.shopify_url, self.get_password("password"))
  File "apps/ecommerce_integrations/ecommerce_integrations/shopify/connection.py", line 69, in unregister_webhooks
    for webhook in Webhook.find():
  File "env/lib/python3.10/site-packages/shopify/base.py", line 196, in find
    collection = super(ShopifyResource, cls).find(id_=id_, from_=from_, **kwargs)
  File "env/lib/python3.10/site-packages/pyactiveresource/activeresource.py", line 386, in find
    return cls._find_every(from_=from_, **kwargs)
  File "env/lib/python3.10/site-packages/pyactiveresource/activeresource.py", line 525, in _find_every
    response = cls.connection.get(path, cls.headers)
  File "env/lib/python3.10/site-packages/pyactiveresource/connection.py", line 329, in get
    return self._open('GET', path, headers=headers)
  File "env/lib/python3.10/site-packages/shopify/base.py", line 23, in _open
    self.response = super(ShopifyConnection, self)._open(*args, **kwargs)
  File "env/lib/python3.10/site-packages/pyactiveresource/connection.py", line 288, in _open
    http_response = self._handle_error(err)
  File "env/lib/python3.10/site-packages/pyactiveresource/connection.py", line 415, in _handle_error
    raise UnauthorizedAccess(err)
pyactiveresource.connection.UnauthorizedAccess: Response(code=401, body="b'{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}'", headers={'Date': 'Wed, 24 Jan 2024 04:28:01 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'X-Sorting-Hat-PodId': '278', 'X-Sorting-Hat-ShopId': '75471585559', 'referrer-policy': 'origin-when-cross-origin', 'x-frame-options': 'DENY', 'x-shopid': '75471585559', 'x-shardid': '278', 'www-authenticate': 'Basic Realm="Shopify API Authentication"', 'strict-transport-security': 'max-age=7889238', 'server-timing': 'processing;dur=91', 'x-shopify-stage': 'production', 'content-security-policy': "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fwebhooks&source%5Bsection%5D=admin_api&source%5Buuid%5D=ff8b6227-68ea-466d-b6a3-fbbcb37aac8a", 'x-content-type-options': 'nosniff', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'x-xss-protection': '1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fwebhooks&source%5Bsection%5D=admin_api&source%5Buuid%5D=ff8b6227-68ea-466d-b6a3-fbbcb37aac8a', 'x-envoy-upstream-service-time': '93', 'X-Dc': 'gcp-us-central1,gcp-us-east1', 'X-Request-ID': 'ff8b6227-68ea-466d-b6a3-fbbcb37aac8a', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=KrKkHRf%2BnPCf9gdgdDzDOZ1Z1573rw14acLqToeoQ8u4HDx1qkMCNIBLn8XQcC%2BcX4Hhhquk3Ons0k6eW08p9fknKyBrcSt7s4SQqDs6y4yAA2VpAmykYYno5X1qWHnfe7LYHciY"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}', 'Server-Timing': 'processing;dur=91', 'Server': 'cloudflare', 'CF-RAY': '84a586fcbfc16e39-OMA', 'alt-svc': 'h3=":443"; ma=86400'}, msg="Unauthorized")

Request Data

{
    "type": "POST",
    "args": {
        "doc": "{\"name\":\"Shopify Setting\",\"owner\":\"Administrator\",\"modified\":\"2024-01-24 09:30:06.028032\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":\"0\",\"enable_shopify\":0,\"sync_delivery_note\":1,\"sync_sales_invoice\":1,\"add_shipping_as_item\":0,\"consolidate_taxes\":1,\"upload_erpnext_items\":0,\"update_shopify_item_on_update\":0,\"sync_new_item_as_active\":1,\"upload_variants_as_items\":0,\"update_erpnext_stock_levels_to_shopify\":0,\"inventory_sync_frequency\":\"60\",\"sync_old_orders\":1,\"is_old_data_migrated\":0,\"doctype\":\"Shopify Setting\",\"shopify_warehouse_mapping\":[],\"taxes\":[{\"docstatus\":0,\"doctype\":\"Shopify Tax Account\",\"name\":\"new-shopify-tax-account-fwvnzcthyl\",\"__islocal\":1,\"__unsaved\":1,\"owner\":\"coffee@blackskullcoffeecompany.com\",\"parent\":\"Shopify Setting\",\"parentfield\":\"taxes\",\"parenttype\":\"Shopify Setting\",\"idx\":1,\"__unedited\":false,\"shopify_tax\":\"Taxes\",\"tax_account\":\"ST 4% - BSCC\"}],\"webhooks\":[],\"__last_sync_on\":\"2024-01-24T04:04:15.582Z\",\"password\":\"*****\",\"__unsaved\":1,\"shared_secret\":\"611debdaa509c155bb90a083508a0cc5\",\"shopify_url\":\"ae1cf5.myshopify.com\",\"default_customer\":\"default\",\"customer_group\":\"Individual\",\"company\":\"Black Skull Coffee Company\",\"cost_center\":\"Main - BSCC\",\"cash_bank_account\":\"Bank Account - BSCC\",\"sales_order_series\":\"SAL-ORD-.YYYY.-\",\"delivery_note_series\":\"MAT-DN-.YYYY.-\",\"sales_invoice_series\":\"ACC-SINV-.YYYY.-\",\"shipping_item\":\"\",\"default_sales_tax_account\":\"ST 4% - BSCC\",\"old_orders_from\":\"2023-05-01 22:04:15\",\"old_orders_to\":\"2024-01-23 22:25:55\",\"warehouse\":\"Finished Goods - BSCC\",\"default_shipping_charges_account\":\"ST 4% - BSCC\"}",
        "action": "Save"
    },
    "btn": {
        "jQuery370034182050937435891": {
            "events": {
                "click": [
                    {
                        "type": "click",
                        "origType": "click",
                        "guid": 1718,
                        "namespace": ""
                    }
                ]
            }
        }
    },
    "freeze": true,
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.desk.form.save.savedocs",
    "request_id": null
}

Response Data

{
    "exception": "pyactiveresource.connection.UnauthorizedAccess: Response(code=401, body=\"b'{\"errors\":\"[API] Invalid API key or access token (unrecognized login or wrong password)\"}'\", headers={'Date': 'Wed, 24 Jan 2024 04:28:01 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'X-Sorting-Hat-PodId': '278', 'X-Sorting-Hat-ShopId': '75471585559', 'referrer-policy': 'origin-when-cross-origin', 'x-frame-options': 'DENY', 'x-shopid': '75471585559', 'x-shardid': '278', 'www-authenticate': 'Basic Realm=\"Shopify API Authentication\"', 'strict-transport-security': 'max-age=7889238', 'server-timing': 'processing;dur=91', 'x-shopify-stage': 'production', 'content-security-policy': \"default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fwebhooks&source%5Bsection%5D=admin_api&source%5Buuid%5D=ff8b6227-68ea-466d-b6a3-fbbcb37aac8a\", 'x-content-type-options': 'nosniff', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'x-xss-protection': '1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fwebhooks&source%5Bsection%5D=admin_api&source%5Buuid%5D=ff8b6227-68ea-466d-b6a3-fbbcb37aac8a', 'x-envoy-upstream-service-time': '93', 'X-Dc': 'gcp-us-central1,gcp-us-east1', 'X-Request-ID': 'ff8b6227-68ea-466d-b6a3-fbbcb37aac8a', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{\"endpoints\":[{\"url\":\"https:\\\\/\\\\/a.nel.cloudflare.com\\\\/report\\\\/v3?s=KrKkHRf%2BnPCf9gdgdDzDOZ1Z1573rw14acLqToeoQ8u4HDx1qkMCNIBLn8XQcC%2BcX4Hhhquk3Ons0k6eW08p9fknKyBrcSt7s4SQqDs6y4yAA2VpAmykYYno5X1qWHnfe7LYHciY\"}],\"group\":\"cf-nel\",\"max_age\":604800}', 'NEL': '{\"success_fraction\":0.01,\"report_to\":\"cf-nel\",\"max_age\":604800}', 'Server-Timing': 'processing;dur=91', 'Server': 'cloudflare', 'CF-RAY': '84a586fcbfc16e39-OMA', 'alt-svc': 'h3=\":443\"; ma=86400'}, msg=\"Unauthorized\")",
    "exc_type": "UnauthorizedAccess",
    "_exc_source": "ecommerce_integrations (app)"
}

Any help or tips would be appreciated.

Thanks!

Cai-Staggs commented 9 months ago

I figured out the issue. It was because In order to create the webhooks with Shopify, I had to point my domain to the ERPNext server, and have an SSL Certificate.

sush0408 commented 9 months ago

What if We are hosting on ERPnext on frappe cloud.

getting same error:

App Versions

{
    "builder": "1.5.1",
    "chat": "0.0.1",
    "ecommerce_integrations": "1.20.0",
    "erpnext": "15.14.0",
    "frappe": "15.14.0",
    "lms": "1.0.0",
    "payments": "0.0.1",
    "print_designer": "1.0.0",
    "wiki": "2.0.0"
}

Route

Form/Shopify Setting/Shopify Setting

Traceback

Traceback (most recent call last):
  File "env/lib/python3.11/site-packages/pyactiveresource/connection.py", line 286, in _open
    http_response = self._handle_error(self._urlopen(request))
                                       ^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pyactiveresource/connection.py", line 316, in _urlopen
    return urllib.request.urlopen(request, timeout=self.timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 525, in open
    response = meth(req, response)
               ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 634, in http_response
    response = self.parent.error(
               ^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 563, in error
    return self._call_chain(*args)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 496, in _call_chain
    result = func(*args)
             ^^^^^^^^^^^
  File "/usr/lib/python3.11/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 401: Unauthorized

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "apps/frappe/frappe/app.py", line 110, in application
    response = frappe.api.handle(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/__init__.py", line 49, in handle
    data = endpoint(**arguments)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/api/v1.py", line 36, in handle_rpc_call
    return frappe.handler.handle()
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 49, in handle
    data = execute_cmd(cmd)
           ^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/handler.py", line 85, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/__init__.py", line 1682, in call
    return fn(*args, **newargs)
           ^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/utils/typing_validations.py", line 31, in wrapper
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/desk/form/save.py", line 39, in savedocs
    doc.save()
  File "apps/frappe/frappe/model/document.py", line 332, in save
    return self._save(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 368, in _save
    self.run_before_save_methods()
  File "apps/frappe/frappe/model/document.py", line 1069, in run_before_save_methods
    self.run_method("validate")
  File "apps/frappe/frappe/model/document.py", line 940, in run_method
    out = Document.hook(fn)(self, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1300, in composer
    return composed(self, method, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 1282, in runner
    add_to_return_value(self, fn(self, *args, **kwargs))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/frappe/frappe/model/document.py", line 937, in fn
    return method_object(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "apps/ecommerce_integrations/ecommerce_integrations/shopify/doctype/shopify_setting/shopify_setting.py", line 45, in validate
    self._handle_webhooks()
  File "apps/ecommerce_integrations/ecommerce_integrations/shopify/doctype/shopify_setting/shopify_setting.py", line 70, in _handle_webhooks
    connection.unregister_webhooks(self.shopify_url, self.get_password("password"))
  File "apps/ecommerce_integrations/ecommerce_integrations/shopify/connection.py", line 69, in unregister_webhooks
    for webhook in Webhook.find():
                   ^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/shopify/base.py", line 196, in find
    collection = super(ShopifyResource, cls).find(id_=id_, from_=from_, **kwargs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pyactiveresource/activeresource.py", line 386, in find
    return cls._find_every(from_=from_, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pyactiveresource/activeresource.py", line 525, in _find_every
    response = cls.connection.get(path, cls.headers)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pyactiveresource/connection.py", line 329, in get
    return self._open('GET', path, headers=headers)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/shopify/base.py", line 23, in _open
    self.response = super(ShopifyConnection, self)._open(*args, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pyactiveresource/connection.py", line 288, in _open
    http_response = self._handle_error(err)
                    ^^^^^^^^^^^^^^^^^^^^^^^
  File "env/lib/python3.11/site-packages/pyactiveresource/connection.py", line 415, in _handle_error
    raise UnauthorizedAccess(err)
pyactiveresource.connection.UnauthorizedAccess: Response(code=401, body="b'{"errors":"[API] Invalid API key or access token (unrecognized login or wrong password)"}'", headers={'Date': 'Thu, 22 Feb 2024 03:06:19 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'X-Sorting-Hat-PodId': '314', 'X-Sorting-Hat-ShopId': '85586247995', 'referrer-policy': 'origin-when-cross-origin', 'x-frame-options': 'DENY', 'x-shopid': '85586247995', 'x-shardid': '314', 'www-authenticate': 'Basic Realm="Shopify API Authentication"', 'strict-transport-security': 'max-age=7889238', 'server-timing': 'processing;dur=24', 'x-shopify-stage': 'production', 'content-security-policy': "default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fwebhooks&source%5Bsection%5D=admin_api&source%5Buuid%5D=aecca49a-4066-4030-9ce8-3aabd0275ea0", 'x-content-type-options': 'nosniff', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'x-xss-protection': '1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fwebhooks&source%5Bsection%5D=admin_api&source%5Buuid%5D=aecca49a-4066-4030-9ce8-3aabd0275ea0', 'x-envoy-upstream-service-time': '27', 'X-Dc': 'gcp-asia-south1,gcp-us-east1', 'X-Request-ID': 'aecca49a-4066-4030-9ce8-3aabd0275ea0', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{"endpoints":[{"url":"https:\\/\\/a.nel.cloudflare.com\\/report\\/v3?s=SVbro1H7U2nv9nHSC31onCnTAAudFYuUA3br3%2FZgn4Lixn%2B6JzF5pCVmlaYOaS3hkQgV%2F5qBAKp1Tu4zoUgjgSbjHusLARcjdsPIEjvnd33xBLr3I5z2q3rwcGgz%2FqYBl6Dd%2FbaO9p5QMb7M0jdSFg%3D%3D"}],"group":"cf-nel","max_age":604800}', 'NEL': '{"success_fraction":0.01,"report_to":"cf-nel","max_age":604800}', 'Server-Timing': 'processing;dur=24', 'Server': 'cloudflare', 'CF-RAY': '8594032f6e7685d6-BOM', 'alt-svc': 'h3=":443"; ma=86400'}, msg="Unauthorized")

Request Data

{
    "type": "POST",
    "args": {
        "doc": "{\"name\":\"Shopify Setting\",\"owner\":\"Administrator\",\"modified\":\"2024-02-22 01:10:24.439560\",\"modified_by\":\"Administrator\",\"docstatus\":0,\"idx\":\"0\",\"enable_shopify\":0,\"sync_delivery_note\":1,\"sync_sales_invoice\":1,\"add_shipping_as_item\":0,\"consolidate_taxes\":0,\"upload_erpnext_items\":1,\"update_shopify_item_on_update\":1,\"sync_new_item_as_active\":1,\"upload_variants_as_items\":1,\"update_erpnext_stock_levels_to_shopify\":0,\"inventory_sync_frequency\":\"60\",\"sync_old_orders\":1,\"is_old_data_migrated\":0,\"doctype\":\"Shopify Setting\",\"shopify_warehouse_mapping\":[],\"taxes\":[],\"webhooks\":[],\"__last_sync_on\":\"2024-02-22T03:04:04.559Z\",\"shopify_url\":\"tese-marketplace.myshopify.com\",\"__unsaved\":1,\"password\":\"*****\",\"shared_secret\":\"2b95e709865962e57ce9b2c827cc4767\",\"default_customer\":\"Default Shopify\",\"customer_group\":\"Shopify Customer\",\"company\":\"Tese Capital Limited\",\"cost_center\":\"Main - TCL\",\"cash_bank_account\":\"Cash - TCL\",\"sales_order_series\":\"SAL-ORD-.YYYY.-\",\"delivery_note_series\":\"MAT-DN-.YYYY.-\",\"sales_invoice_series\":\"ACC-SINV-.YYYY.-\",\"old_orders_from\":\"2024-01-01 11:04:04\",\"old_orders_to\":\"2024-02-22 11:04:04\"}",
        "action": "Save"
    },
    "btn": {
        "jQuery370087109788914194211": {
            "events": {
                "click": [
                    {
                        "type": "click",
                        "origType": "click",
                        "guid": 1487,
                        "namespace": ""
                    }
                ]
            }
        },
        "__sentry_instrumentation_handlers__": {
            "click": {
                "refCount": 1
            }
        }
    },
    "freeze": true,
    "headers": {},
    "error_handlers": {},
    "url": "/api/method/frappe.desk.form.save.savedocs",
    "request_id": "d4c2a3d3-603f-45ee-8ba1-19ed91e710a3"
}

Response Data

{
    "exception": "pyactiveresource.connection.UnauthorizedAccess: Response(code=401, body=\"b'{\"errors\":\"[API] Invalid API key or access token (unrecognized login or wrong password)\"}'\", headers={'Date': 'Thu, 22 Feb 2024 03:06:19 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Transfer-Encoding': 'chunked', 'Connection': 'close', 'X-Sorting-Hat-PodId': '314', 'X-Sorting-Hat-ShopId': '85586247995', 'referrer-policy': 'origin-when-cross-origin', 'x-frame-options': 'DENY', 'x-shopid': '85586247995', 'x-shardid': '314', 'www-authenticate': 'Basic Realm=\"Shopify API Authentication\"', 'strict-transport-security': 'max-age=7889238', 'server-timing': 'processing;dur=24', 'x-shopify-stage': 'production', 'content-security-policy': \"default-src 'self' data: blob: 'unsafe-inline' 'unsafe-eval' https://* shopify-pos://*; block-all-mixed-content; child-src 'self' https://* shopify-pos://*; connect-src 'self' wss://* https://*; frame-ancestors 'none'; img-src 'self' data: blob: https:; script-src https://cdn.shopify.com https://cdn.shopifycdn.net https://checkout.shopifycs.com https://api.stripe.com https://mpsnare.iesnare.com https://appcenter.intuit.com https://www.paypal.com https://js.braintreegateway.com https://c.paypal.com https://maps.googleapis.com https://www.google-analytics.com https://v.shopify.com 'self' 'unsafe-inline' 'unsafe-eval'; upgrade-insecure-requests; report-uri /csp-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fwebhooks&source%5Bsection%5D=admin_api&source%5Buuid%5D=aecca49a-4066-4030-9ce8-3aabd0275ea0\", 'x-content-type-options': 'nosniff', 'x-download-options': 'noopen', 'x-permitted-cross-domain-policies': 'none', 'x-xss-protection': '1; mode=block; report=/xss-report?source%5Baction%5D=index&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=admin%2Fwebhooks&source%5Bsection%5D=admin_api&source%5Buuid%5D=aecca49a-4066-4030-9ce8-3aabd0275ea0', 'x-envoy-upstream-service-time': '27', 'X-Dc': 'gcp-asia-south1,gcp-us-east1', 'X-Request-ID': 'aecca49a-4066-4030-9ce8-3aabd0275ea0', 'CF-Cache-Status': 'DYNAMIC', 'Report-To': '{\"endpoints\":[{\"url\":\"https:\\\\/\\\\/a.nel.cloudflare.com\\\\/report\\\\/v3?s=SVbro1H7U2nv9nHSC31onCnTAAudFYuUA3br3%2FZgn4Lixn%2B6JzF5pCVmlaYOaS3hkQgV%2F5qBAKp1Tu4zoUgjgSbjHusLARcjdsPIEjvnd33xBLr3I5z2q3rwcGgz%2FqYBl6Dd%2FbaO9p5QMb7M0jdSFg%3D%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}', 'NEL': '{\"success_fraction\":0.01,\"report_to\":\"cf-nel\",\"max_age\":604800}', 'Server-Timing': 'processing;dur=24', 'Server': 'cloudflare', 'CF-RAY': '8594032f6e7685d6-BOM', 'alt-svc': 'h3=\":443\"; ma=86400'}, msg=\"Unauthorized\")",
    "exc_type": "UnauthorizedAccess",
    "_exc_source": "ecommerce_integrations (app)"
}