# Braintree schema ERD

Table and field reference for the Fivetran Braintree connector.

## Table & Field Reference

### registered_customer

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| company | String |  |
| created_at | Instant |  |
| email | String |  |
| fax | String |  |
| first_name | String |  |
| last_name | String |  |
| phone | String |  |
| updated_at | Instant |  |
| website | String |  |

### customer_address

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| customer_id | String | FK |
| company | String |  |
| country_code_numeric | String |  |
| country_name | String |  |
| first_name | String |  |
| last_name | String |  |
| locality | String |  |
| postal_code | String |  |
| region | String |  |
| street_address | String |  |

### dispute_status_history

| Column | Type | Keys |
| --- | --- | --- |
| _index | Int | PK |
| dispute_id | String | PK, FK |
| disbursement_date | Instant |  |
| effective_date | Instant |  |
| status | String |  |
| timestamp | Instant |  |

### masterpass_card_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| bin | String |  |
| card_type | String |  |
| cardholder_name | String |  |
| commercial | String |  |
| country_of_issuance | String |  |
| debit | String |  |
| durbin_regulated | String |  |
| expiration_date | String |  |
| expiration_month | String |  |
| expiration_year | String |  |
| healthcare | String |  |
| image_url | String |  |
| issuing_bank | String |  |
| last_4 | String |  |
| payroll | String |  |
| prepaid | String |  |
| product_id | String |  |
| token | String |  |

### transaction_line_item

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| transaction_id | String | PK, FK |
| commodity_code | String |  |
| description | String |  |
| discount_amount | BigDecimal |  |
| kind | String |  |
| name | String |  |
| product_code | String |  |
| quantity | String |  |
| tax_amount | BigDecimal |  |
| total_amount | BigDecimal |  |
| unit_amount | BigDecimal |  |
| unit_of_measure | String |  |
| unit_tax_amount | BigDecimal |  |
| url | String |  |

### apple_pay_card

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| bin | String |  |
| card_type | String |  |
| cardholder_name | String |  |
| commercial | String |  |
| country_of_issuance | String |  |
| debit | String |  |
| expiration_month | String |  |
| expiration_year | String |  |
| healthcare | String |  |
| issuing_bank | String |  |
| last_4 | String |  |
| payment_instrument_name | String |  |
| payroll | String |  |
| prepaid | String |  |
| source_description | String |  |
| token | String |  |

### subscription_status_history

| Column | Type | Keys |
| --- | --- | --- |
| _index | Int | PK |
| subscription_id | String | PK, FK |
| balance | BigDecimal |  |
| price | BigDecimal |  |
| source | String |  |
| status | String |  |
| timestamp | Instant |  |
| user | String |  |

### plan

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| billing_day_of_month | Int |  |
| billing_frequency | Int |  |
| created_at | Instant |  |
| currency_iso_code | String |  |
| description | String |  |
| name | String |  |
| number_of_billing_cycles | Int |  |
| price | BigDecimal |  |
| trial_duration | Int |  |
| trial_duration_unit | String |  |
| updated_at | Instant |  |

### us_bank_account_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| account_holder_name | String |  |
| account_type | String |  |
| ach_mandate | String |  |
| bank_name | String |  |
| image_url | String |  |
| last_4 | String |  |
| routing_number | String |  |
| token | String |  |

### decision_reason

| Column | Type | Keys |
| --- | --- | --- |
| decision_reason | String | PK |
| risk_data_id | String | PK |

### local_payment_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| capture_id | String |  |
| custom_field | String |  |
| debug_id | String |  |
| description | String |  |
| funding_source | String |  |
| payer_id | String |  |
| payment_id | String |  |
| refund_from_transaction_fee_amount | String |  |
| refund_from_transaction_fee_currency_iso_code | String |  |
| refund_id | String |  |
| transaction_fee_amount | String |  |
| transaction_fee_currency_iso_code | String |  |

