# ExpenseIn schema ERD

Table and field reference for the Fivetran ExpenseIn connector.

## Table & Field Reference

### custom_field_dropdown_value

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| custom_field_id | Unknown | PK, FK |
| dropdown_value | Unknown |  |

### custom_field_display_category

| Column | Type | Keys |
| --- | --- | --- |
| custom_field_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### custom_field_visible_user

| Column | Type | Keys |
| --- | --- | --- |
| custom_field_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### custom_field_visible_department

| Column | Type | Keys |
| --- | --- | --- |
| custom_field_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### custom_field_visible_user_group

| Column | Type | Keys |
| --- | --- | --- |
| custom_field_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### custom_field

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| date_added | Unknown |  |
| display_order | Unknown |  |
| is_deleted | Unknown |  |
| name | Unknown |  |
| required | Unknown |  |
| target | Unknown |  |
| type | Unknown |  |
| visibility | Unknown |  |

### purchase_method

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| date_added | Unknown |  |
| icon_css_class | Unknown |  |
| is_deleted | Unknown |  |
| is_reconcilable | Unknown |  |
| is_reimbursable | Unknown |  |
| is_system | Unknown |  |
| name | Unknown |  |

### vehicle_specification_fuel_rate

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| vehicle_specification_id | Unknown | PK, FK |
| effective_date | Unknown |  |
| rate | Unknown |  |

### vehicle_specification_visible_user

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| vehicle_specification_id | Unknown | PK, FK |

### vehicle_specification_visible_department

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| vehicle_specification_id | Unknown | PK, FK |

### vehicle_specification_visible_user_group

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| vehicle_specification_id | Unknown | PK, FK |

### vehicle_specification

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| date_added | Unknown |  |
| engine_size | Unknown |  |
| fuel_type | Unknown |  |
| is_deleted | Unknown |  |
| visibility | Unknown |  |

### project_custom_field

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| project_id | Unknown | PK, FK |
| value | Unknown |  |

### project_billable_category

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| project_id | Unknown | PK, FK |

### project_visible_user

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| project_id | Unknown | PK, FK |

### project_visible_department

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| project_id | Unknown | PK, FK |

### project_visible_user_group

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| project_id | Unknown | PK, FK |

### project

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| applies_to_invoicing | Unknown |  |
| applies_to_mileage_expenses | Unknown |  |
| applies_to_mileage_log_expenses | Unknown |  |
| applies_to_purchase_expenses | Unknown |  |
| applies_to_time_expenses | Unknown |  |
| approval_flow_id | Unknown |  |
| approval_flow_name | Unknown |  |
| billable_type | Unknown |  |
| date_added | Unknown |  |
| description | Unknown |  |
| invoicing_approval_flow_id | Unknown |  |
| invoicing_approval_flow_name | Unknown |  |
| is_active | Unknown |  |
| is_deleted | Unknown |  |
| name | Unknown |  |
| reference | Unknown |  |
| visibility | Unknown |  |

### vehicle_custom_field

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| vehicle_id | Unknown | PK, FK |
| value | Unknown |  |

### vehicle

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| user_id | Unknown | FK |
| vehicle_specification_id | Unknown | FK |
| date_added | Unknown |  |
| is_deleted | Unknown |  |
| is_fuel_reimbursable | Unknown |  |
| make | Unknown |  |
| model | Unknown |  |
| registration | Unknown |  |

### department_custom_field

| Column | Type | Keys |
| --- | --- | --- |
| department_id | Unknown | PK, FK |
| id | Unknown | PK, FK |
| value | Unknown |  |

### department_visible_user

| Column | Type | Keys |
| --- | --- | --- |
| department_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### department_visible_user_group

| Column | Type | Keys |
| --- | --- | --- |
| department_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### department

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| approval_flow_id | Unknown |  |
| approval_flow_name | Unknown |  |
| date_added | Unknown |  |
| invoicing_approval_flow_id | Unknown |  |
| invoicing_approval_flow_name | Unknown |  |
| is_deleted | Unknown |  |
| name | Unknown |  |
| reference | Unknown |  |
| visibility | Unknown |  |
| visible_departments | Json |  |

