> For the complete documentation index, see [llms.txt](https://docs.subrise.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.subrise.app/guide/settings/integrations/klaviyo-integration.md).

# Klaviyo Integration

Watch our video below, or follow our step by step instruction on setting up the Subrise Subscription app with your Klaviyo account.

{% embed url="<https://www.loom.com/share/2d540b625a6f4cc1a17b0411ca176020?sid=a3da5e3f-a065-4183-823a-c27e4c1e0237>" %}

## Log into your Existing Klaviyo Account or Create one

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2FGubWRyjzTG5heUrORdID%2FHome_page.png?alt=media&amp;token=333a4e0e-4006-43ec-85b0-f1c2dba01c5e" alt=""><figcaption><p>Create a new Klaviyo account or log into your existing one, and head to "Account Plans"</p></figcaption></figure>

## Head to your Settings page in Klaviyo to create a new API Key

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2FRj5HZTVuC4SnWTmnZ6aw%2Fsettings_tab.png?alt=media&amp;token=b57a86a1-bf68-4e32-8112-29d40764ef4e" alt=""><figcaption><p>Once your inside "Account Plans" Click the "Account" tab, and choose "API keys" from the dropdown</p></figcaption></figure>

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2Fxm8OCkgACtt9v4uyZjEV%2Fcreate_api_key.png?alt=media&amp;token=53258d64-84d6-4978-8424-676cd5c2885a" alt=""><figcaption><p>Set your Key restrictions and Create the API Key</p></figcaption></figure>

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2F9lfY8uI9LDCrcVKZbmIZ%2Fcop.png?alt=media&amp;token=69a9b394-aeaf-4a30-aab0-048e3bff2119" alt=""><figcaption><p>Copy your API key, keep this private. (Note: our example key was deleted, so it is safe to show)</p></figcaption></figure>

## Head to the Subrise App, and go to Settings Tab

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2FCoeLiFkEfBv87HuyOwVR%2Fcopy_api_key.png?alt=media&amp;token=c7c18339-582a-44ed-841e-6f806de60f90" alt=""><figcaption><p>On Settings tab in Subrise app, click the "Integrations" tab.</p></figcaption></figure>

## Paste your Klaviyo API Key

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2F26XjM0Y9MMSNODtcsGgC%2Fpaste_api_key.png?alt=media&amp;token=a063ca7d-35b7-4be7-82a2-71e70647d485" alt=""><figcaption><p>Once here, Paste your new API Key, and thats it!</p></figcaption></figure>

## You are now connected to Klaviyo through Subrise!

#### View Klaviyo Metrics

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2F5gBoTOm4fUtK2RdAUXYw%2Fmetrics.png?alt=media&amp;token=12420946-b842-46fb-b218-fd53c0f30646" alt=""><figcaption><p>Click into Analytics > Metrics > "View Activity Feed" To see your Subrise Events</p></figcaption></figure>

***

## Datatypes and Events

The Subrise Subscription application, will send subscription-based data to your Klaviyo account for a variety of different Events. Below are the following Events you can expect to receive data for, as well as the format of that data.

### Events

* [New Subscription](#new-subscription-payload)
* [New Subscriber](#new-subscriber-payload)
* [Subscription Cancelled](#subscription-cancelled-payload)
* [Subscription Modified](#subscription-modified)
* [Upcoming Invoice](#upcoming-invoice-payload)
* [Failed Transaction](#failed-transaction-payload)
* [Successful Payment](#successful-payment-payload)
* [Pause Subscription](#pause-subscription-payload)
* [Reactivated Subscription](#reactivated-subscription-payload)
* [Prepaid Subscription](#prepaid-subscription-payload)
* [Addon Subscription](#addon-subscription-payload)

### New Subscription Payload

```
{
    metric: "subrise_new_subscription",
    customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    subscription_line_items: [
     {
      variant_title: blue shirt,
      price: 1.99,
      quantity: 1,
      discounted_price: 1.99,
    },
    ],
    total_subscription_price: 1.99,
    subscription_started_date: "2024-05-14T17:52:47.910Z",
  }

```

### New Subscriber Payload

```
  {
    metric: "subrise_new_subscriber",
    customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    subscription_total: 1.99,
    subscription_started: "2024-05-14T17:52:47.910Z",
    subscription_line_items: [
     {
      variant_title: blue shirt,
      price: 1.99,
      quantity: 1,
      discounted_price: 1.99,
    },
    ]
  }

```

### Subscription Cancelled Payload

```

{
    metric: "subrise_subscription_cancelled",
    customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    reason: "too good",
    reason_details: "The deal was too good",
    total_subscription_orders: 1,
    subscription_cancelled_date: "2024-05-14T17:52:47.910Z",
  }

```

### Subscription Modified

*updatedField, and updatedValue will correspond to the different fields that may or may not get updated on a Subscription object.*

```

{
    metric: "subrise_subscription_modified",
    customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    subscription_modified_date: "2024-05-14T17:52:47.910Z",
    updatedField1:"deliveryInterval",
    updatedValue1:"MONTH",
    updatedField2:"deliveryIntervalCount",
    updatedValue2:1,
    updatedField3:"billingInterval".
    updatedValue3:"MONTH",
    updatedField4:"billingIntervalCount",
    updatedValue4:1,
    updatedField5:"maxCycles",
    updatedValue5:NULL,
    updatedField6:"minCycles",
    updatedValue6:NULL,
    updatedField7:"isPrepaid",
    updatedValue7:false,
  }

```

### Upcoming Invoice Payload

```

{
    metric: "subrise_upcoming_invoice",
    customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    subscription_invoice_date: "2024-05-14T17:52:47.910Z",
  }

```

### Failed Transaction Payload

```

{
    metric: "subrise_failed_transaction",
     customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    total_subscription_price: 1.99
    failed_billing_error_message: "error",
    card_info: 1234,
  }
`
```

### Successful Payment Payload

```

 {
    metric: "subrise_successful_payment",
    customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    total_subscription_price: 1.99
    payment_date: "2024-05-14T17:52:47.910Z",
  }

```

### Pause Subscription Payload

```
{
    metric: "subrise_pause_subscription",
   customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    pause_reason: "price",
    pauseDetails: "Could not afford this anymore",
    total_subscription_orders: 3,
    subscription_paused_date: "2024-05-14T17:52:47.910Z"
  }
```

### Reactivated Subscription Payload

````

{
    metric: "subrise_reactivate_sub",
    customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    total_subscription_price: 1.99
    subscription_updated_date: "2024-05-14T17:52:47.910Z"
  }
```
````

### Prepaid Subscription Payload

````

{
    metric: "subrise_prepaid_subscription",
     customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    total_subscription_price: 1.99,
    subscription_started: "2024-05-14T17:52:47.910Z",
    subscription_line_items: [
     {
      variant_title: blue shirt,
      price: 1.99,
      quantity: 1,
      discounted_price: 1.99,
    },
    ]
  }
```
````

### Addon Subscription Payload

```
{
    metric: "subrise_addon_purchase",
    customer_first_name: "John",
    customer_last_name: "Doe",
    customer_email: "johndoe@test.com",
    customer_phone: "444-444-4444",
    customer_id: "12345678910"
    subscription_id: "12345678910",
    subscription_total: 1.99,
    subscription_started: "2024-05-14T17:52:47.910Z",
    addon_line_items: [
     {
      variant_title: blue shirt,
      price: 1.99,
      quantity: 1,
      discounted_price: 1.99,
    },
    ]
  }
```
