# GoCardless schema ERD

Table and field reference for the Fivetran GoCardless connector.

## Table & Field Reference

### payment

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_creditor | String | FK |
| links_installment_schedule | String | FK |
| links_mandate | String | FK |
| links_payout | String | FK |
| links_subscription | String | FK |
| amount | Double |  |
| amount_refunded | Double |  |
| charge_date | LocalDate |  |
| created_at | Instant |  |
| currency | String |  |
| description | String |  |
| fx_estimated_exchange_rate | String |  |
| fx_exchange_rate | Double |  |
| fx_fx_amount | Double |  |
| fx_fx_currency | String |  |
| metadata | Unknown |  |
| reference | String |  |
| retry_if_possible | Boolean |  |
| status | String |  |
| custom_** |  |  |

### billing_request_template

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| authorisation_url | String |  |
| created_at | Instant |  |
| mandate_request_currency | String |  |
| mandate_request_metadata | Unknown |  |
| mandate_request_scheme | String |  |
| mandate_request_verify | String |  |
| metadata | Unknown |  |
| name | String |  |
| payment_request_amount | String |  |
| payment_request_currency | String |  |
| payment_request_description | String |  |
| payment_request_metadata | Unknown |  |
| payment_request_scheme | String |  |
| redirect_uri | String |  |
| updated_at | Instant |  |
| custom_** |  |  |

### event_customer_notification

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| event_id | String | PK, FK |
| deadline | Instant |  |
| mandatory | Boolean |  |
| type | String |  |

### event

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_billing_request | String | FK |
| links_creditor | String | FK |
| links_customer | String | FK |
| links_customer_bank_account | String | FK |
| links_installment_schedule | String | FK |
| links_mandate | String | FK |
| links_mandate_request_mandate | String | FK |
| links_new_customer_bank_account | String | FK |
| links_new_mandate | String | FK |
| links_payment | String | FK |
| links_payment_request_payment | String | FK |
| links_payout | String | FK |
| links_previous_customer_bank_account | String | FK |
| links_subscription | String | FK |
| action | String |  |
| created_at | Instant |  |
| details_bank_account_id | String |  |
| details_cause | String |  |
| details_currency | String |  |
| details_description | String |  |
| details_not_retrieved_reason | String |  |
| details_origin | String |  |
| details_property | String |  |
| details_reason_code | String |  |
| details_scheme | String |  |
| details_will_attempt_retry | String |  |
| links_bank_authorisation | String |  |
| links_billing_request_flow | String |  |
| links_organisation | String |  |
| links_parent_event | String |  |
| links_payer_authorisation | String |  |
| links_refund | String |  |
| resource_type | String |  |

### creditor_scheme_identifier

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| creditor_id | String | FK |
| address_line_1 | String |  |
| address_line_2 | String |  |
| address_line_3 | String |  |
| can_specify_mandate_reference | Boolean |  |
| city | String |  |
| country_code | String |  |
| currency | String |  |
| email | String |  |
| minimum_advance_notice | String |  |
| name | String |  |
| phone_number | String |  |
| postal_code | String |  |
| reference | String |  |
| region | String |  |
| scheme | String |  |

### creditor

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_default_aud_payout_account | String | FK |
| links_default_dkk_payout_account | String | FK |
| links_default_eur_payout_account | String | FK |
| links_default_gbp_payout_account | String | FK |
| links_default_nzd_payout_account | String | FK |
| links_default_sek_payout_account | String | FK |
| links_default_usd_payout_account | String | FK |
| activated | Boolean |  |
| address_line_1 | String |  |
| address_line_2 | String |  |
| address_line_3 | String |  |
| can_create_refunds | Boolean |  |
| city | String |  |
| country_code | String |  |
| created_at | Instant |  |
| custom_payment_pages_enabled | Boolean |  |
| fx_payout_currency | String |  |
| logo_url | String |  |
| mandate_imports_enabled | Boolean |  |
| merchant_responsible_for_notifications | Boolean |  |
| name | String |  |
| postal_code | String |  |
| region | String |  |
| verification_status | String |  |

### customer

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| address_line_1 | String |  |
| address_line_2 | String |  |
| address_line_3 | String |  |
| city | String |  |
| company_name | String |  |
| country_code | String |  |
| created_at | String |  |
| danish_identity_number | String |  |
| email | String |  |
| family_name | String |  |
| given_name | String |  |
| language | String |  |
| metadata | Unknown |  |
| phone_number | String |  |
| postal_code | String |  |
| region | String |  |
| swedish_identity_number | String |  |
| custom_** |  |  |