### paypal_here_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| authorization_id | String |  |
| capture_id | String |  |
| invoice_id | String |  |
| payment_id | String |  |
| payment_type | String |  |
| refund_id | String |  |
| transaction_fee_amount | String |  |
| transaction_fee_currency_iso_code | String |  |
| transaction_initiation_date | String |  |
| transaction_updated_date | String |  |

### visa_checkout_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| bin | String |  |
| call_id | String |  |
| card_type | String |  |
| cardholder_name | String |  |
| commercial | String |  |
| country_of_issuance | String |  |
| debit | String |  |
| durbin_regulated | String |  |
| expiration_month | String |  |
| expiration_year | String |  |
| healthcare | String |  |
| image_url | String |  |
| issuing_bank | String |  |
| last_4 | String |  |
| payroll | String |  |
| prepaid | String |  |
| product_id | String |  |
| token | String |  |

### subscription

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| merchant_account_id | String | FK |
| plan_id | String | FK |
| balance | BigDecimal |  |
| billing_day_of_month | Int |  |
| billing_period_end_date | Instant |  |
| billing_period_start_date | Instant |  |
| created_at | Instant |  |
| current_billing_cycle | Int |  |
| days_past_due | Int |  |
| description | String |  |
| descriptor_name | String |  |
| descriptor_phone | String |  |
| descriptor_url | String |  |
| failure_count | Int |  |
| first_billing_date | Instant |  |
| has_trial_period | Boolean |  |
| never_expires | Boolean |  |
| next_billing_date | Instant |  |
| next_billing_period_amount | BigDecimal |  |
| number_of_billing_cycles | Int |  |
| paid_through_date | Instant |  |
| payment_method_token | String |  |
| price | BigDecimal |  |
| status | String |  |
| trial_duration | Int |  |
| trial_duration_unit | String |  |
| updated_at | Instant |  |

### transaction_discount

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| plan_id | String | FK |
| transaction_id | String | FK |
| amount | BigDecimal |  |
| current_billing_cycle | Int |  |
| description | String |  |
| kind | String |  |
| name | String |  |
| never_expires | Boolean |  |
| number_of_billing_cycles | Int |  |
| quantity | Int |  |

### transaction_status_history

| Column | Type | Keys |
| --- | --- | --- |
| _index | Int | PK |
| transaction_id | String | PK, FK |
| amount | BigDecimal |  |
| source | String |  |
| status | String |  |
| timestamp | Instant |  |
| user | String |  |

### paypal_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| authorization_id | String |  |
| capture_id | String |  |
| custom_field | String |  |
| debug_id | String |  |
| description | String |  |
| image_url | String |  |
| payee_email | String |  |
| payer_email | String |  |
| payer_first_name | String |  |
| payer_id | String |  |
| payer_last_name | String |  |
| payer_status | String |  |
| payment_id | String |  |
| refund_id | String |  |
| seller_protection_status | String |  |
| token | String |  |
| transaction_fee_amount | String |  |
| transaction_fee_currency_iso_code | String |  |

### subscription_add_on

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| subscription_id | String | PK, FK |
| plan_id | String | FK |
| amount | BigDecimal |  |
| current_billing_cycle | Int |  |
| description | String |  |
| kind | String |  |
| name | String |  |
| never_expires | Boolean |  |
| number_of_billing_cycles | Int |  |
| quantity | Int |  |

### venmo_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| image_url | String |  |
| source_description | String |  |
| token | String |  |
| username | String |  |
| venmo_user_id | String |  |

### dispute

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| merchant_account_id | String | FK |
| transaction_id | String | FK |
| amount | BigDecimal |  |
| amount_won | BigDecimal |  |
| case_number | String |  |
| chargeback_protection_level | String |  |
| created_date | Instant |  |
| currency_iso_code | String |  |
| dispute_amount | BigDecimal |  |
| graphql_id | String |  |
| kind | String |  |
| opened_date | Instant |  |
| original_dispute_id | String |  |
| pre_dispute_program | String |  |
| processor_comments | String |  |
| reason | String |  |
| reason_code | String |  |
| reason_description | String |  |
| received_date | Instant |  |
| reference_number | String |  |
| reply_by_date | Instant |  |
| status | String |  |
| updated_date | Instant |  |
| won_date | Instant |  |

