# PayPal schema ERD

Table and field reference for the Fivetran PayPal connector.

## Table & Field Reference

### transaction_item_checkout_option

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| item_detail_index | Int | PK, FK |
| transaction_id | String | PK, FK |
| name | String |  |
| value | String |  |

### transaction_item_tax_amount

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| item_detail_index | Int | PK, FK |
| transaction_id | String | PK, FK |
| amount | Float |  |
| currency_code | String |  |

### transaction_item_detail

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| transaction_event_code | String | PK, FK |
| transaction_id | String | PK, FK |
| adjustment_amount | Float |  |
| adjustment_currency_code | String |  |
| amount | Float |  |
| basic_shipping_amount | Float |  |
| basic_shipping_currency_code | String |  |
| code | String |  |
| currency_code | String |  |
| description | String |  |
| discount_amount | Float |  |
| discount_currency_code | String |  |
| extra_shipping_amount | Float |  |
| extra_shipping_currency_code | String |  |
| gift_wrap_amount | Float |  |
| gift_wrap_currency_code | String |  |
| handling_amount | Float |  |
| handling_currency_code | String |  |
| insurance_amount | Float |  |
| insurance_currency_code | String |  |
| invoice_number | String |  |
| name | String |  |
| options | String |  |
| quantity | String |  |
| tax_percentage | String |  |
| unit_price_amount | Float |  |
| unit_price_currency_code | String |  |

### incentive

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| transaction_event_code | String | PK, FK |
| transaction_id | String | PK, FK |
| amount | Float |  |
| code | String |  |
| currency_code | String |  |
| program_code | String |  |
| type | String |  |

### transaction

| Column | Type | Keys |
| --- | --- | --- |
| event_code | String | PK |
| id | String | PK |
| amount | Float |  |
| annual_percentage_rate | String |  |
| auction_buyer_id | String |  |
| auction_closing_date | Instant |  |
| auction_item_site | String |  |
| auction_site | String |  |
| available_balance_currency_code | String |  |
| available_balance_value | Float |  |
| bank_reference_id | String |  |
| credit_promotional_fee_amount | Float |  |
| credit_promotional_fee_currency_code | String |  |
| credit_term | String |  |
| credit_transactional_fee_amount | Float |  |
| credit_transactional_fee_currency_code | String |  |
| currency_code | String |  |
| custom_field | String |  |
| discount_amount | Float |  |
| discount_currency_code | String |  |
| ending_balance_amount | Float |  |
| ending_balance_currency_code | String |  |
| fee_amount | Float |  |
| fee_currency_code | String |  |
| initiation_date | Instant |  |
| instrument_sub_type | String |  |
| instrument_type | String |  |
| insurance_amount | Float |  |
| insurance_currency_code | String |  |
| invoice_id | String |  |
| note | String |  |
| other_amount | Float |  |
| other_currency_code | String |  |
| payer_account_id | String |  |
| payer_address_city | String |  |
| payer_address_country_code | String |  |
| payer_address_line_1 | String |  |
| payer_address_line_2 | String |  |
| payer_address_postal_code | String |  |
| payer_address_state | String |  |
| payer_country_code | String |  |
| payer_email_address | String |  |
| payer_full_name | String |  |
| payer_given_name | String |  |
| payer_middle_name | String |  |
| payer_phone_country_code | String |  |
| payer_phone_extension_number | String |  |
| payer_phone_national_number | String |  |
| payer_prefix | String |  |
| payer_status | String |  |
| payer_suffix | String |  |
| payer_surname | String |  |
| payment_method_type | String |  |
| payment_tracking_id | String |  |
| paypal_account_id | String |  |
| paypal_invoice_id | String |  |
| paypal_reference_id | String |  |
| paypal_reference_id_type | String |  |
| protection_eligibility | String |  |
| sales_tax_amount | Float |  |
| sales_tax_currency_code | String |  |
| shipping_amount | Float |  |
| shipping_currency_code | String |  |
| shipping_discount_amount | Float |  |
| shipping_discount_currency_code | String |  |
| shipping_info_address_city | String |  |
| shipping_info_address_country_code | String |  |
| shipping_info_address_line_1 | String |  |
| shipping_info_address_line_2 | String |  |
| shipping_info_address_postal_code | String |  |
| shipping_info_method | String |  |
| shipping_info_name | String |  |
| shipping_info_secondary_address_city | String |  |
| shipping_info_secondary_address_country_code | String |  |
| shipping_info_secondary_address_line_1 | String |  |
| shipping_info_secondary_address_line_2 | String |  |
| shipping_info_secondary_address_postal_code | String |  |
| shipping_info_secondary_address_state | String |  |
| shipping_tax_amount | Float |  |
| shipping_tax_currency_code | String |  |
| status | String |  |
| store_info_id | String |  |
| store_info_terminal_id | String |  |
| subject | String |  |
| tax_inclusive | Boolean |  |
| tip_amount | Float |  |
| tip_currency_code | String |  |
| updated_date | Instant |  |

