Skip to main content

How to set up the Klaviyo integration (Returns V2)

Explains how to connect your Klaviyo account to Swap using a private API key, and the steps to take before events start sending.

Written by Guido Kaspers

This article explains how to connect your Klaviyo account to Swap using a private application programming interface (API) key.

ℹ️ This article covers Returns V2. If your store is on Returns V1, see Klaviyo x Swap Integration (Returns V1).


Before you start

  • You need a Klaviyo account, with permission to create private API keys in it. If you do not have one yet, Klaviyo's documentation covers how to set up your account

  • You need Returns V2 enabled on your store

  • The Klaviyo app needs to be available in the Apps panel on your Returns → Integrations page


Step 1: Create a private API key in Klaviyo

Swap authenticates with Klaviyo using a private API key that you create in your own Klaviyo account. Klaviyo's documentation covers the steps: How to create or clone a private API key. You need to be an Owner or Admin in Klaviyo to do this.

Two things to do while you are there:

  • Give the key a name that makes its purpose obvious, for example Swap Returns V2

  • Copy the key before you navigate away

⚠️ Use a private key. A public key cannot create or update profiles, and Klaviyo will reject the connection.


Step 2: Connect Klaviyo in Swap

  1. In the Swap dashboard, go to Returns → Integrations

  2. Find Klaviyo in the Apps panel

  3. Click Connect

  4. Paste the private API key you copied from Klaviyo

  5. Save the connection

The Klaviyo card then shows a Connected status, and the button changes to Disconnect.


Step 3: Choose Klaviyo as your email platform and enable events

Connecting your account does not start sending events on its own. Swap only sends events once you have selected Klaviyo as an email platform and switched at least one event on.

Go to Returns → Settings → Emails and work through How to enable and manage Klaviyo events (Returns V2).


What happens once events are flowing

  • Each event arrives in Klaviyo as a custom metric, named with a V2- prefix, for example V2- Return Created

  • Swap identifies the customer by their email address. Where no matching Klaviyo profile exists, Klaviyo creates one

  • Klaviyo only displays a metric once it has received it at least once. On a new connection, submit a test return, or use Send test against an event, so the metric appears in Klaviyo's metric picker and becomes selectable as a flow trigger

  • You can then build flows on those metrics


Rotating or replacing the key

If you regenerate or delete the key in Klaviyo, the connection stops working until you update it in Swap. Reconnect Klaviyo from Returns → Integrations using the new key.


More on Klaviyo

Did this answer your question?