# Mailchimp Integration

{% embed url="<https://www.loom.com/share/1734d25da74942e08f319d14d9f9b485?sid=8b98a606-a45e-4e73-92df-5c50a4289c4d>" %}

## Create an Account with Mailchimp or Login to Existing

### Create a new API Key in account settings

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2FaJTxTQq12iATquWx5MFg%2Fmc_api-key.png?alt=media&#x26;token=04bd705e-ddee-4581-b210-0b3a28fb7af9" alt=""><figcaption><p>Create a new API Key</p></figcaption></figure>

### Create a List ID, also known as Audience ID

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2FjKQVKE8LcnG28Ect90jw%2Fmc_list-id.png?alt=media&#x26;token=c2de58c2-153c-4f14-88fc-e756b7e708b9" alt=""><figcaption><p>The List Id, can be found inside Audience > Settings</p></figcaption></figure>

### Connect to Subrise

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2FCcsqmc1kO1zMhQPkPHvw%2FScreenshot%202024-05-16%20at%209.57.03%E2%80%AFAM.png?alt=media&#x26;token=fd21be90-bf93-4d03-b08d-90f2e0c91df5" alt=""><figcaption><p>Enter you API Key and List ID (Audience ID) into Subrise</p></figcaption></figure>

### Receive Subrise Data to Mailchimp!

<figure><img src="https://1507690303-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoNYxxCzbbZsdqiP7Nha8%2Fuploads%2F1MV9Nx8gY1IQHjNLvSHy%2Fmc_CHoose%20the%20starting%20point%20topic.png?alt=media&#x26;token=754be673-b47e-4a62-a56c-a32882d71b5c" alt=""><figcaption></figcaption></figure>

## Event Types and Payloads

The Subrise Subscription application, will send subscription-based data to your Mailchimp 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,
    },
    ]
  }
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.subrise.app/guide/settings/integrations/mailchimp-integration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