### pricing_tier

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| billing_cycle_index | Int | PK, FK |
| billing_plan_id | String | PK, FK |
| amount | Float |  |
| currency_code | String |  |
| ending_quantity | String |  |
| starting_quantity | String |  |

### billing_cycle

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| billing_plan_id | String | PK, FK |
| frequency_interval_count | Int |  |
| frequency_interval_unit | String |  |
| pricing_scheme_create_time | Instant |  |
| pricing_scheme_fixed_price_amount | Float |  |
| pricing_scheme_fixed_price_currency_code | String |  |
| pricing_scheme_pricing_model | String |  |
| pricing_scheme_update_time | Instant |  |
| pricing_scheme_version | Int |  |
| sequence | Int |  |
| tenure_type | String |  |
| total_cycles | Int |  |

### billing_plan

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| create_time | Instant |  |
| description | String |  |
| name | String |  |
| payment_preferences_auto_bill_outstanding | Boolean |  |
| payment_preferences_payment_failure_threshold | Int |  |
| payment_preferences_setup_fee_amount | Float |  |
| payment_preferences_setup_fee_currency_code | String |  |
| payment_preferences_setup_fee_failure_action | String |  |
| product_id | String |  |
| quantity_supported | Boolean |  |
| status | String |  |
| taxes_inclusive | Boolean |  |
| taxes_percentage | String |  |
| updated_time | Instant |  |

### disputed_transaction_item_service_details_sub_reason

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| disputed_transaction_item_index | Int | PK, FK |
| name | String |  |

### disputed_transaction_item

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| disputed_transaction_index | Int | PK, FK |
| agreed_refund_details_merchant_agreed_refund | Boolean |  |
| agreed_refund_details_merchant_agreed_refund_time | Instant |  |
| cancellation_date | LocalDate |  |
| cancellation_mode | String |  |
| cancellation_number | String |  |
| cancelled | Boolean |  |
| description | String |  |
| dispute_amount | Float |  |
| dispute_currency_code | String |  |
| id | String |  |
| name | String |  |
| notes | String |  |
| partner_transaction_id | String |  |
| quantity | String |  |
| reason | String |  |
| type | String |  |

### disputed_transaction

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| buyer_name | String |  |
| buyer_transaction_id | String |  |
| create_time | Instant |  |
| custom | String |  |
| gross_amount | Float |  |
| gross_currency_code | String |  |
| gross_quantity | String |  |
| gross_symbol | String |  |
| invoice_number | String |  |
| reference_id | String |  |
| seller_email | String |  |
| seller_merchant_id | String |  |
| seller_name | String |  |
| seller_transaction_id | String |  |
| transaction_status | String |  |

### dispute_message

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| content | String |  |
| posted_by | String |  |
| time_posted | Instant |  |

### money_movement

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| affected_party | String |  |
| amount | Float |  |
| currency_code | String |  |
| initiated_time | Instant |  |
| quantity | String |  |
| reason | String |  |
| symbol | String |  |
| type | String |  |

### tracking_info

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| evidence_index | Int | PK, FK |
| carrier_name | String |  |
| carrier_name_other | String |  |
| tracking_number | String |  |
| tracking_url | String |  |

### evidence_info_refund

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| evidence_index | Int | PK, FK |
| id | String |  |

### evidence

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| action_info_action | String |  |
| action_info_mandatory | Boolean |  |
| action_info_response_option | String |  |
| date | LocalDate |  |
| dispute_life_cycle_stage | String |  |
| evidence_type | String |  |
| item_id | String |  |
| item_type | String |  |
| notes | String |  |
| source | String |  |