### unregistered_customer

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| company | String |  |
| email | String |  |
| first_name | String |  |
| last_name | String |  |
| phone | String |  |
| website | String |  |

### subscription_discount

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| subscription_id | String | PK, FK |
| plan_id | String | FK |
| amount | BigDecimal |  |
| current_billing_cycle | Int |  |
| description | String |  |
| kind | String |  |
| name | String |  |
| never_expires | Boolean |  |
| number_of_billing_cycles | Int |  |
| quantity | Int |  |

### transaction

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| customer_id | String | FK |
| merchant_account_id | String | FK |
| plan_id | String | FK |
| subscription_id | String | FK |
| amount | BigDecimal |  |
| authorization_expires_at | Instant |  |
| authorized_transaction_id | String |  |
| billing_period_end_date | Instant |  |
| billing_period_start_date | Instant |  |
| channel | String |  |
| created_at | Instant |  |
| currency_iso_code | String |  |
| descriptor_name | String |  |
| descriptor_phone | String |  |
| descriptor_url | String |  |
| escrow_status | String |  |
| gateway_rejection_reason | String |  |
| network_response_code | String |  |
| network_response_text | String |  |
| network_transaction_id | String |  |
| order_id | String |  |
| payment_instrument_type | String |  |
| processed_with_network_token | Boolean |  |
| processor_authorization_code | String |  |
| processor_response_code | String |  |
| processor_response_text | String |  |
| processor_response_type | String |  |
| processor_settlement_response_code | String |  |
| processor_settlement_response_text | String |  |
| purchase_order_number | String |  |
| recurring | Boolean |  |
| refunded_transaction_id | String |  |
| retrieval_reference_number | String |  |
| service_fee_amount | BigDecimal |  |
| settlement_batch_id | String |  |
| shipping_amount | BigDecimal |  |
| shipping_from_postal_code | String |  |
| status | String |  |
| tax_amount | BigDecimal |  |
| tax_exempt | Boolean |  |
| type | String |  |
| updated_at | Instant |  |
| voice_referral_number | String |  |
| billing_address_** |  |  |
| disbursement_** |  |  |
| risk_data_** |  |  |
| shipping_address_** |  |  |
| three_d_secure_info_** |  |  |

### samsung_pay_card_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| bin | String |  |
| card_holder_name | String |  |
| card_type | String |  |
| commercial | String |  |
| country_of_issuance | String |  |
| debit | String |  |
| durbin_regulated | String |  |
| expiration_date | String |  |
| expiration_month | String |  |
| expiration_year | String |  |
| health_care | String |  |
| image_url | String |  |
| issuing_bank | String |  |
| last_4 | String |  |
| payroll | String |  |
| prepaid | String |  |
| product_id | String |  |
| token | String |  |

### credit_card

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| bin | String |  |
| card_type | String |  |
| cardholder_name | String |  |
| commercial | String |  |
| country_of_issuance | String |  |
| created_at | Instant |  |
| customer_id | String |  |
| customer_location | String |  |
| debit | String |  |
| durbin_regulated | String |  |
| expiration_date | String |  |
| expiration_month | String |  |
| expiration_year | String |  |
| healthcare | String |  |
| image_url | String |  |
| is_default | Boolean |  |
| is_expired | Boolean |  |
| is_venmo_sdk | Boolean |  |
| issuing_bank | String |  |
| last_4 | String |  |
| payroll | String |  |
| prepaid | String |  |
| product_id | String |  |
| token | String |  |
| unique_number_identifier | String |  |
| updated_at | Instant |  |
| address_** |  |  |

### android_pay_details