### installment_schedule

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_customer | String | FK |
| links_mandate | String | FK |
| created_at | Instant |  |
| currency | String |  |
| metadata | Unknown |  |
| name | String |  |
| payment_errors | String |  |
| status | String |  |
| total_amount | String |  |
| custom_** |  |  |

### refund

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_mandate | String | FK |
| links_payment | String | FK |
| amount | Double |  |
| created_at | Instant |  |
| currency | String |  |
| fx_estimated_exchange_rate | String |  |
| fx_exchange_rate | Double |  |
| fx_fx_amount | Double |  |
| fx_fx_currency | String |  |
| metadata | Unknown |  |
| reference | String |  |
| status | String |  |
| custom_** |  |  |

### billing_request_complete_action

| Column | Type | Keys |
| --- | --- | --- |
| complete_action | String | PK |
| billing_request_action_index | Unknown | PK, FK |
| billing_request_id | String | PK, FK |

### billing_request_require_action

| Column | Type | Keys |
| --- | --- | --- |
| require_action | String | PK |
| billing_request_action_index | Unknown | PK, FK |
| billing_request_id | String | PK, FK |

### billing_request_action

| Column | Type | Keys |
| --- | --- | --- |
| index | Unknown | PK |
| billing_request_id | String | PK, FK |
| available_currencies | String |  |
| bank_authorisation | String |  |
| required | Boolean |  |
| status | String |  |
| type | String |  |

### billing_request

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_creditor | String | FK |
| links_customer | String | FK |
| links_customer_bank_account | String | FK |
| links_mandate_request_mandate | String | FK |
| links_payment_request_payment | String | FK |
| created_at | Instant |  |
| creditor_name | String |  |
| fallback_enabled | Boolean |  |
| links_bank_authorisation | String |  |
| links_customer_billing_detail | String |  |
| links_mandate_request | String |  |
| links_organisation | String |  |
| mandate_request_currency | String |  |
| mandate_request_metadata | Unknown |  |
| mandate_request_scheme | String |  |
| mandate_request_verify | String |  |
| metadata | Unknown |  |
| payment_request_amount | Double |  |
| payment_request_app_fee | Long |  |
| payment_request_currency | String |  |
| payment_request_description | String |  |
| payment_request_metadata | Unknown |  |
| payment_request_scheme | String |  |
| status | String |  |
| custom_** |  |  |

### institution

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| country_code | String |  |
| icon_url | String |  |
| logo_url | String |  |
| name | String |  |

### payout

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_creditor | String | FK |
| links_creditor_bank_account | String | FK |
| amount | Double |  |
| arrival_date | LocalDate |  |
| created_at | Instant |  |
| currency | String |  |
| deducted_fees | Double |  |
| fx_estimated_exchange_rate | String |  |
| fx_exchange_rate | Double |  |
| fx_fx_amount | Double |  |
| fx_fx_currency | String |  |
| metadata | Unknown |  |
| payout_type | String |  |
| reference | String |  |
| status | String |  |
| tax_currency | String |  |
| custom_** |  |  |

### block

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| active | Boolean |  |
| block_type | String |  |
| created_at | Instant |  |
| reason_description | String |  |
| reason_type | String |  |
| resource_reference | String |  |
| updated_at | Instant |  |

### subscription_upcoming_payment

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| subscription_id | String | FK |
| amount | Double |  |
| charge_date | LocalDate |  |

### subscription

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_mandate | String | FK |
| amount | Double |  |
| app_fee | String |  |
| count | Int |  |
| created_at | Instant |  |
| currency | String |  |
| day_of_month | Int |  |
| earliest_charge_date_after_resume | LocalDate |  |
| end_date | LocalDate |  |
| interval | Int |  |
| interval_unit | String |  |
| metadata | Unknown |  |
| month | String |  |
| name | String |  |
| payment_reference | String |  |
| retry_if_possible | Boolean |  |
| start_date | LocalDate |  |
| status | String |  |
| custom_** |  |  |

### currency_exchange_rate

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| rate | String |  |
| source | String |  |
| target | String |  |
| time | Instant |  |

### tax_rate

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| end_date | LocalDate |  |
| jurisdiction | String |  |
| start_date | LocalDate |  |
| type | String |  |

### customer_bank_account

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_customer | String | FK |
| account_holder_name | String |  |
| account_number_ending | String |  |
| account_type | String |  |
| bank_name | String |  |
| country_code | String |  |
| created_at | Instant |  |
| currency | String |  |
| email | String |  |
| enabled | Boolean |  |
| metadata | Unknown |  |
| custom_** |  |  |

