> For the complete documentation index, see [llms.txt](https://docs.anedot.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.anedot.com/integrations/political-campaign-tools/netfile-integration.md).

# NetFile

Connect Anedot to NetFile for campaign finance reporting from Action Page donation data.

**NetFile** is a political compliance software platform that supports campaign disclosure and reporting requirements.

## Connecting Anedot to NetFile

To connect Anedot with NetFile:

1. In your Anedot account, go to **Settings -> Integrations -> Directory.**
2. Click the blue **+ New Connection** and select **NetFile** from the list.
3. Configure**Action Page**Syncing
   * By default, **all Action Pages** will be synced with NetFile.
   * To exclude specific pages, enter a **comma-separated list** of their Action Page IDs.
   * *(Optional)* Scope the integration to a specific **Team**. If no team is selected, all selected pages will be synced.
4. Enter**NetFile Credentials**
   * **Username**
   * **Password**
   * **Account Name**
   * *(Optional)* **Bank Account ID**
5. Click **Save**. Once credentials are saved, the integration is live.

*You can update Action Pages, Team scoping, and credentials at any time.*

***Important**: NetFile's Campaign FreeFiler software does not support integration with Anedot.*

## Data Relays

Anedot sends data from both **financial (donation)** and **non-financial (lead)** Action Pages to NetFile. Due to NetFile's session-based API, each submission triggers a series of relays within a session.

> *Conduit Transactions are not supported.*

### Relay Sequence

1. **Session Start:** Opens a session and receives a sessionID.
2. **Donor Information:** Sent using the sessionID.
3. **Donation Data:** (If applicable) Sent using the same sessionID.
4. **Session Close:** Final relay closes and invalidates the session.

> *All relays must occur in sequence for successful data transmission.*

### Relay Reliability and Retry Behavior

* **Push Unsent**: You can manually retry failed donations using a date range filter.
  * Applies to **all Action Pages**, regardless of type.
  * If **five consecutive relay failures** occur, the integration is marked **inactive** and stops attempting further relays.

### Important Notes

* Anedot does **not use or store unique donor identifiers** for NetFile.
* All relay requests are sent as upserts (update or insert):
  * NetFile attempts to **find and update** an existing contributor.
  * If no match is found (e.g. data mismatch), a **duplicate record** may be created.
  * You may need to use NetFile's **Merge Entities** feature to clean up duplicates.

### Managing Data in NetFile

* Use the **Contributions** tab to search for gifts.
* You can search for:
  * **Monetary records** (donations)
  * **Non-monetary records** (form submissions)
* Review **search fields**, **search results**, and **field mappings** as needed to manage your records effectively.

## Field Mapping

### Donor Fields

The Anedot Fields match the Submission's Raw Data and the NetFile Fields match the Request Body relay.

| Anedot Field                         | NetFile Field |
| ------------------------------------ | ------------- |
| (Submission) id                      | Id            |
| email                                | Email         |
| suffix                               | Suffix        |
| 1                                    | Category      |
| employerName                         | Employer      |
| 1                                    | IdSource      |
| lastName                             | LastName      |
| firstName                            | FirstName     |
| phone                                | PhoneHome     |
| address postalCode                   | AddressZip    |
| occupation                           | Occupation    |
| address city                         | AddressCity   |
| address line1                        | AddressLine1  |
| address line2                        | AddressLine2  |
| address region                       | AddressState  |
| sessionId from Relay 1 Response Body | SessionId     |

### Donation Fields

The Anedot Fields match the Submission's Raw Data and the NetFile Fields match the Request Body relay.

| Anedot Field                                  | NetFile Field        |
| --------------------------------------------- | -------------------- |
| (Donation) id                                 | Id                   |
| amount x100                                   | Amount               |
| (Submission) id                               | EntityId             |
| 1                                             | IdSource             |
| YYYYMMDD Formatted date of relay              | BatchNumber          |
| NetFile field saved in the integration drawer | ElectionYear         |
| NetFile field saved in the integration drawer | ElectionCycle        |
| createdAt                                     | DateDisclosure       |
| 1                                             | EntityIdSource       |
| 1                                             | TransactionType      |
| NetFile field saved in the integration drawer | BankAccountReference |
| sessionId from Relay 1 Response Body          | SessionId            |

## Payload Data

### Request Headers

```
{ }
```

### Request Body 1 (Opens Sessions)

```
{ }
```

### Request Body 2 (Donor Relay)

```json
{"Items": [{"Id": "de5a291d4d67e4136b879", "Email": "admin@anedot.com", "Suffix": null, "Category": "1", "Employer": null, "IdSource": "1", "LastName": "Dot", "FirstName": "Annie", "PhoneHome": "1231231234", "AddressZip": null, "Occupation": null, "AddressCity": null, "AddressLine1": null, "AddressLine2": null, "AddressState": null}], "SessionId": "aa7e376112be468b9daeb00300bd267b"}
```

### Request Body 3 (Donation Relay)

```json
{"Items": [{"Id": "d915925476d75c84e5e3a", "Amount": 100.0, "EntityId": "de5a291d4d67e4136b879", "IdSource": "1", "BatchNumber": "20230515", "ElectionYear": null, "ElectionCycle": null, "DateDisclosure": "2023-05-15T14:32:01-04:00", "EntityIdSource": "1", "TransactionType": "1", "BankAccountReference": ""}], "SessionId": "aad91731fbd64058b338b00300be189e"}
```

### Request Body 4 (Ends Session)

```json
{"SessionId": "aa7e376112be468b9daeb00300bd267b"}
```

### Response Body 1 (Open Session)

```json
{"account": "ANEDOT", "lockDate": null, "userName": "PDIETZEL", "sessionId": "aa7e376112be468b9daeb00300bd267b", "futureDate": null, "responseStatus": null}
```

### Response Body 2 (Donor Relay)

```json
{"items": [{"index": 0, "action": "Update", "netFileId": "366", "submittedId": "de5a291d4d67e4136b879", "errorMessage": null}], "failureCount": 0, "successCount": 1, "responseStatus": null}
```

### Response Body 3 (Donation Relay)

```json
{"items": [{"index": 0, "action": "Insert", "netFileId": "1586", "submittedId": "d915925476d75c84e5e3a", "errorMessage": null}], "failureCount": 0, "successCount": 1, "responseStatus": null}
```

### Response Body 4 (Ends Session)

```json
{"responseStatus": null}
```

### Response Status (Success)

```
200
```

### Response Status (Failure)

```
500
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.anedot.com/integrations/political-campaign-tools/netfile-integration.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
