> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.joincandidhealth.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.joincandidhealth.com/_mcp/server.

# Financial Transactions

> Overview of Financial Transactions tables in Candid Data Share

> **Warning**
>
> **Do Not Use For Patient Invoicing**
>
> Candid Data Share is not designed to support patient invoicing workflows. For all patient invoicing use cases, you must use the [Patient Invoicing API](/patient-collections/patient-invoicing-integration-guide). This is the only supported method for ensuring balance accuracy.
>
> Candid Data Share data are generated on a periodic basis and do not provide a live, real-time view of a patient's balance. Please be advised that Candid cannot support issues related to invoicing breaks or inaccuracies that result from using Candid Data Share for this purpose.

## Transaction Detail Tables

The core of the financial transactions data model is the `export_transaction` table. This table will have most of the information you need to analyze your financial transactions. If you need to access more detailed data about one type of transaction, you can join the `export_transaction` table to one of the associated detail tables using an inner join:

```sql
SELECT *
FROM export_transaction
JOIN export_adjustment_details
  ON export_transaction.transaction_type = 'ADJUSTMENT'
  AND export_transaction.transaction_id = export_adjustment_details.transaction_id
```

## Table Relationships

Each transaction type has its own detail table that can be joined based on the transaction type:

```mermaid
erDiagram
    export_encounter ||--o{ export_transaction : "encounter_id"
    export_service_line ||--o{ export_transaction : "service_line_id"
    export_batch_details |o--o{ export_transaction : "batch_id"
    export_transaction |o--o| export_payment_details : "PAYMENT"
    export_transaction |o--o| export_charge_details : "CHARGE"
    export_transaction |o--o| export_adjustment_details : "ADJUSTMENT"
```

| Table                       | Primary Key      | Join Condition                    |
| --------------------------- | ---------------- | --------------------------------- |
| `export_transaction`        | `transaction_id` | Core transaction table            |
| `export_payment_details`    | `transaction_id` | `transaction_type = 'PAYMENT'`    |
| `export_charge_details`     | `transaction_id` | `transaction_type = 'CHARGE'`     |
| `export_adjustment_details` | `transaction_id` | `transaction_type = 'ADJUSTMENT'` |
| `export_batch_details`      | `batch_id`       | Join on `batch_id`                |

## Informational Adjustments

Informational Adjustments are not tied to a financial transaction and do not affect balances — payers include these Claim Adjustment Reason Codes (CARCs) and Remittance Advice Remark Codes (RARCs) through remits (ERAs) to convey adjudication details. They can be associated directly with Service Lines or Encounters:

```mermaid
erDiagram
    export_informational_adjustment_details }o--|| export_service_line : "service_line_id"
    export_informational_adjustment_details }o--|| export_encounter : "encounter_id"
```

To learn more about CARCs and RARCs, see this Candid Support Center article: [Understanding Remit Codes (CARCs & RARCs)](https://support.joincandidhealth.com/hc/en-us/articles/17352381560852-Understanding-Remit-Codes-CARCs-RARCs).

## Batches

A batch is a monthly accounting period that users can adjust while it is open — the unit Candid's End-of-Month (EOM) close operates on. Each batch runs from `batch_start_date` to `batch_end_date`, and `closed_at` is set once that month is closed (`null` for the open, current period).

## Common Queries

### Service Line Transaction Summary

To view a current transaction summary at the service line level, filtering out voids and voided transactions:

```sql
SELECT *
FROM export_transaction
JOIN export_charge_details
  ON export_transaction.transaction_id = export_charge_details.transaction_id
JOIN export_service_line
  ON export_transaction.service_line_id = export_service_line.service_line_id
WHERE export_transaction.voids_transaction_id IS NULL
  AND export_transaction.voided_by_transaction_id IS NULL
```

### Roll Up Transactions by Batch

```sql
SELECT
  bd.batch_id,
  bd.batch_start_date,
  bd.batch_end_date,
  bd.closed_at,
  SUM(t.amount_cents) as total_amount_cents
FROM export_transaction t
JOIN export_batch_details bd
  ON t.batch_id = bd.batch_id
GROUP BY 1, 2, 3, 4
```