### policy

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| description | Unknown |  |
| name | Unknown |  |

### user_custom_field

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| user_id | Unknown | PK, FK |
| value | Unknown |  |

### user_role

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| user_id | Unknown | PK, FK |

### user_group

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| user_id | Unknown | PK, FK |
| name | Unknown |  |

### users

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| department_id | Unknown | FK |
| expense_policy_id | Unknown | FK |
| account_id | Unknown |  |
| account_name | Unknown |  |
| approval_flow_id | Unknown |  |
| approval_flow_name | Unknown |  |
| bank_account_number | Unknown |  |
| bank_bic | Unknown |  |
| bank_branch_code | Unknown |  |
| bank_code | Unknown |  |
| bank_iban | Unknown |  |
| email | Unknown |  |
| expense_policy_name | Unknown |  |
| first_name | Unknown |  |
| invoicing_approval_flow_id | Unknown |  |
| invoicing_approval_flow_name | Unknown |  |
| last_name | Unknown |  |
| leaving_date | Unknown |  |
| reference | Unknown |  |
| statement_identifier | Unknown |  |
| two_step_authentication_enabled | Unknown |  |

### role

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| parent_role_id | Unknown | FK |
| name | Unknown |  |

### receipt

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| expense_id | Unknown | FK |
| purchase_method_id | Unknown | FK |
| client_date_added | Unknown |  |
| client_date_updated | Unknown |  |
| client_id | Unknown |  |
| date_added | Unknown |  |
| date_updated | Unknown |  |
| file_name | Unknown |  |
| is_deleted | Unknown |  |
| is_shared | Unknown |  |
| memo | Unknown |  |

### category_custom_field

| Column | Type | Keys |
| --- | --- | --- |
| category_id | Unknown | PK, FK |
| id | Unknown | PK, FK |
| value | Unknown |  |

### category_visible_user

| Column | Type | Keys |
| --- | --- | --- |
| category_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### category_visible_department

| Column | Type | Keys |
| --- | --- | --- |
| category_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### category_visible_user_group

| Column | Type | Keys |
| --- | --- | --- |
| category_id | Unknown | PK, FK |
| id | Unknown | PK, FK |
| name | Unknown |  |

### category

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| default_tax_rate_id | Unknown | FK |
| applies_to_invoicing | Unknown |  |
| applies_to_mileage_expense | Unknown |  |
| applies_to_mileage_log_expense | Unknown |  |
| applies_to_purchase_expense | Unknown |  |
| applies_to_time_expense | Unknown |  |
| carbon_category | Unknown |  |
| date_added | Unknown |  |
| description | Unknown |  |
| enforce_default_tax_rate | Unknown |  |
| fixed_amount | Unknown |  |
| is_deleted | Unknown |  |
| is_reportable | Unknown |  |
| name | Unknown |  |
| reference | Unknown |  |
| show_attendee | Unknown |  |
| show_number_of_nights | Unknown |  |
| visibility | Unknown |  |

### mileage_rate_custom_field

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| mileage_rate_id | Unknown | PK, FK |
| value | Unknown |  |

### mileage_rate_visible_user

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| mileage_rate_id | Unknown | PK, FK |

### mileage_rate_visible_department

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| mileage_rate_id | Unknown | PK, FK |

### mileage_rate_visible_user_group

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| mileage_rate_id | Unknown | PK, FK |

### mileage_rate

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| date_added | Unknown |  |
| is_deleted | Unknown |  |
| maximum_distance | Unknown |  |
| minimum_distance | Unknown |  |
| name | Unknown |  |
| rate | Unknown |  |
| visibility | Unknown |  |

### tax_rate_custom_field

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| tax_rate_id | Unknown | PK, FK |
| value | Unknown |  |

### tax_rate_visible_user

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| tax_rate_id | Unknown | PK, FK |

### tax_rate_visible_department

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| tax_rate_id | Unknown | PK, FK |

### tax_rate_visible_user_group

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK, FK |
| tax_rate_id | Unknown | PK, FK |

