Troubleshooting your Magento 2 integration

Estimated 4 minute read

|

Updated Jul 7, 2025, 12:00 AM EST

Table of contents

You will learn

Learn how to solve issues with your Magento 2 OAuth setup by following the troubleshooting steps described below. If you are still encountering issues after running through these steps, please reach out on our Community or to our Support Team.

Before you begin

If you have not already, read our guide on Getting started with Magento 2 for step-by-step instructions to set up your Magento 2 integration.

Klaviyo uses the OAuth protocol to generate an access token and retrieve data from your Magento 2 store. If you’ve customized your Magento 2 installation, it can cause Klaviyo’s OAuth procedure to fail. This article will guide you through a series of troubleshooting steps to identify where the failure is occurring.

General troubleshooting steps

Ensure your site is publicly accessible with a valid SSL certificate

Klaviyo’s OAuth procedure requires that your website is publicly accessible, otherwise the necessary API calls to generate the access tokens will fail.

  1. Make sure password protection or IP restrictions do not block Klaviyo’s requests.
  2. Ensure that your store is accessible via HTTPS with a valid SSL certificate. You can test your certificate here.

Ensure your firewall is not blocking Klaviyo’s requests

All outbound Klaviyo integration traffic is behind a set of predictable, static IP addresses so that you can have a high level of confidence that this traffic is coming from Klaviyo. Read our article to learn how to allowlist Klaviyo integration traffic IP addresses.

Check your Magento 2 and Klaviyo extension versions

  1. Magento 2 versions below 2.4.0 are not supported. Check the current requirements in Getting started with Magento 2. If you are troubleshooting a legacy Magento v2.2.0 installation, see the manual OAuth instructions.
  2. Make sure you’ve installed the correct Klaviyo extension (you may need to upgrade).

Check setup errors in Klaviyo

If Klaviyo says the account does not match the company ID, check that the public API key configured in Magento belongs to the Klaviyo account you are signed in to. Sign out of other Klaviyo accounts, then try connecting again. In Confirm new integration, check the account name before clicking Integrate.

If Klaviyo shows Something went wrong, expand each entry under Missing required role resources for: to read the error details. Check any missing API permissions using Adobe’s integration guidance. If an error says your store’s API responded too slowly, check its performance before trying to connect again.

Ensure OAuth endpoints are accessible

You may have extra or missing rewrite rules which can make the default Magento 2 OAuth endpoints inaccessible. Klaviyo needs to access these endpoints to generate the necessary credentials for the authorization process.

Ensure that the URLs below are accessible for your store:

textCopy

https://[Store URL]/oauth/token/request

textCopy

https://[Store URL]/oauth/token/access
  1. You can validate that they’re accessible by making a POST request like this:

textCopy

curl --location --url 'https://[Store URL]/oauth/token/request' --request 'POST' -v

textCopy

curl --location --url 'https://[Store URL]/oauth/token/access' --request 'POST' -v
  1. These test requests do not include OAuth credentials, so an OAuth-related error is expected. A response similar to the following shows that the endpoint is reachable; it does not confirm that Klaviyo can complete authentication.

curloauthendpoint.png

curloauthendpoint.png

  1. If you do not receive a response related to OAuth, you should check that there are no redirects, invalid rewrite rules, or internal server errors preventing access to these URLs.

Klaviyo starts the OAuth requests at your store’s main domain, without a store subpath. If Magento is installed in a subpath, test whether the endpoints respond there:

textCopy

https://[Store URL]/[Store Path]/oauth/token/request

textCopy

https://[Store URL]/[Store Path]/oauth/token/access

If only the subpath URLs respond, configure your web server to redirect the main-domain OAuth URLs to them. For Apache, the following example belongs in the main domain’s root .htaccess file. Replace [Store Path] with your actual subpath, without leading or trailing slashes, and place these rules before general routing rules. See Apache’s rewrite documentation for configuration requirements.

textCopy

RewriteEngine on
RewriteRule ^oauth/token/request$ https://%{HTTP_HOST}/[Store Path]/oauth/token/request [L,R=301]
RewriteRule ^oauth/token/access$ https://%{HTTP_HOST}/[Store Path]/oauth/token/access [L,R=301]

After updating the redirects, repeat the endpoint checks and try connecting the integration again.

Delete the integration and re-create it

If you’ve made changes after a previous failed integration attempt, it is a good idea to delete the original OAuth integration. The keys used may be invalid and will need to be regenerated.

  1. Within Magento, navigate to System.
  2. Select Integrations.
  3. Locate the Klaviyo integration record, click its delete icon, and click OK to confirm.

Once the integration record is deleted, follow Set up OAuth in our Magento 2 guide to create and authorize a new integration record. Then complete Enable the Magento 2 integration in Klaviyo if you have not already done so.

Magento version-specific issues

Failure specific to Magento 2.4.2

If you’re using Magento 2.4.2, there is a known issue where OAuth activations fail. Upon activating the integration, you may see an error message like the one shown below. Even if you don’t receive the error, the OAuth activation may have failed. Normally, the error can be found in your Magento logs.

m2oauthfailed.png

m2oauthfailed.png

In order to resolve this error, you will need to either:

Authentication failure specific to Magento 2.4.6

Are you on Magento 2.4.6 and experiencing a 401 authentication error after integrating with Klaviyo? This could be due to a known Magento bug affecting Magento version 2.4.6. When a signed OAuth request fails authentication during a sync, Klaviyo automatically retries using bearer-token authentication. Enable bearer-token authentication in Magento to allow these requests.

This setting allows an integration access token to authenticate on its own. Review Adobe’s token-authentication security guidance before enabling it.

  1. In your Magento admin, navigate to Stores > Configuration > Services > OAuth > Consumer Settings.
  2. For the setting Allow OAuth Access Tokens to be used as standalone Bearer tokens, select Yes.
  3. Click Save Config.

Troubleshooting your Magento 2 integration - 图5

Troubleshooting your Magento 2 integration - 图6

If blocked bearer-token requests caused the authentication error, saving this setting allows those requests to succeed. Check that your integration syncs resume. If authentication errors continue, contact Klaviyo support.

Additional resources

Learn what data Klaviyo imports from your Magento 2 store when you integrate the two platforms. Klaviyo's integration with Magento 2 pulls in all of the historical data in your Magento 2 store with the initial historic sync. Once enabled the integration will also begin to sync order and customer data every 30 minutes. Examples of this data include the information associated with past placed orders, fulfilled orders, etc. - Guide to supporting multiple Magento stores (for Magento 2.x)

If you have a single Magento 2 server that hosts more than one store, you have two options as you get setup with Klaviyo:

Was this article helpful?

YesNo

Use this form only for article feedback. Learn how to contact support.

Explore more from Klaviyo

Community

Connect with peers, partners, and Klaviyo experts to find inspiration, share insights, and get answers to all of your questions.

Visit Community

Partners

Hire a Klaviyo-certified expert to help you with a specific task, or for ongoing marketing management.

Hire a partner

Support

Access support through your account.

Email support (free trial and paid accounts) Available 24/7

Chat/virtual assistance Availability varies by location and plan type

Log in