| Column | Type | Keys |
| --- | --- | --- |
| transaction_id | String | PK, FK |
| bin | String |  |
| card_type | String |  |
| commercial | String |  |
| country_of_issuance | String |  |
| debit | String |  |
| expiration_month | String |  |
| expiration_year | String |  |
| google_transaction_id | String |  |
| healthcare | String |  |
| image_url | String |  |
| issuing_bank | String |  |
| last_4 | String |  |
| network_tokenized | Boolean |  |
| payroll | String |  |
| prepaid | String |  |
| source_card_last_4 | String |  |
| source_card_type | String |  |
| source_description | String |  |
| token | String |  |
| virtual_card_last_4 | String |  |
| virtual_card_type | String |  |

### credit_card_verification

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| credit_card_unique_number_identifier | String | PK, FK |
| merchant_account_id | String | FK |
| amount | BigDecimal |  |
| avs_error_response_code | String |  |
| avs_postal_code_response_code | String |  |
| avs_street_address_response_code | String |  |
| created_at | Instant |  |
| currency_iso_code | String |  |
| cvv_response_code | String |  |
| gateway_rejection_reason | String |  |
| network_response_code | String |  |
| network_response_text | String |  |
| processor_response_code | String |  |
| processor_response_text | String |  |
| processor_response_type | String |  |
| status | String |  |
| address_** |  |  |
| risk_data_** |  |  |

### merchant_account

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| currency_iso_code | String |  |
| date_of_birth | String |  |
| email | String |  |
| first_name | String |  |
| is_default | Boolean |  |
| last_name | String |  |
| phone | String |  |
| status | String |  |
| address_** |  |  |
| funding_details_** |  |  |

### transaction_add_on

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| transaction_id | String | PK, FK |
| plan_id | String | FK |
| amount | BigDecimal |  |
| current_billing_cycle | Int |  |
| description | String |  |
| kind | String |  |
| name | String |  |
| never_expires | Boolean |  |
| number_of_billing_cycles | Int |  |
| quantity | Int |  |

## Relationships

- customer_address(customer_id) → registered_customer(id)
- dispute_status_history(dispute_id) → dispute(id)
- masterpass_card_details(transaction_id) → transaction(id)
- transaction_line_item(transaction_id) → transaction(id)
- apple_pay_card(transaction_id) → transaction(id)
- subscription_status_history(subscription_id) → subscription(id)
- us_bank_account_details(transaction_id) → transaction(id)
- local_payment_details(transaction_id) → transaction(id)
- paypal_here_details(transaction_id) → transaction(id)
- visa_checkout_details(transaction_id) → transaction(id)
- subscription(merchant_account_id) → merchant_account(id)
- subscription(plan_id) → plan(id)
- transaction_discount(transaction_id) → transaction(id)
- transaction_discount(plan_id) → plan(id)
- transaction_status_history(transaction_id) → transaction(id)
- paypal_details(transaction_id) → transaction(id)
- subscription_add_on(subscription_id) → subscription(id)
- subscription_add_on(plan_id) → plan(id)
- venmo_details(transaction_id) → transaction(id)
- dispute(transaction_id) → transaction(id)
- dispute(merchant_account_id) → merchant_account(id)
- unregistered_customer(transaction_id) → transaction(id)
- subscription_discount(subscription_id) → subscription(id)
- subscription_discount(plan_id) → plan(id)
- transaction(customer_id) → registered_customer(id)
- transaction(merchant_account_id) → merchant_account(id)
- transaction(plan_id) → plan(id)
- transaction(subscription_id) → subscription(id)
- samsung_pay_card_details(transaction_id) → transaction(id)
- credit_card(transaction_id) → transaction(id)
- android_pay_details(transaction_id) → transaction(id)
- credit_card_verification(credit_card_unique_number_identifier) → credit_card(transaction_id)
- credit_card_verification(merchant_account_id) → merchant_account(id)
- transaction_add_on(transaction_id) → transaction(id)
- transaction_add_on(plan_id) → plan(id)