### tax_rate

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| date_added | Unknown |  |
| is_deleted | Unknown |  |
| name | Unknown |  |
| rate | Unknown |  |
| reference | Unknown |  |
| visibility | Unknown |  |

### expense_to_location

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| expense_id | Unknown | PK, FK |
| is_postcode | Unknown |  |
| map_name | Unknown |  |
| name | Unknown |  |

### expense_policy_result

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| expense_id | Unknown | PK, FK |
| policy_rule_result | Unknown |  |
| status | Unknown |  |

### expense_custom_field

| Column | Type | Keys |
| --- | --- | --- |
| expense_id | Unknown | PK, FK |
| id | Unknown | PK, FK |
| value | Unknown |  |

### expense_attendee

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| expense_id | Unknown | PK, FK |
| attendee | Unknown |  |

### expense_time_rate_visible_user

| Column | Type | Keys |
| --- | --- | --- |
| expense_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### expense_time_rate_visible_department

| Column | Type | Keys |
| --- | --- | --- |
| expense_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### expense_time_rate_visible_user_group

| Column | Type | Keys |
| --- | --- | --- |
| expense_id | Unknown | PK, FK |
| id | Unknown | PK, FK |

### expense_journey

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| expense_id | Unknown | PK, FK |
| project_id | Unknown | FK |
| base_distance | Unknown |  |
| description | Unknown |  |
| from_location_is_postcode | Unknown |  |
| from_location_map_name | Unknown |  |
| from_location_name | Unknown |  |
| journey_date | Unknown |  |
| map_base_distance | Unknown |  |
| to_location_is_postcode | Unknown |  |
| to_location_map_name | Unknown |  |
| to_location_name | Unknown |  |

### expense

