WooCommerce: "Can't create shop. Error: JSON ERROR: Syntax error"

"I receive the error 'Can't create shop. Error: JSON ERROR: Syntax error' when trying to install the WooCommerce integration"? In this article we will look at some of the possible causes for this error code.

When connecting your WooCommerce store, you risk running into an error message:

"Can't create shop. Error: JSON ERROR: Syntax error"

Without getting too technical, this error is caused by HTML being returned istead of JSON. 

The reason for the HTML return instead of JSON can be caused by things like plugins, themes, the API in Wordpress or other things.

ATTENTION: This error is not caused by Rackbeat, therefore our customer success team have limited knowledge and will refer to this particular article.

Let's dive into what you can do to try to resolve this issue: 

PLUGINS

Some plugins can cause an error when trying to connect your WooCommerce store to your Rackbeat account.

Troubleshooting steps: Try removing/deactivating your plugins, and then try to create the connection to the WooCommerce store again.

THEMES

Some themes changes certain parts of the API, which returns HTML instead of JSON, which will cause this error.

Troubleshooting steps: Try changing your theme to the default storefront, thereafter create a connection to the WooCommerce store again.

HTML RETURNED INSTEAD OF JSON

When connecting to WooCommerce, we send a "HTTP Get request" to this route. This is done to ensure that credentials are correct and to create a connection to the store. During this proces, Rackbeat expects JSON to be returned.

If HTML is returned instead of JSON, then the platform will respond with:

"Can't create shop. Error: JSON ERROR: Syntax error" 

We get this error as the HTML page is not the correct value.

The conclusion is that the API from the Wordpress setup returns an incorrect value and therefore the platform responds with an error code.

Troubleshooting steps: This either requires a code change in the Wordpress store to make sure that the API returns JSON instead of HTML or by making changes to your security software, such as Cloudflare.

CLOUDFLARE FIREWALL

If you use the platform Cloudflare, you risk that the firewall will prevent an API call from Rackbeat.

This firewall is set up to stop bots and can register the API call as a call attempt from a bot, then it will risk being blocked.

Troubleshooting steps: Disable the firewall in Cloudflare.

You can get another error in this instance:

"cURL error 60: SSL certificate problem: self signed certificate"

This means that the certificates might be misconfigured. 

If you still experience an error, then please test the following: 

  1. Whitelist your origin host/Server/Hosting address
    1. Navigate to Security
    2. Navigate to WAF
    3. Navigate to Tools
    4. Navigate to IP Access Rules
    5. Click allow for your website
    6. Try again.
  2. If that doesn't fix it, then try changing the setting for "Super Bot Fight Mode" to allow everything.

Attention: This error is not caused by Rackbeat, therefore our customer success department have limited knowledge and will refer to this particular article.