### creditor_bank_account

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_creditor | String | FK |
| account_holder_name | String |  |
| account_number_ending | String |  |
| account_type | String |  |
| bank_name | String |  |
| country_code | String |  |
| created_at | Instant |  |
| currency | String |  |
| enabled | Boolean |  |
| metadata | Unknown |  |
| custom_** |  |  |

### mandate

| Column | Type | Keys |
| --- | --- | --- |
| id | String | PK |
| links_creditor | String | FK |
| links_customer | String | FK |
| links_customer_bank_account | String | FK |
| links_mandate | String | FK |
| created_at | String |  |
| metadata | Unknown |  |
| next_possible_charge_date | LocalDate |  |
| payments_require_approval | Boolean |  |
| reference | String |  |
| scheme | String |  |
| status | String |  |
| custom_** |  |  |

### payout_item

| Column | Type | Keys |
| --- | --- | --- |
| _fivetran_id | String | PK |
| payment_id | String | FK |
| payout_id | String | FK |
| tax_rate_id | Unknown | FK |
| amount | Double |  |
| currency | String |  |
| destination_amount | Double |  |
| destination_currency | String |  |
| exchange_rate | Double |  |

## Relationships

- payment(links_creditor) → creditor(id)
- payment(links_installment_schedule) → installment_schedule(id)
- payment(links_mandate) → mandate(id)
- payment(links_payout) → payout(id)
- payment(links_subscription) → subscription(id)
- event_customer_notification(event_id) → event(id)
- event(links_installment_schedule) → installment_schedule(id)
- event(links_new_mandate) → mandate(id)
- event(links_new_customer_bank_account) → customer_bank_account(id)
- event(links_billing_request) → billing_request(id)
- event(links_payout) → payout(id)
- event(links_creditor) → creditor(id)
- event(links_mandate) → mandate(id)
- event(links_payment_request_payment) → payment(id)
- event(links_subscription) → subscription(id)
- event(links_previous_customer_bank_account) → customer_bank_account(id)
- event(links_customer_bank_account) → customer_bank_account(id)
- event(links_mandate_request_mandate) → mandate(id)
- event(links_customer) → customer(id)
- event(links_payment) → payment(id)
- creditor_scheme_identifier(creditor_id) → creditor(id)
- creditor(links_default_aud_payout_account) → creditor_bank_account(id)
- creditor(links_default_dkk_payout_account) → creditor_bank_account(id)
- creditor(links_default_eur_payout_account) → creditor_bank_account(id)
- creditor(links_default_gbp_payout_account) → creditor_bank_account(id)
- creditor(links_default_nzd_payout_account) → creditor_bank_account(id)
- creditor(links_default_sek_payout_account) → creditor_bank_account(id)
- creditor(links_default_usd_payout_account) → creditor_bank_account(id)
- installment_schedule(links_customer) → customer(id)
- installment_schedule(links_mandate) → mandate(id)
- refund(links_payment) → payment(id)
- refund(links_mandate) → mandate(id)
- billing_request_complete_action(billing_request_action_index) → billing_request_action(index)
- billing_request_complete_action(billing_request_id) → billing_request(id)
- billing_request_require_action(billing_request_action_index) → billing_request_action(index)
- billing_request_require_action(billing_request_id) → billing_request(id)
- billing_request_action(billing_request_id) → billing_request(id)
- billing_request(links_creditor) → creditor(id)
- billing_request(links_payment_request_payment) → payment(id)
- billing_request(links_customer_bank_account) → customer_bank_account(id)
- billing_request(links_mandate_request_mandate) → mandate(id)
- billing_request(links_customer) → customer(id)
- payout(links_creditor) → creditor(id)
- payout(links_creditor_bank_account) → creditor_bank_account(id)
- subscription_upcoming_payment(subscription_id) → subscription(id)
- subscription(links_mandate) → mandate(id)
- customer_bank_account(links_customer) → customer(id)
- creditor_bank_account(links_creditor) → creditor(id)
- mandate(links_creditor) → creditor(id)
- mandate(links_customer) → customer(id)
- mandate(links_customer_bank_account) → customer_bank_account(id)
- mandate(links_mandate) → mandate(id)
- payout_item(payment_id) → payment(id)
- payout_item(tax_rate_id) → tax_rate(id)
- payout_item(payout_id) → payout(id)