| Column | Type | Keys |
| --- | --- | --- |
| id | Unknown | PK |
| category_id | Unknown | FK |
| department_id | Unknown | FK |
| mileage_rate_id | Unknown | FK |
| project_id | Unknown | FK |
| purchase_method_id | Unknown | FK |
| tax_rate_id | Unknown | FK |
| user_id | Unknown | FK |
| vehicle_id | Unknown | FK |
| vehicle_specification_id | Unknown | FK |
| approved_date | Unknown |  |
| base_distance | Unknown |  |
| base_gross_amount | Unknown |  |
| base_map_distance | Unknown |  |
| base_net_amount | Unknown |  |
| base_tax_amount | Unknown |  |
| billed | Unknown |  |
| client_date_added | Unknown |  |
| client_date_updated | Unknown |  |
| client_id | Unknown |  |
| commute_base_distance | Unknown |  |
| commute_distance | Unknown |  |
| commute_is_return | Unknown |  |
| completed | Unknown |  |
| completed_date | Unknown |  |
| currency_code | Unknown |  |
| currency_id | Unknown |  |
| currency_name | Unknown |  |
| currency_symbol | Unknown |  |
| date_added | Unknown |  |
| date_updated | Unknown |  |
| description | Unknown |  |
| distance | Unknown |  |
| distance_unit | Unknown |  |
| duration | Unknown |  |
| exchange_rate | Unknown |  |
| expense_date | Unknown |  |
| flight_class | Unknown |  |
| flight_from_airport_country_code_three_letter | Unknown |  |
| flight_from_airport_country_id | Unknown |  |
| flight_from_airport_country_name | Unknown |  |
| flight_from_airport_country_standard_tax_rate | Unknown |  |
| flight_from_airport_country_tax_label | Unknown |  |
| flight_from_airport_iata_code | Unknown |  |
| flight_from_airport_id | Unknown |  |
| flight_from_airport_name | Unknown |  |
| flight_return_journey | Unknown |  |
| flight_to_airport_country_code_three_letter | Unknown |  |
| flight_to_airport_country_id | Unknown |  |
| flight_to_airport_country_name | Unknown |  |
| flight_to_airport_country_standard_tax_rate | Unknown |  |
| flight_to_airport_country_tax_label | Unknown |  |
| flight_to_airport_iata_code | Unknown |  |
| flight_to_airport_id | Unknown |  |
| flight_to_airport_name | Unknown |  |
| from_location_is_postcode | Unknown |  |
| from_location_map_name | Unknown |  |
| from_location_name | Unknown |  |
| fuel_rate | Unknown |  |
| gross_amount | Unknown |  |
| hotel_country_code_three_letter | Unknown |  |
| hotel_country_id | Unknown |  |
| hotel_country_name | Unknown |  |
| hotel_country_standard_tax_rate | Unknown |  |
| hotel_country_tax_label | Unknown |  |
| import_date_added | Unknown |  |
| import_id | Unknown |  |
| import_purchase_method_id | Unknown |  |
| import_purchase_method_name | Unknown |  |
| import_statement_date | Unknown |  |
| interval | Unknown |  |
| interval_count | Unknown |  |
| is_billable | Unknown |  |
| is_deleted | Unknown |  |
| is_fuel_reimbursable | Unknown |  |
| is_reconcilable | Unknown |  |
| is_reimbursable | Unknown |  |
| is_return | Unknown |  |
| kg_co_2_e | Unknown |  |
| map_distance | Unknown |  |
| map_duration | Unknown |  |
| merchant_id | Unknown |  |
| merchant_name | Unknown |  |
| merchant_reference | Unknown |  |
| notes | Unknown |  |
| number_of_nights | Unknown |  |
| odometer_end | Unknown |  |
| odometer_start | Unknown |  |
| purchase_merchant_name | Unknown |  |
| rate | Unknown |  |
| receipt_verified | Unknown |  |
| reconciled | Unknown |  |
| reimbursed | Unknown |  |
| rejected_reason | Unknown |  |
| resubmitted | Unknown |  |
| road_return_journey | Unknown |  |
| road_travel_from | Unknown |  |
| road_travel_to | Unknown |  |
| road_travel_type | Unknown |  |
| split_group_id | Unknown |  |
| status | Unknown |  |
| submission_date_submitted | Unknown |  |
| submission_id | Unknown |  |
| time_rate_id | Unknown |  |
| time_rate_interval | Unknown |  |
| time_rate_name | Unknown |  |
| time_rate_rate | Unknown |  |
| time_rate_visibility | Unknown |  |
| train_return_journey | Unknown |  |
| train_station_from_country_code_three_letter | Unknown |  |
| train_station_from_country_id | Unknown |  |
| train_station_from_country_name | Unknown |  |
| train_station_from_country_standard_tax_rate | Unknown |  |
| train_station_from_country_tax_label | Unknown |  |
| train_station_from_id | Unknown |  |
| train_station_from_name | Unknown |  |
| train_station_to_country_code_three_letter | Unknown |  |
| train_station_to_country_id | Unknown |  |
| train_station_to_country_name | Unknown |  |
| train_station_to_country_standard_tax_rate | Unknown |  |
| train_station_to_country_tax_label | Unknown |  |
| train_station_to_id | Unknown |  |
| train_station_to_name | Unknown |  |
| train_type | Unknown |  |
| type | Unknown |  |
| validated | Unknown |  |

## Relationships

