> ## Documentation Index
> Fetch the complete documentation index at: https://loops.so/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Polar

> Sync contacts and send emails triggered by events in Polar.

<Info>
  Our Polar integration lets you:

  * Create and update contacts
  * Send events to trigger workflows
</Info>

Our Polar integration is built on top of our [Incoming webhooks](/integrations/incoming-webhooks) feature. This system lets you send webhooks from supported platforms directly to Loops so you can easily sync users and customers as well as send automated emails.

You can sync your Polar customer data to Loops for customer, order and subscription events and trigger emails with [workflows](/workflows).

## Supported events

We accept the following Polar events:

* `customer.created`
* `customer.updated`
* `customer.deleted`
* `order.paid`
* `subscription.created`
* `subscription.active`
* `subscription.canceled`
* `subscription.uncanceled`
* `subscription.past_due`
* `subscription.revoked`

<Note>
  When a new subscription is created, the following events are all sent by Polar:

  * `subscription.created`
  * `subscription.active`
  * `customer.created`
  * `order.paid`
</Note>

[Polar webhook docs](https://polar.sh/docs/integrate/webhooks)

If you send other events, they will be ignored.

<Info>
  If you would like to see more events supported, please let us know by sending
  an email to [help@loops.so](mailto:help@loops.so). Please keep in mind only
  events that contain an email address are able to be processed.
</Info>

## Synced data

We sync the following Polar data to your Loops contacts for every incoming event:

* Email address
* First and last name (optional)
* External ID (optional)

We use the email addresses of Polar customers to match contacts in your Loops audience. If the email address is not found in Loops, we will create a new contact.

The external ID is useful if you want to link your Loops contact record to unique users in your application via Polar's [external\_id](https://polar.sh/docs/api-reference/customers/create#body-external-id-one-of-0) field.

The `customer.deleted` event can be used to delete or unsubscribe your Polar customers from your Loops audience.

## Connect Loops and Polar

To get started, go to [Settings -> Polar](https://app.loops.so/settings?page=polar) in Loops and click the **Sign in to Polar** button. Select the Polar organisation you want to connect to. You will be redirected back to Loops when you are done.

A new webhook endpoint will be created in Polar, with the supported events enabled. You can check this by going to **Developers -> Webhooks** in Polar and then clicking on the "Loops" endpoint.

## Configure events

You can select and configure the Polar events you want to be sent to Loops.

For each event, you can choose to trigger workflows via [events](/events) as well as update customer data like assigning a user group and syncing customer names.

Make sure to click **Save** to save your changes.

## Testing Polar webhooks

You can test a `customer.*` webhook by creating a new customer in Polar.

You can see all sent webhooks by going to **Developers -> Webhooks** and then clicking on an endpoint.

On Loops' end, You will see new contacts appear in your [Audience](https://app.loops.so/audience) page, and triggered events in the [Events](https://app.loops.so/settings?page=events) page.

## Examples

Here are some examples of how you can send data from Polar to Loops to sync contacts and trigger useful emails to your customers.

### Syncing customers to Loops

Create or update contacts in your Loops audience when a customer is created or updated in Polar.

1. Connect Loops to Polar.
2. In Loops, make sure `customer.created` and `customer.updated` are toggled on on the Polar settings page.
3. If you want to sync customer names, open the **Sync additional data** section and toggle on **Full name**.

### Send an email to all new Polar customers

Send an email from Loops when a new customer is created in Polar.

1. Create a new workflow in Loops using our **Stripe - New Customer** template.
2. For the workflow trigger, select **Event received** and then select **Polar** from the first dropdown and **customer.created** from the second dropdown.
3. Toggle on `customer.created` on the Polar settings page.

### Send an email after a successful order

Send an email from Loops when an order is paid in Polar.

1. Create a new workflow in Loops using our **Stripe - Payment Successful** template.
2. For the workflow trigger, select **Event received** and then select **Polar** from the first dropdown and **order.paid** from the second dropdown.
3. Toggle on `order.paid` on the Polar settings page.

### Subscription created email

Send an email from Loops when a new subscription is created in Polar.

1. Create a new workflow in Loops.
2. For the workflow trigger, select **Event received** and then select **Polar** from the first dropdown and **subscription.created** from the second dropdown.
3. Add an email node to the workflow and create your email.
4. Toggle on `subscription.created` on the Polar settings page.