### offer_history

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| actor | String |  |
| amount | Float |  |
| currency_code | String |  |
| dispute_life_cycle_stage | String |  |
| event_type | String |  |
| notes | String |  |
| time | Instant |  |
| type | String |  |

### supporting_info

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| dispute_life_cycle_stage | String |  |
| notes | String |  |
| provided_time | Instant |  |
| source | String |  |

### adjudication

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| dispute_id | String | PK, FK |
| adjudication_time | Instant |  |
| dispute_life_cycle_stage | String |  |
| reason | String |  |
| type | String |  |

### dispute

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| amount | Float |  |
| asset_quantity | String |  |
| asset_symbol | String |  |
| buyer_contacted_channel | String |  |
| buyer_contacted_time | Instant |  |
| buyer_response_due_date | Instant |  |
| canceled_recurring_billing_cancellation_details_cancellation_date | LocalDate |  |
| canceled_recurring_billing_cancellation_details_cancellation_mode | String |  |
| canceled_recurring_billing_cancellation_details_cancellation_number | String |  |
| canceled_recurring_billing_cancellation_details_cancelled | Boolean |  |
| canceled_recurring_billing_expected_refund_amount | Float |  |
| canceled_recurring_billing_expected_refund_currency_code | String |  |
| cancellation_details_cancellation_date | LocalDate |  |
| cancellation_details_cancellation_mode | String |  |
| cancellation_details_cancellation_number | String |  |
| cancellation_details_cancelled | Boolean |  |
| channel | String |  |
| create_time | Instant |  |
| credit_not_processed_agreed_refund_details_merchant_agreed_refund | Boolean |  |
| credit_not_processed_agreed_refund_details_merchant_agreed_refund_time | Instant |  |
| credit_not_processed_amount | Float |  |
| credit_not_processed_cancellation_details_cancellation_date | LocalDate |  |
| credit_not_processed_cancellation_details_cancellation_mode | String |  |
| credit_not_processed_cancellation_details_cancellation_number | String |  |
| credit_not_processed_cancellation_details_cancelled | Boolean |  |
| credit_not_processed_currency_code | String |  |
| credit_not_processed_issue_type | String |  |
| credit_not_processed_product_details_description | String |  |
| credit_not_processed_product_details_expected_delivery_date | String |  |
| credit_not_processed_product_details_product_received | String |  |
| credit_not_processed_product_details_product_received_time | String |  |
| credit_not_processed_product_details_purchase_url | String |  |
| credit_not_processed_product_details_return_details_mode | String |  |
| credit_not_processed_product_details_return_details_receipt | Boolean |  |
| credit_not_processed_product_details_return_details_return_confirmation_number | String |  |
| credit_not_processed_product_details_return_details_return_time | Instant |  |
| credit_not_processed_product_details_returned | Boolean |  |
| currency_code | String |  |
| duplicate_transaction_original_buyer_transaction_id | String |  |
| duplicate_transaction_original_seller_transaction_id | String |  |
| duplicate_transaction_received_duplicate | Boolean |  |
| email | String |  |
| external_reason_code | String |  |
| incorrect_transaction_amount_correct_transaction_amount | Float |  |
| incorrect_transaction_amount_correct_transaction_asset_quantity | String |  |
| incorrect_transaction_amount_correct_transaction_asset_symbol | String |  |
| incorrect_transaction_amount_correct_transaction_currency_code | String |  |
| incorrect_transaction_amount_correct_transaction_time | Instant |  |
| issue_type | String |  |
| life_cycle_stage | String |  |
| merchant_contacted | Boolean |  |
| merchant_contacted_mode | String |  |
| merchant_contacted_outcome | String |  |
| merchant_contacted_time | Instant |  |
| note | String |  |
| offer_buyer_requested_amount | Float |  |
| offer_buyer_requested_currency_code | String |  |
| offer_seller_offered_amount | Float |  |
| offer_seller_offered_currency_code | String |  |
| offer_type | String |  |
| outcome_asset_refunded_quantity | String |  |
| outcome_asset_refunded_symbol | String |  |
| outcome_code | String |  |
| outcome_refunded_amount | Float |  |
| outcome_refunded_currency_code | String |  |
| payment_by_other_means_charge_different_from_original | Boolean |  |
| payment_by_other_means_payment_instrument_suffix | String |  |
| payment_by_other_means_payment_method | String |  |
| payment_by_other_means_received_duplicate | Boolean |  |
| product_details_description | String |  |
| product_details_expected_delivery_date | String |  |
| product_details_product_received | String |  |
| product_details_product_received_time | String |  |
| product_details_purchase_url | String |  |
| product_details_return_details_mode | String |  |
| product_details_return_details_receipt | Boolean |  |
| product_details_return_details_return_confirmation_number | String |  |
| product_details_return_details_return_time | Instant |  |
| product_details_returned | Boolean |  |
| reason | String |  |
| refund_details_allowed_refund_amount | Float |  |
| refund_details_allowed_refund_currency_code | String |  |
| return_shipping_address_address_line_1 | String |  |
| return_shipping_address_address_line_2 | String |  |
| return_shipping_address_address_line_3 | String |  |
| return_shipping_address_admin_area_1 | String |  |
| return_shipping_address_admin_area_2 | String |  |
| return_shipping_address_admin_area_3 | String |  |
| return_shipping_address_admin_area_4 | String |  |
| return_shipping_address_country_code | String |  |
| return_shipping_address_details_building_name | String |  |
| return_shipping_address_details_delivery_service | String |  |
| return_shipping_address_details_street_name | String |  |
| return_shipping_address_details_street_number | String |  |
| return_shipping_address_details_street_type | String |  |
| return_shipping_address_details_sub_building | String |  |
| return_shipping_address_postal_code | String |  |
| seller_response_due_date | String |  |
| service_details_description | String |  |
| service_details_note | String |  |
| service_details_purchase_url | String |  |
| service_details_service_started | String |  |
| status | String |  |
| time_posted | Instant |  |
| update_time | Instant |  |

