# SunFire Contact Matching Rules

{% hint style="success" %}
**Audience:** Admins, Developers, <code class="expression">space.vars.automation</code> Builders, Support & Operation teams, and Solution Architects

**Purpose:** Explains the rules <code class="expression">space.vars.Kizen\_company\_name</code> uses to match Contact data returned from SunFire to existing <code class="expression">space.vars.contact</code> <code class="expression">space.vars.entities</code>.
{% endhint %}

## Overview

When SunFire returns session or enrollment data, <code class="expression">space.vars.Kizen\_company\_name</code> applies a defined set of <code class="expression">space.vars.contact</code> matching rules to determine whether the incoming data should update an existing <code class="expression">space.vars.contact</code> or create a new one. These rules are evaluated in priority order to ensure the most accurate match and reduce the risk of duplicate <code class="expression">space.vars.entities</code>.

If none of the matching rules result in a match, <code class="expression">space.vars.Kizen\_company\_name</code> creates a new <code class="expression">space.vars.contact</code> <code class="expression">space.vars.entity</code> using the returned data.

{% hint style="info" %}
**Note:** These matching rules apply only to <code class="expression">space.vars.contact</code> data received through the SunFire integration. Other integrations may use different matching logic.
{% endhint %}

### **Why Matching Matters**

Accurate <code class="expression">space.vars.contact</code> matching ensures enrollment and session data is applied to the correct <code class="expression">space.vars.contact</code> <code class="expression">space.vars.entity</code>, helping prevent duplicate <code class="expression">space.vars.contacts</code> and keeping customer data consistent across <code class="expression">space.vars.Kizen\_company\_name</code> and SunFire.

## Contact Matching Rules

| Priority | Matching Rule                                                     | Behavior                                                                                                                                                                                                                                                                                                                 |
| -------- | ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 1        | Exact <code class="expression">space.vars.contact</code> ID match | Update the existing <code class="expression">space.vars.contact</code> <code class="expression">space.vars.entity</code>.                                                                                                                                                                                                |
| 2        | Email match                                                       | If the date of birth, Medicare ID, and first name match also match, update the existing <code class="expression">space.vars.contact</code>. Otherwise, if there is is a mismatch on a secondary field, then exclude the email field from future <code class="expression">space.vars.contact</code> updates or creations. |
| 3        | Medicare ID match                                                 | Update existing <code class="expression">space.vars.contact</code> <code class="expression">space.vars.entity</code>. Updates the existing <code class="expression">space.vars.contact</code> email if the email is present, but no match was found in the last step.                                                    |
| 4        | Phone Number + First Name match                                   | Compare the phone number to both the mobile and home phone number in <code class="expression">space.vars.Kizen\_company\_name</code>. If multiple matches are found, the first <code class="expression">space.vars.entity</code> is used.                                                                                |
| 5        | Last Name + Carrier match                                         | <p>If email, medicare, and phone are all blank, then we use Last Name + Carrier as a fallback due to the absence of secondary identifiers.</p><p><br></p>                                                                                                                                                                |
| 6        | Create New <code class="expression">space.vars.contact</code>     | <p>Update the existing <code class="expression">space.vars.contact</code> or create a new <code class="expression">space.vars.contact</code> using LastName + Carrier (if all secondary identifiers are missing).<br></p>                                                                                                |

{% hint style="info" %}
**Note:** These rules apply only to <code class="expression">space.vars.contact</code> data received through the SunFire integration. Other integrations may follow different matching logic.
{% endhint %}

***

## What's Next

If you need additional context, you can review other SunFire documentation to better understand the full integration, including launching SunFire from <code class="expression">space.vars.contact</code> <code class="expression">space.vars.entities</code> and how data is exchanged between <code class="expression">space.vars.Kizen\_company\_name</code> and SunFire during quoting and enrollment <code class="expression">space.vars.workflows</code>.

<details>

<summary>Related Topics</summary>

* [SunFire](/docs/integrations-and-plugins/integrations/sunfire.md)
* [Launching SunFire from a Contact Record](/docs/integrations-and-plugins/integrations/sunfire/launching-sunfire-from-a-contact-record.md)
* [SunFire Integration Data Mapping](/docs/integrations-and-plugins/integrations/sunfire/sunfire-integration-data-mapping.md)

</details>


---

# 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://developer.kizen.com/docs/integrations-and-plugins/integrations/sunfire/sunfire-contact-matching-rules.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.
