Magento 2 website sync: troubleshoot guide

Magento 2 website sync: troubleshoot guide

Problem

If you are getting an error when trying to sync your Magento website with Calcurates, please read an error message and refer to one of the following solutions.


Possible solutions

  1. Make sure you have generated Access Token in your Magento admin correctly - learn more or check this video.
  2. Make sure you have granted ALL or necessary API Permissions to Calcurates in your Magento admin > Integration settings.
  3. If you are getting 401 returned for [website URL] or The consumer isn't authorized, then check the following:
    1. Check your Magento admin: Stores > Configuration > Services > OAuth > Consumer Settings > Set Allow OAuth Access Tokens to be used as standalone Bearer tokens option to Yes. You can also enable this setting from the CLI by running the following command:
      1bin/magento config:set oauth/consumer/enable_integration_as_bearer 1
    2. Check if your Magento website has a password protection (basic auth). In this case our server is unable to reach it. Possible solutions:
      1. Remove it or whitelist IP Address for api.calcurates.com.
      2. Disable basic auth for REST API. See examples for Apache и Nginx below.
    3. Use OAuth authorisation type instead of Token Based one. It is available in the Website's Settings > Platform Sync (Magento 2) section.

How to disable basic auth for REST API

For Apache insert the following code after basic auth code:

1SetEnvIf Request_URI /rest rest_url 2Order Allow,Deny 3Satisfy any 4<RequireAny> 5 Require env rest_url 6 Require valid-user 7</RequireAny>

For Nginx insert the following code after basic auth code:

1location /rest/ { 2 auth_basic off; 3 allow all; 4}