### dispute_sub_reason

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| type | String | PK |
| dispute_id | String | PK, FK |
| name | String |  |

### product

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| category | String |  |
| create_time | Instant |  |
| description | String |  |
| name | String |  |
| type | String |  |
| update_time | Instant |  |

### payment_detail

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| invoice_id | String | PK, FK |
| amount | Float |  |
| currency_code | String |  |
| date | LocalDate |  |
| id | String |  |
| method | String |  |
| note | String |  |
| shipping_info_address_city | String |  |
| shipping_info_address_country_code | String |  |
| shipping_info_address_line_1 | String |  |
| shipping_info_address_line_2 | String |  |
| shipping_info_address_postal_code | String |  |
| shipping_info_address_state | String |  |
| shipping_info_method | String |  |
| shipping_info_name | String |  |
| shipping_info_secondary_address_city | String |  |
| shipping_info_secondary_address_country_code | String |  |
| shipping_info_secondary_address_line_1 | String |  |
| shipping_info_secondary_address_line_2 | String |  |
| shipping_info_secondary_address_postal_code | String |  |
| shipping_info_secondary_address_state | String |  |
| type | String |  |

### invoice_item

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| invoice_id | String | PK, FK |
| date | Instant |  |
| description | String |  |
| discount_amount | Float |  |
| discount_currency_code | String |  |
| discount_percent | String |  |
| id | String |  |
| name | String |  |
| quantity | String |  |
| tax_amount | Float |  |
| tax_currency_code | String |  |
| tax_name | String |  |
| tax_percent | String |  |
| unit_amount | Float |  |
| unit_currency_code | String |  |
| unit_of_measure | String |  |

### refund_detail

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| invoice_id | String | PK, FK |
| amount | Float |  |
| currency_code | String |  |
| date | LocalDate |  |
| id | String |  |
| method | String |  |
| type | String |  |

### invoicer_info_phone

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| invoice_id | String | PK, FK |
| country_code | String |  |
| extension_number | String |  |
| national_number | String |  |

### additional_recipient

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| invoice_id | String | PK, FK |
| email_address | String |  |

### billing_info_phone

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| invoice_id | String | PK, FK |
| primary_recipient_index | Int | PK, FK |
| country_code | String |  |
| extension_number | String |  |
| national_number | String |  |

### primary_recipient

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| invoice_id | String | PK, FK |
| billing_info_additional_info | String |  |
| billing_info_email_address | String |  |
| billing_info_language | String |  |
| billing_info_name | String |  |
| shipping_info_address_city | String |  |
| shipping_info_address_country_code | String |  |
| shipping_info_address_line_1 | String |  |
| shipping_info_address_line_2 | String |  |
| shipping_info_address_postal_code | String |  |
| shipping_info_address_state | String |  |
| shipping_info_method | String |  |
| shipping_info_name | String |  |
| shipping_info_secondary_address_city | String |  |
| shipping_info_secondary_address_country_code | String |  |
| shipping_info_secondary_address_line_1 | String |  |
| shipping_info_secondary_address_line_2 | String |  |
| shipping_info_secondary_address_postal_code | String |  |
| shipping_info_secondary_address_state | String |  |