- custom_field_dropdown_value(custom_field_id) → custom_field(id)
- custom_field_display_category(id) → category(id)
- custom_field_display_category(custom_field_id) → custom_field(id)
- custom_field_visible_user(id) → users(id)
- custom_field_visible_user(custom_field_id) → custom_field(id)
- custom_field_visible_department(id) → department(id)
- custom_field_visible_department(custom_field_id) → custom_field(id)
- custom_field_visible_user_group(id) → user_group(id)
- custom_field_visible_user_group(custom_field_id) → custom_field(id)
- vehicle_specification_fuel_rate(vehicle_specification_id) → vehicle_specification(id)
- vehicle_specification_visible_user(id) → users(id)
- vehicle_specification_visible_user(vehicle_specification_id) → vehicle_specification(id)
- vehicle_specification_visible_department(id) → department(id)
- vehicle_specification_visible_department(vehicle_specification_id) → vehicle_specification(id)
- vehicle_specification_visible_user_group(id) → user_group(id)
- vehicle_specification_visible_user_group(vehicle_specification_id) → vehicle_specification(id)
- project_custom_field(id) → custom_field(id)
- project_custom_field(project_id) → project(id)
- project_billable_category(id) → category(id)
- project_billable_category(project_id) → project(id)
- project_visible_user(id) → users(id)
- project_visible_user(project_id) → project(id)
- project_visible_department(id) → department(id)
- project_visible_department(project_id) → project(id)
- project_visible_user_group(id) → user_group(id)
- project_visible_user_group(project_id) → project(id)
- vehicle_custom_field(id) → custom_field(id)
- vehicle_custom_field(vehicle_id) → vehicle(id)
- vehicle(user_id) → users(id)
- vehicle(vehicle_specification_id) → vehicle_specification(id)
- department_custom_field(id) → custom_field(id)
- department_custom_field(department_id) → department(id)
- department_visible_user(id) → users(id)
- department_visible_user(department_id) → department(id)
- department_visible_user_group(id) → user_group(id)
- department_visible_user_group(department_id) → department(id)
- user_custom_field(id) → custom_field(id)
- user_custom_field(user_id) → users(id)
- user_role(id) → role(id)
- user_role(user_id) → users(id)
- user_group(user_id) → users(id)
- users(department_id) → department(id)
- users(expense_policy_id) → policy(id)
- role(parent_role_id) → role(id)
- receipt(expense_id) → expense(id)
- receipt(purchase_method_id) → purchase_method(id)
- category_custom_field(id) → custom_field(id)
- category_custom_field(category_id) → category(id)
- category_visible_user(id) → users(id)
- category_visible_user(category_id) → category(id)
- category_visible_department(id) → department(id)
- category_visible_department(category_id) → category(id)
- category_visible_user_group(id) → user_group(id)
- category_visible_user_group(category_id) → category(id)
- category(default_tax_rate_id) → tax_rate(id)
- mileage_rate_custom_field(id) → custom_field(id)
- mileage_rate_custom_field(mileage_rate_id) → mileage_rate(id)
- mileage_rate_visible_user(id) → users(id)
- mileage_rate_visible_user(mileage_rate_id) → mileage_rate(id)
- mileage_rate_visible_department(id) → department(id)
- mileage_rate_visible_department(mileage_rate_id) → mileage_rate(id)
- mileage_rate_visible_user_group(id) → user_group(id)
- mileage_rate_visible_user_group(mileage_rate_id) → mileage_rate(id)
- tax_rate_custom_field(id) → custom_field(id)
- tax_rate_custom_field(tax_rate_id) → tax_rate(id)
- tax_rate_visible_user(id) → users(id)
- tax_rate_visible_user(tax_rate_id) → tax_rate(id)
- tax_rate_visible_department(id) → department(id)
- tax_rate_visible_department(tax_rate_id) → tax_rate(id)
- tax_rate_visible_user_group(id) → user_group(id)
- tax_rate_visible_user_group(tax_rate_id) → tax_rate(id)
- expense_to_location(expense_id) → expense(id)
- expense_policy_result(expense_id) → expense(id)
- expense_custom_field(id) → custom_field(id)
- expense_custom_field(expense_id) → expense(id)
- expense_attendee(expense_id) → expense(id)
- expense_time_rate_visible_user(id) → users(id)
- expense_time_rate_visible_user(expense_id) → expense(id)
- expense_time_rate_visible_department(id) → department(id)
- expense_time_rate_visible_department(expense_id) → expense(id)
- expense_time_rate_visible_user_group(id) → user_group(id)
- expense_time_rate_visible_user_group(expense_id) → expense(id)
- expense_journey(project_id) → project(id)
- expense_journey(expense_id) → expense(id)
- expense(mileage_rate_id) → mileage_rate(id)
- expense(user_id) → users(id)
- expense(department_id) → department(id)
- expense(project_id) → project(id)
- expense(tax_rate_id) → tax_rate(id)
- expense(vehicle_specification_id) → vehicle_specification(id)
- expense(category_id) → category(id)
- expense(purchase_method_id) → purchase_method(id)
- expense(vehicle_id) → vehicle(id)