### invoice

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| allow_tip | Boolean |  |
| amount | Float |  |
| currency_code | String |  |
| date | LocalDate |  |
| due_amount | Float |  |
| due_currency_code | String |  |
| gratuity_amount | Float |  |
| gratuity_currency_code | String |  |
| invoicer_info_additional_notes | String |  |
| invoicer_info_email_address | String |  |
| invoicer_info_logo_url | String |  |
| invoicer_info_tax_id | String |  |
| invoicer_info_website | String |  |
| memo | String |  |
| note | String |  |
| number | String |  |
| parent_id | String |  |
| partial_payment_allow_partial_payment | Boolean |  |
| partial_payment_minimal_amount_due_amount | Float |  |
| partial_payment_minimal_amount_due_currency_code | String |  |
| payment_term_due_date | LocalDate |  |
| payment_term_type | String |  |
| reference | String |  |
| status | String |  |
| tax_calculated_after_discount | Boolean |  |
| tax_inclusive | Boolean |  |
| template_id | String |  |
| term | String |  |
| terms_and_conditions | String |  |

### balance_detail

| Column | Type | Keys |
| --- | --- | --- |
| index | Int | PK |
| account_id | String | PK, FK |
| as_of_time | Instant | PK, FK |
| available_balance_amount | Float |  |
| available_balance_currency_code | String |  |
| currency | String |  |
| is_primary | Boolean |  |
| withheld_balance_amount | Float |  |
| withheld_balance_currency_code | String |  |

### balance

| Column | Type | Keys |
| --- | --- | --- |
| account_id | String | PK |
| as_of_time | Instant | PK |

## Relationships

- transaction_item_checkout_option(item_detail_index) → transaction_item_detail(index)
- transaction_item_checkout_option(transaction_id) → transaction(id)
- transaction_item_tax_amount(item_detail_index) → transaction_item_detail(index)
- transaction_item_tax_amount(transaction_id) → transaction(id)
- transaction_item_detail(transaction_event_code) → transaction(event_code)
- transaction_item_detail(transaction_id) → transaction(id)
- incentive(transaction_event_code) → transaction(event_code)
- incentive(transaction_id) → transaction(id)
- pricing_tier(billing_plan_id) → billing_plan(id)
- pricing_tier(billing_cycle_index) → billing_cycle(index)
- billing_cycle(billing_plan_id) → billing_plan(id)
- disputed_transaction_item_service_details_sub_reason(dispute_id) → dispute(id)
- disputed_transaction_item_service_details_sub_reason(disputed_transaction_item_index) → disputed_transaction_item(index)
- disputed_transaction_item(dispute_id) → dispute(id)
- disputed_transaction_item(disputed_transaction_index) → disputed_transaction(index)
- disputed_transaction(dispute_id) → dispute(id)
- dispute_message(dispute_id) → dispute(id)
- money_movement(dispute_id) → dispute(id)
- tracking_info(dispute_id) → dispute(id)
- tracking_info(evidence_index) → evidence(index)
- evidence_info_refund(dispute_id) → dispute(id)
- evidence_info_refund(evidence_index) → evidence(index)
- evidence(dispute_id) → dispute(id)
- offer_history(dispute_id) → dispute(id)
- supporting_info(dispute_id) → dispute(id)
- adjudication(dispute_id) → dispute(id)
- dispute_sub_reason(dispute_id) → dispute(id)
- payment_detail(invoice_id) → invoice(id)
- invoice_item(invoice_id) → invoice(id)
- refund_detail(invoice_id) → invoice(id)
- invoicer_info_phone(invoice_id) → invoice(id)
- additional_recipient(invoice_id) → invoice(id)
- billing_info_phone(invoice_id) → invoice(id)
- billing_info_phone(primary_recipient_index) → primary_recipient(index)
- primary_recipient(invoice_id) → invoice(id)
- balance_detail(account_id) → balance(account_id)
- balance_detail(as_of_time) → balance(as_of_time)
