import {z} from 'zod' export type EventsAddresses = {type: string, line_1: string, line_2?: string | undefined, city: string, state?: string | undefined, postal_code: string, country_code: string}; export type EventsEmails = {email_address?: string | undefined}; export type EventsPhones = {phone_number: string, type?: ('cell' | 'home' | 'fax' | 'work') | undefined}; export type AccountEntityLink = {account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id: string, entity_token?: string | undefined} | {account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id?: string | undefined, entity_token: string}; export type EntityLinkRemoval = {external_entity_id: string, entity_token?: string | undefined} | {external_entity_id?: string | undefined, entity_token: string}; export type RegisteredDevice = {external_device_id?: string | undefined, ip_address_v4?: string | undefined, ip_address_v6?: string | undefined}; export type LinkedTransactions = {external_transaction_id: string, transaction_token?: string | undefined, reason: string} | {external_transaction_id?: string | undefined, transaction_token: string, reason: string}; export type DeviceDetailBool = 'true' | 'false' | 'not available' | 'excluded' | 'error'; export type PostEvent = {event_type: 'person_created' | 'person_updated' | 'business_created' | 'business_updated' | 'bank_account_created' | 'bank_account_updated' | 'external_account_created' | 'external_account_updated' | 'transaction' | 'login' | 'credentials_updated' | 'embedded_authentication' | 'modify_notification' | 'entity_group_created' | 'entity_group_updated' | 'card_created' | 'card_updated' | 'device_created' | 'device_updated', external_event_id?: string | undefined, event_status?: string | undefined, data?: ({timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_entity_id: string, external_session_id?: (string | null) | undefined, gender?: string | undefined, birth_date?: string | undefined, document_ssn?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, document_id_card?: string | undefined, document_license?: string | undefined, document_passport?: string | undefined, addresses?: Array | undefined, emails?: Array | undefined, phones?: Array | undefined, status?: ('active' | 'inactive') | undefined, status_detail?: (string | null) | undefined, status_fraud?: ('fraud' | 'not fraud') | undefined, external_entity_ids?: (Array<{external_entity_id: string, external_entity_id_type?: string | undefined, designation?: 'primary' | undefined}>) | undefined, entity_groups?: (Array<{entity_group_token: string, external_entity_group_id?: string | undefined, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined} | {entity_group_token?: string | undefined, external_entity_group_id: string, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined}>) | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_entity_id: string, external_session_id?: (string | null) | undefined, gender?: string | undefined, birth_date?: string | undefined, document_ssn?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, document_id_card?: string | undefined, document_license?: string | undefined, document_passport?: string | undefined, addresses?: Array | undefined, emails?: Array | undefined, phones?: Array | undefined, status?: ('active' | 'inactive') | undefined, status_detail?: (string | null) | undefined, status_fraud?: ('fraud' | 'not fraud') | undefined, entity_token?: string | undefined, external_entity_ids?: (Array<{external_entity_id: string, external_entity_id_type?: string | undefined, designation?: 'primary' | undefined}>) | undefined, entity_groups?: (Array<{entity_group_token: string, external_entity_group_id?: string | undefined, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined} | {entity_group_token?: string | undefined, external_entity_group_id: string, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined}>) | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, gender?: string | undefined, birth_date?: string | undefined, document_ssn?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, document_id_card?: string | undefined, document_license?: string | undefined, document_passport?: string | undefined, addresses?: Array | undefined, emails?: Array | undefined, phones?: Array | undefined, status?: ('active' | 'inactive') | undefined, status_detail?: (string | null) | undefined, status_fraud?: ('fraud' | 'not fraud') | undefined, entity_token: string, external_entity_ids?: (Array<{external_entity_id: string, external_entity_id_type?: string | undefined, designation?: 'primary' | undefined}>) | undefined, entity_groups?: (Array<{entity_group_token: string, external_entity_group_id?: string | undefined, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined} | {entity_group_token?: string | undefined, external_entity_group_id: string, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined}>) | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_entity_id: string, external_session_id?: (string | null) | undefined, business_name: string, business_alternate_name?: string | undefined, business_registry_id?: string | undefined, business_federal_ein?: string | undefined, addresses?: Array | undefined, emails?: Array | undefined, phones?: Array | undefined, status?: ('active' | 'inactive') | undefined, status_detail?: (string | null) | undefined, status_fraud?: ('fraud' | 'not fraud') | undefined, external_entity_ids?: (Array<{external_entity_id: string, external_entity_id_type?: string | undefined, designation?: 'primary' | undefined}>) | undefined, entity_groups?: (Array<{entity_group_token: string, external_entity_group_id?: string | undefined, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined} | {entity_group_token?: string | undefined, external_entity_group_id: string, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined}>) | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_entity_id: string, external_session_id?: (string | null) | undefined, business_name?: string | undefined, business_alternate_name?: string | undefined, business_registry_id?: string | undefined, business_federal_ein?: string | undefined, addresses?: Array | undefined, emails?: Array | undefined, phones?: Array | undefined, status?: ('active' | 'inactive') | undefined, status_detail?: (string | null) | undefined, status_fraud?: ('fraud' | 'not fraud') | undefined, entity_token?: string | undefined, external_entity_ids?: (Array<{external_entity_id: string, external_entity_id_type?: string | undefined, designation?: 'primary' | undefined}>) | undefined, entity_groups?: (Array<{entity_group_token: string, external_entity_group_id?: string | undefined, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined} | {entity_group_token?: string | undefined, external_entity_group_id: string, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined}>) | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, business_name?: string | undefined, business_alternate_name?: string | undefined, business_registry_id?: string | undefined, business_federal_ein?: string | undefined, addresses?: Array | undefined, emails?: Array | undefined, phones?: Array | undefined, status?: ('active' | 'inactive') | undefined, status_detail?: (string | null) | undefined, status_fraud?: ('fraud' | 'not fraud') | undefined, entity_token: string, external_entity_ids?: (Array<{external_entity_id: string, external_entity_id_type?: string | undefined, designation?: 'primary' | undefined}>) | undefined, entity_groups?: (Array<{entity_group_token: string, external_entity_group_id?: string | undefined, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined} | {entity_group_token?: string | undefined, external_entity_group_id: string, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, ownership_percentage?: number | undefined, title?: string | undefined}>) | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_account_id: string, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, entity_token?: (string | null) | undefined, account_class?: ('credit' | 'deposit' | 'brokerage' | 'loan' | null) | undefined, account_name?: (string | null) | undefined, account_number: string, routing_number?: (string | null) | undefined, opening_date?: (string | null) | undefined, maturity_date?: (string | null) | undefined, closing_date?: (string | null) | undefined, cif_number?: (string | null) | undefined, card_network?: (string | null) | undefined, country_code?: (string | null) | undefined, currency?: (string | null) | undefined, product_code?: (string | null) | undefined, product_name?: (string | null) | undefined, status?: (string | null) | undefined, status_detail?: (string | null) | undefined, credit_limit?: (number | null) | undefined, account_balance?: (number | null) | undefined, account_type_status?: ('Written Off' | 'Active' | 'Refinanced' | 'Past Due' | 'Paid Off' | 'Cancelled' | null) | undefined, status_fraud?: ('fraud' | 'not fraud' | null) | undefined, entity_group_token?: (string | null) | undefined, external_entity_group_id?: (string | null) | undefined, entities: Array<{account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id: string, entity_token?: string | undefined} | {account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id?: string | undefined, entity_token: string}>} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_account_id: string, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, entity_token?: (string | null) | undefined, account_class?: ('credit' | 'deposit' | 'brokerage' | 'loan' | null) | undefined, account_name?: (string | null) | undefined, account_number?: string | undefined, routing_number?: (string | null) | undefined, opening_date?: (string | null) | undefined, maturity_date?: (string | null) | undefined, closing_date?: (string | null) | undefined, cif_number?: (string | null) | undefined, card_network?: (string | null) | undefined, country_code?: (string | null) | undefined, currency?: (string | null) | undefined, product_code?: (string | null) | undefined, product_name?: (string | null) | undefined, status?: (string | null) | undefined, status_detail?: (string | null) | undefined, credit_limit?: (number | null) | undefined, account_balance?: (number | null) | undefined, account_type_status?: ('Written Off' | 'Active' | 'Refinanced' | 'Past Due' | 'Paid Off' | 'Cancelled' | null) | undefined, status_fraud?: ('fraud' | 'not fraud' | null) | undefined, entity_group_token?: (string | null) | undefined, external_entity_group_id?: (string | null) | undefined, entities?: (Array<{account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id: string, entity_token?: string | undefined} | {account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id?: string | undefined, entity_token: string}>) | undefined, account_token?: string | undefined, add_entities?: Array | undefined, remove_entities?: Array | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_account_id?: string | undefined, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, entity_token?: (string | null) | undefined, account_class?: ('credit' | 'deposit' | 'brokerage' | 'loan' | null) | undefined, account_name?: (string | null) | undefined, account_number?: string | undefined, routing_number?: (string | null) | undefined, opening_date?: (string | null) | undefined, maturity_date?: (string | null) | undefined, closing_date?: (string | null) | undefined, cif_number?: (string | null) | undefined, card_network?: (string | null) | undefined, country_code?: (string | null) | undefined, currency?: (string | null) | undefined, product_code?: (string | null) | undefined, product_name?: (string | null) | undefined, status?: (string | null) | undefined, status_detail?: (string | null) | undefined, credit_limit?: (number | null) | undefined, account_balance?: (number | null) | undefined, account_type_status?: ('Written Off' | 'Active' | 'Refinanced' | 'Past Due' | 'Paid Off' | 'Cancelled' | null) | undefined, status_fraud?: ('fraud' | 'not fraud' | null) | undefined, entity_group_token?: (string | null) | undefined, external_entity_group_id?: (string | null) | undefined, entities?: (Array<{account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id: string, entity_token?: string | undefined} | {account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id?: string | undefined, entity_token: string}>) | undefined, account_token: string, add_entities?: Array | undefined, remove_entities?: Array | undefined} | unknown | unknown | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, embedded_application: 'zelle' | 'billpay', external_entity_id: string, external_embedded_authentication_id?: string | undefined, external_session_id?: (string | null) | undefined, device?: RegisteredDevice | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_account_id: string, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, entity_token?: (string | null) | undefined, account_class?: ('credit' | 'deposit' | 'brokerage' | 'loan' | null) | undefined, account_name?: (string | null) | undefined, account_number?: string | undefined, routing_number?: (string | null) | undefined, opening_date?: (string | null) | undefined, maturity_date?: (string | null) | undefined, closing_date?: (string | null) | undefined, cif_number?: (string | null) | undefined, card_network?: (string | null) | undefined, country_code?: (string | null) | undefined, currency?: (string | null) | undefined, product_code?: (string | null) | undefined, product_name?: (string | null) | undefined, status?: (string | null) | undefined, status_detail?: (string | null) | undefined, credit_limit?: (number | null) | undefined, account_balance?: (number | null) | undefined, account_type_status?: ('Written Off' | 'Active' | 'Refinanced' | 'Past Due' | 'Paid Off' | 'Cancelled' | null) | undefined, status_fraud?: ('fraud' | 'not fraud' | null) | undefined, entity_group_token?: (string | null) | undefined, external_entity_group_id?: (string | null) | undefined, entities: Array<{account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id: string, entity_token?: string | undefined} | {account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id?: string | undefined, entity_token: string}>, link_timestamp?: (string | null) | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_account_id: string, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, entity_token?: (string | null) | undefined, account_class?: ('credit' | 'deposit' | 'brokerage' | 'loan' | null) | undefined, account_name?: (string | null) | undefined, account_number?: string | undefined, routing_number?: (string | null) | undefined, opening_date?: (string | null) | undefined, maturity_date?: (string | null) | undefined, closing_date?: (string | null) | undefined, cif_number?: (string | null) | undefined, card_network?: (string | null) | undefined, country_code?: (string | null) | undefined, currency?: (string | null) | undefined, product_code?: (string | null) | undefined, product_name?: (string | null) | undefined, status?: (string | null) | undefined, status_detail?: (string | null) | undefined, credit_limit?: (number | null) | undefined, account_balance?: (number | null) | undefined, account_type_status?: ('Written Off' | 'Active' | 'Refinanced' | 'Past Due' | 'Paid Off' | 'Cancelled' | null) | undefined, status_fraud?: ('fraud' | 'not fraud' | null) | undefined, entity_group_token?: (string | null) | undefined, external_entity_group_id?: (string | null) | undefined, entities?: (Array<{account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id: string, entity_token?: string | undefined} | {account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id?: string | undefined, entity_token: string}>) | undefined, account_token?: string | undefined, link_timestamp?: (string | null) | undefined, unlink_timestamp?: (string | null) | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_account_id?: string | undefined, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, entity_token?: (string | null) | undefined, account_class?: ('credit' | 'deposit' | 'brokerage' | 'loan' | null) | undefined, account_name?: (string | null) | undefined, account_number?: string | undefined, routing_number?: (string | null) | undefined, opening_date?: (string | null) | undefined, maturity_date?: (string | null) | undefined, closing_date?: (string | null) | undefined, cif_number?: (string | null) | undefined, card_network?: (string | null) | undefined, country_code?: (string | null) | undefined, currency?: (string | null) | undefined, product_code?: (string | null) | undefined, product_name?: (string | null) | undefined, status?: (string | null) | undefined, status_detail?: (string | null) | undefined, credit_limit?: (number | null) | undefined, account_balance?: (number | null) | undefined, account_type_status?: ('Written Off' | 'Active' | 'Refinanced' | 'Past Due' | 'Paid Off' | 'Cancelled' | null) | undefined, status_fraud?: ('fraud' | 'not fraud' | null) | undefined, entity_group_token?: (string | null) | undefined, external_entity_group_id?: (string | null) | undefined, entities?: (Array<{account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id: string, entity_token?: string | undefined} | {account_holder_type?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined, external_entity_id?: string | undefined, entity_token: string}>) | undefined, account_token: string, link_timestamp?: (string | null) | undefined, unlink_timestamp?: (string | null) | undefined} | unknown | unknown | unknown | unknown | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_transaction_id: string, amount: number, currency: string, entity_token?: string | undefined, external_entity_id: string, external_account_id: string, external_session_id?: (string | null) | undefined, counterparty: {external_counterparty_id?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, routing_number?: string | undefined, account_number: string, counterparty_type?: string | undefined, account_name?: string | undefined, address_line_1?: string | undefined, address_line_2?: string | undefined, address_city?: string | undefined, address_state?: string | undefined, address_postal_code?: string | undefined, address_country_code?: string | undefined, card_network?: string | undefined, merchant_category_code?: string | undefined, name_on_card?: string | undefined, avs?: string | undefined, description?: string | undefined, merchant_category_description?: string | undefined, currency?: string | undefined, identity?: ({external_counterparty_identity_id: string, type?: ('person' | 'business' | 'merchant' | 'customer' | null) | undefined, identity_name?: (string | null) | undefined, name_first?: (string | null) | undefined, name_last?: (string | null) | undefined, birth_date?: (string | null) | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, tax_id?: (string | null) | undefined, merchant_identifier?: (string | null) | undefined, merchant_category_code?: (string | null) | undefined, mcc_description?: (string | null) | undefined, dba_name?: (string | null) | undefined, address_line_1?: (string | null) | undefined, address_line_2?: (string | null) | undefined, address_city?: (string | null) | undefined, address_state?: (string | null) | undefined, address_postal_code?: (string | null) | undefined, address_country_code?: (string | null) | undefined, entity_token?: (string | null) | undefined, external_entity_id?: (string | null) | undefined, external_entity_id_source?: (string | null) | undefined, device?: (RegisteredDevice | null) | undefined} | null) | undefined, instrument?: ({external_instrument_id: string, instrument_type: 'bank_account' | 'card' | 'digital_wallet' | 'other', routing_number?: (string | null) | undefined, routing_number_type?: (string | null) | undefined, account_number?: (string | null) | undefined, account_number_last4?: (string | null) | undefined, account_holder_name?: (string | null) | undefined, account_type?: ('checking' | 'savings' | 'deposit' | 'credit' | 'other' | null) | undefined, country_code?: (string | null) | undefined, card_bin?: (string | null) | undefined, card_last4?: (string | null) | undefined, card_network?: (string | null) | undefined, form_factor?: ('physical' | 'virtual' | null) | undefined, name_on_card?: (string | null) | undefined, expiration_month?: (string | null) | undefined, expiration_year?: (string | null) | undefined, avs?: (string | null) | undefined, wallet_provider?: (string | null) | undefined, wallet_identifier?: (string | null) | undefined, check_number?: (string | null) | undefined, payee_name_raw?: (string | null) | undefined, currency?: (string | null) | undefined} | null) | undefined} | {external_counterparty_id: string, name_first?: string | undefined, name_last?: string | undefined, routing_number?: string | undefined, account_number?: string | undefined, counterparty_type?: string | undefined, account_name?: string | undefined, address_line_1?: string | undefined, address_line_2?: string | undefined, address_city?: string | undefined, address_state?: string | undefined, address_postal_code?: string | undefined, address_country_code?: string | undefined, card_network?: string | undefined, merchant_category_code?: string | undefined, name_on_card?: string | undefined, avs?: string | undefined, description?: string | undefined, merchant_category_description?: string | undefined, currency?: string | undefined, identity?: ({external_counterparty_identity_id: string, type?: ('person' | 'business' | 'merchant' | 'customer' | null) | undefined, identity_name?: (string | null) | undefined, name_first?: (string | null) | undefined, name_last?: (string | null) | undefined, birth_date?: (string | null) | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, tax_id?: (string | null) | undefined, merchant_identifier?: (string | null) | undefined, merchant_category_code?: (string | null) | undefined, mcc_description?: (string | null) | undefined, dba_name?: (string | null) | undefined, address_line_1?: (string | null) | undefined, address_line_2?: (string | null) | undefined, address_city?: (string | null) | undefined, address_state?: (string | null) | undefined, address_postal_code?: (string | null) | undefined, address_country_code?: (string | null) | undefined, entity_token?: (string | null) | undefined, external_entity_id?: (string | null) | undefined, external_entity_id_source?: (string | null) | undefined, device?: (RegisteredDevice | null) | undefined} | null) | undefined, instrument?: ({external_instrument_id: string, instrument_type: 'bank_account' | 'card' | 'digital_wallet' | 'other', routing_number?: (string | null) | undefined, routing_number_type?: (string | null) | undefined, account_number?: (string | null) | undefined, account_number_last4?: (string | null) | undefined, account_holder_name?: (string | null) | undefined, account_type?: ('checking' | 'savings' | 'deposit' | 'credit' | 'other' | null) | undefined, country_code?: (string | null) | undefined, card_bin?: (string | null) | undefined, card_last4?: (string | null) | undefined, card_network?: (string | null) | undefined, form_factor?: ('physical' | 'virtual' | null) | undefined, name_on_card?: (string | null) | undefined, expiration_month?: (string | null) | undefined, expiration_year?: (string | null) | undefined, avs?: (string | null) | undefined, wallet_provider?: (string | null) | undefined, wallet_identifier?: (string | null) | undefined, check_number?: (string | null) | undefined, payee_name_raw?: (string | null) | undefined, currency?: (string | null) | undefined} | null) | undefined} | {external_counterparty_id?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, routing_number?: string | undefined, account_number?: string | undefined, counterparty_type?: string | undefined, account_name?: string | undefined, address_line_1?: string | undefined, address_line_2?: string | undefined, address_city?: string | undefined, address_state?: string | undefined, address_postal_code?: string | undefined, address_country_code?: string | undefined, card_network?: string | undefined, merchant_category_code?: string | undefined, name_on_card?: string | undefined, avs?: string | undefined, description?: string | undefined, merchant_category_description?: string | undefined, currency?: string | undefined, identity: {external_counterparty_identity_id: string, type?: ('person' | 'business' | 'merchant' | 'customer' | null) | undefined, identity_name?: (string | null) | undefined, name_first?: (string | null) | undefined, name_last?: (string | null) | undefined, birth_date?: (string | null) | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, tax_id?: (string | null) | undefined, merchant_identifier?: (string | null) | undefined, merchant_category_code?: (string | null) | undefined, mcc_description?: (string | null) | undefined, dba_name?: (string | null) | undefined, address_line_1?: (string | null) | undefined, address_line_2?: (string | null) | undefined, address_city?: (string | null) | undefined, address_state?: (string | null) | undefined, address_postal_code?: (string | null) | undefined, address_country_code?: (string | null) | undefined, entity_token?: (string | null) | undefined, external_entity_id?: (string | null) | undefined, external_entity_id_source?: (string | null) | undefined, device?: (RegisteredDevice | null) | undefined} | null, instrument?: ({external_instrument_id: string, instrument_type: 'bank_account' | 'card' | 'digital_wallet' | 'other', routing_number?: (string | null) | undefined, routing_number_type?: (string | null) | undefined, account_number?: (string | null) | undefined, account_number_last4?: (string | null) | undefined, account_holder_name?: (string | null) | undefined, account_type?: ('checking' | 'savings' | 'deposit' | 'credit' | 'other' | null) | undefined, country_code?: (string | null) | undefined, card_bin?: (string | null) | undefined, card_last4?: (string | null) | undefined, card_network?: (string | null) | undefined, form_factor?: ('physical' | 'virtual' | null) | undefined, name_on_card?: (string | null) | undefined, expiration_month?: (string | null) | undefined, expiration_year?: (string | null) | undefined, avs?: (string | null) | undefined, wallet_provider?: (string | null) | undefined, wallet_identifier?: (string | null) | undefined, check_number?: (string | null) | undefined, payee_name_raw?: (string | null) | undefined, currency?: (string | null) | undefined} | null) | undefined} | {external_counterparty_id?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, routing_number?: string | undefined, account_number?: string | undefined, counterparty_type?: string | undefined, account_name?: string | undefined, address_line_1?: string | undefined, address_line_2?: string | undefined, address_city?: string | undefined, address_state?: string | undefined, address_postal_code?: string | undefined, address_country_code?: string | undefined, card_network?: string | undefined, merchant_category_code?: string | undefined, name_on_card?: string | undefined, avs?: string | undefined, description?: string | undefined, merchant_category_description?: string | undefined, currency?: string | undefined, identity?: ({external_counterparty_identity_id: string, type?: ('person' | 'business' | 'merchant' | 'customer' | null) | undefined, identity_name?: (string | null) | undefined, name_first?: (string | null) | undefined, name_last?: (string | null) | undefined, birth_date?: (string | null) | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, tax_id?: (string | null) | undefined, merchant_identifier?: (string | null) | undefined, merchant_category_code?: (string | null) | undefined, mcc_description?: (string | null) | undefined, dba_name?: (string | null) | undefined, address_line_1?: (string | null) | undefined, address_line_2?: (string | null) | undefined, address_city?: (string | null) | undefined, address_state?: (string | null) | undefined, address_postal_code?: (string | null) | undefined, address_country_code?: (string | null) | undefined, entity_token?: (string | null) | undefined, external_entity_id?: (string | null) | undefined, external_entity_id_source?: (string | null) | undefined, device?: (RegisteredDevice | null) | undefined} | null) | undefined, instrument: {external_instrument_id: string, instrument_type: 'bank_account' | 'card' | 'digital_wallet' | 'other', routing_number?: (string | null) | undefined, routing_number_type?: (string | null) | undefined, account_number?: (string | null) | undefined, account_number_last4?: (string | null) | undefined, account_holder_name?: (string | null) | undefined, account_type?: ('checking' | 'savings' | 'deposit' | 'credit' | 'other' | null) | undefined, country_code?: (string | null) | undefined, card_bin?: (string | null) | undefined, card_last4?: (string | null) | undefined, card_network?: (string | null) | undefined, form_factor?: ('physical' | 'virtual' | null) | undefined, name_on_card?: (string | null) | undefined, expiration_month?: (string | null) | undefined, expiration_year?: (string | null) | undefined, avs?: (string | null) | undefined, wallet_provider?: (string | null) | undefined, wallet_identifier?: (string | null) | undefined, check_number?: (string | null) | undefined, payee_name_raw?: (string | null) | undefined, currency?: (string | null) | undefined} | null}, category?: ('Adjustment' | 'ATM Rebate' | 'Bill Pay' | 'Chargeback' | 'Deposit' | 'Direct Deposit Bonus' | 'Interest' | 'Overdraft Fee' | 'Payment' | 'Promo' | 'Purchase' | 'Purchase Return' | 'Return' | 'Service Charge' | 'Withdrawal' | null) | undefined, transaction_settled_at?: (string | null) | undefined, description?: (string | null) | undefined, type_code?: (string | null) | undefined, type_description?: (string | null) | undefined, is_approved?: (boolean | null) | undefined, is_reversal?: (boolean | null) | undefined, process_method?: ('Card' | 'Internal' | 'Check' | 'P2P' | 'ACH' | 'Cash' | 'Wire' | 'Digital Wallet' | null) | undefined, is_triggered_by_user?: (boolean | null) | undefined, interaction_point?: ('Android' | 'ATM' | 'Card Swipe Terminal' | 'iOS' | 'Mobile' | 'Online Form' | 'Point of Sale' | 'QR' | 'Teller' | '3rd Party App' | null) | undefined, linked_transactions?: Array | undefined, return_code?: (string | null) | undefined, return_code_reason?: ('Unauthorized' | null) | undefined, status?: ('Acknowledged' | 'Accepted' | 'Rejected' | 'Paused' | 'Pending' | 'Completed' | 'Declined' | 'Cancelled' | null) | undefined, status_detail?: (string | null) | undefined, response_code?: (number | null) | undefined, iso_message?: (number | null) | undefined, entry_mode?: (number | null) | undefined} | {[key: string]: unknown} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_transaction_id: string, amount: number, currency: string, entity_token: string, external_entity_id?: string | undefined, external_account_id?: string | undefined, external_session_id?: (string | null) | undefined, counterparty: {external_counterparty_id?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, routing_number?: string | undefined, account_number: string, counterparty_type?: string | undefined, account_name?: string | undefined, address_line_1?: string | undefined, address_line_2?: string | undefined, address_city?: string | undefined, address_state?: string | undefined, address_postal_code?: string | undefined, address_country_code?: string | undefined, card_network?: string | undefined, merchant_category_code?: string | undefined, name_on_card?: string | undefined, avs?: string | undefined, description?: string | undefined, merchant_category_description?: string | undefined, currency?: string | undefined, identity?: ({external_counterparty_identity_id: string, type?: ('person' | 'business' | 'merchant' | 'customer' | null) | undefined, identity_name?: (string | null) | undefined, name_first?: (string | null) | undefined, name_last?: (string | null) | undefined, birth_date?: (string | null) | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, tax_id?: (string | null) | undefined, merchant_identifier?: (string | null) | undefined, merchant_category_code?: (string | null) | undefined, mcc_description?: (string | null) | undefined, dba_name?: (string | null) | undefined, address_line_1?: (string | null) | undefined, address_line_2?: (string | null) | undefined, address_city?: (string | null) | undefined, address_state?: (string | null) | undefined, address_postal_code?: (string | null) | undefined, address_country_code?: (string | null) | undefined, entity_token?: (string | null) | undefined, external_entity_id?: (string | null) | undefined, external_entity_id_source?: (string | null) | undefined, device?: (RegisteredDevice | null) | undefined} | null) | undefined, instrument?: ({external_instrument_id: string, instrument_type: 'bank_account' | 'card' | 'digital_wallet' | 'other', routing_number?: (string | null) | undefined, routing_number_type?: (string | null) | undefined, account_number?: (string | null) | undefined, account_number_last4?: (string | null) | undefined, account_holder_name?: (string | null) | undefined, account_type?: ('checking' | 'savings' | 'deposit' | 'credit' | 'other' | null) | undefined, country_code?: (string | null) | undefined, card_bin?: (string | null) | undefined, card_last4?: (string | null) | undefined, card_network?: (string | null) | undefined, form_factor?: ('physical' | 'virtual' | null) | undefined, name_on_card?: (string | null) | undefined, expiration_month?: (string | null) | undefined, expiration_year?: (string | null) | undefined, avs?: (string | null) | undefined, wallet_provider?: (string | null) | undefined, wallet_identifier?: (string | null) | undefined, check_number?: (string | null) | undefined, payee_name_raw?: (string | null) | undefined, currency?: (string | null) | undefined} | null) | undefined} | {external_counterparty_id: string, name_first?: string | undefined, name_last?: string | undefined, routing_number?: string | undefined, account_number?: string | undefined, counterparty_type?: string | undefined, account_name?: string | undefined, address_line_1?: string | undefined, address_line_2?: string | undefined, address_city?: string | undefined, address_state?: string | undefined, address_postal_code?: string | undefined, address_country_code?: string | undefined, card_network?: string | undefined, merchant_category_code?: string | undefined, name_on_card?: string | undefined, avs?: string | undefined, description?: string | undefined, merchant_category_description?: string | undefined, currency?: string | undefined, identity?: ({external_counterparty_identity_id: string, type?: ('person' | 'business' | 'merchant' | 'customer' | null) | undefined, identity_name?: (string | null) | undefined, name_first?: (string | null) | undefined, name_last?: (string | null) | undefined, birth_date?: (string | null) | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, tax_id?: (string | null) | undefined, merchant_identifier?: (string | null) | undefined, merchant_category_code?: (string | null) | undefined, mcc_description?: (string | null) | undefined, dba_name?: (string | null) | undefined, address_line_1?: (string | null) | undefined, address_line_2?: (string | null) | undefined, address_city?: (string | null) | undefined, address_state?: (string | null) | undefined, address_postal_code?: (string | null) | undefined, address_country_code?: (string | null) | undefined, entity_token?: (string | null) | undefined, external_entity_id?: (string | null) | undefined, external_entity_id_source?: (string | null) | undefined, device?: (RegisteredDevice | null) | undefined} | null) | undefined, instrument?: ({external_instrument_id: string, instrument_type: 'bank_account' | 'card' | 'digital_wallet' | 'other', routing_number?: (string | null) | undefined, routing_number_type?: (string | null) | undefined, account_number?: (string | null) | undefined, account_number_last4?: (string | null) | undefined, account_holder_name?: (string | null) | undefined, account_type?: ('checking' | 'savings' | 'deposit' | 'credit' | 'other' | null) | undefined, country_code?: (string | null) | undefined, card_bin?: (string | null) | undefined, card_last4?: (string | null) | undefined, card_network?: (string | null) | undefined, form_factor?: ('physical' | 'virtual' | null) | undefined, name_on_card?: (string | null) | undefined, expiration_month?: (string | null) | undefined, expiration_year?: (string | null) | undefined, avs?: (string | null) | undefined, wallet_provider?: (string | null) | undefined, wallet_identifier?: (string | null) | undefined, check_number?: (string | null) | undefined, payee_name_raw?: (string | null) | undefined, currency?: (string | null) | undefined} | null) | undefined} | {external_counterparty_id?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, routing_number?: string | undefined, account_number?: string | undefined, counterparty_type?: string | undefined, account_name?: string | undefined, address_line_1?: string | undefined, address_line_2?: string | undefined, address_city?: string | undefined, address_state?: string | undefined, address_postal_code?: string | undefined, address_country_code?: string | undefined, card_network?: string | undefined, merchant_category_code?: string | undefined, name_on_card?: string | undefined, avs?: string | undefined, description?: string | undefined, merchant_category_description?: string | undefined, currency?: string | undefined, identity: {external_counterparty_identity_id: string, type?: ('person' | 'business' | 'merchant' | 'customer' | null) | undefined, identity_name?: (string | null) | undefined, name_first?: (string | null) | undefined, name_last?: (string | null) | undefined, birth_date?: (string | null) | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, tax_id?: (string | null) | undefined, merchant_identifier?: (string | null) | undefined, merchant_category_code?: (string | null) | undefined, mcc_description?: (string | null) | undefined, dba_name?: (string | null) | undefined, address_line_1?: (string | null) | undefined, address_line_2?: (string | null) | undefined, address_city?: (string | null) | undefined, address_state?: (string | null) | undefined, address_postal_code?: (string | null) | undefined, address_country_code?: (string | null) | undefined, entity_token?: (string | null) | undefined, external_entity_id?: (string | null) | undefined, external_entity_id_source?: (string | null) | undefined, device?: (RegisteredDevice | null) | undefined} | null, instrument?: ({external_instrument_id: string, instrument_type: 'bank_account' | 'card' | 'digital_wallet' | 'other', routing_number?: (string | null) | undefined, routing_number_type?: (string | null) | undefined, account_number?: (string | null) | undefined, account_number_last4?: (string | null) | undefined, account_holder_name?: (string | null) | undefined, account_type?: ('checking' | 'savings' | 'deposit' | 'credit' | 'other' | null) | undefined, country_code?: (string | null) | undefined, card_bin?: (string | null) | undefined, card_last4?: (string | null) | undefined, card_network?: (string | null) | undefined, form_factor?: ('physical' | 'virtual' | null) | undefined, name_on_card?: (string | null) | undefined, expiration_month?: (string | null) | undefined, expiration_year?: (string | null) | undefined, avs?: (string | null) | undefined, wallet_provider?: (string | null) | undefined, wallet_identifier?: (string | null) | undefined, check_number?: (string | null) | undefined, payee_name_raw?: (string | null) | undefined, currency?: (string | null) | undefined} | null) | undefined} | {external_counterparty_id?: string | undefined, name_first?: string | undefined, name_last?: string | undefined, routing_number?: string | undefined, account_number?: string | undefined, counterparty_type?: string | undefined, account_name?: string | undefined, address_line_1?: string | undefined, address_line_2?: string | undefined, address_city?: string | undefined, address_state?: string | undefined, address_postal_code?: string | undefined, address_country_code?: string | undefined, card_network?: string | undefined, merchant_category_code?: string | undefined, name_on_card?: string | undefined, avs?: string | undefined, description?: string | undefined, merchant_category_description?: string | undefined, currency?: string | undefined, identity?: ({external_counterparty_identity_id: string, type?: ('person' | 'business' | 'merchant' | 'customer' | null) | undefined, identity_name?: (string | null) | undefined, name_first?: (string | null) | undefined, name_last?: (string | null) | undefined, birth_date?: (string | null) | undefined, email?: (string | null) | undefined, phone?: (string | null) | undefined, tax_id?: (string | null) | undefined, merchant_identifier?: (string | null) | undefined, merchant_category_code?: (string | null) | undefined, mcc_description?: (string | null) | undefined, dba_name?: (string | null) | undefined, address_line_1?: (string | null) | undefined, address_line_2?: (string | null) | undefined, address_city?: (string | null) | undefined, address_state?: (string | null) | undefined, address_postal_code?: (string | null) | undefined, address_country_code?: (string | null) | undefined, entity_token?: (string | null) | undefined, external_entity_id?: (string | null) | undefined, external_entity_id_source?: (string | null) | undefined, device?: (RegisteredDevice | null) | undefined} | null) | undefined, instrument: {external_instrument_id: string, instrument_type: 'bank_account' | 'card' | 'digital_wallet' | 'other', routing_number?: (string | null) | undefined, routing_number_type?: (string | null) | undefined, account_number?: (string | null) | undefined, account_number_last4?: (string | null) | undefined, account_holder_name?: (string | null) | undefined, account_type?: ('checking' | 'savings' | 'deposit' | 'credit' | 'other' | null) | undefined, country_code?: (string | null) | undefined, card_bin?: (string | null) | undefined, card_last4?: (string | null) | undefined, card_network?: (string | null) | undefined, form_factor?: ('physical' | 'virtual' | null) | undefined, name_on_card?: (string | null) | undefined, expiration_month?: (string | null) | undefined, expiration_year?: (string | null) | undefined, avs?: (string | null) | undefined, wallet_provider?: (string | null) | undefined, wallet_identifier?: (string | null) | undefined, check_number?: (string | null) | undefined, payee_name_raw?: (string | null) | undefined, currency?: (string | null) | undefined} | null}, category?: ('Adjustment' | 'ATM Rebate' | 'Bill Pay' | 'Chargeback' | 'Deposit' | 'Direct Deposit Bonus' | 'Interest' | 'Overdraft Fee' | 'Payment' | 'Promo' | 'Purchase' | 'Purchase Return' | 'Return' | 'Service Charge' | 'Withdrawal' | null) | undefined, transaction_settled_at?: (string | null) | undefined, description?: (string | null) | undefined, type_code?: (string | null) | undefined, type_description?: (string | null) | undefined, is_approved?: (boolean | null) | undefined, is_reversal?: (boolean | null) | undefined, process_method?: ('Card' | 'Internal' | 'Check' | 'P2P' | 'ACH' | 'Cash' | 'Wire' | 'Digital Wallet' | null) | undefined, is_triggered_by_user?: (boolean | null) | undefined, interaction_point?: ('Android' | 'ATM' | 'Card Swipe Terminal' | 'iOS' | 'Mobile' | 'Online Form' | 'Point of Sale' | 'QR' | 'Teller' | '3rd Party App' | null) | undefined, linked_transactions?: Array | undefined, return_code?: (string | null) | undefined, return_code_reason?: ('Unauthorized' | null) | undefined, status?: ('Acknowledged' | 'Accepted' | 'Rejected' | 'Paused' | 'Pending' | 'Completed' | 'Declined' | 'Cancelled' | null) | undefined, status_detail?: (string | null) | undefined, response_code?: (number | null) | undefined, iso_message?: (number | null) | undefined, entry_mode?: (number | null) | undefined} | {[key: string]: unknown} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, name?: string | undefined, type?: ('business' | 'joint_account' | 'membership' | 'merchant') | undefined, entities: Array<{external_entity_id: string, entity_token?: string | undefined, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, title?: string | undefined, ownership_percentage?: number | undefined, bank_accounts?: (Array<{external_account_id: string, account_token?: string | undefined, role?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined} | {external_account_id?: string | undefined, account_token: string, role?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined}>) | undefined} | {external_entity_id?: string | undefined, entity_token: string, roles?: (Array<'primary' | 'shareholder' | 'secondary' | 'beneficiary' | 'beneficial_owner' | 'control_prong' | 'director' | 'authorized_signer' | 'principal_owner' | 'coborrower' | 'joint' | 'guarantor'>) | undefined, title?: string | undefined, ownership_percentage?: number | undefined, bank_accounts?: (Array<{external_account_id: string, account_token?: string | undefined, role?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined} | {external_account_id?: string | undefined, account_token: string, role?: ('primary' | 'secondary' | 'power_of_attorney' | 'authorized_signer' | 'authorized_user' | 'beneficiary' | 'joint_owner' | 'custodian' | 'guardian' | 'trustee') | undefined}>) | undefined}>, external_entity_group_ids: Array<{external_entity_id: string, type?: string | undefined, designation?: 'primary' | undefined}>, external_session_id?: (string | null) | undefined} | unknown | unknown | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_card_id: string, external_entity_id: string, card_name?: string | undefined, product_name?: string | undefined, product_code?: string | undefined, card_type?: ('debit' | 'credit' | 'prepaid' | 'charge') | undefined, form_factor?: ('physical' | 'virtual') | undefined, issued_at?: string | undefined, expiry_month?: string | undefined, expiry_year?: string | undefined, pin_updated_at?: string | undefined, pin_update_method?: ('app' | 'ivr' | 'agent' | 'atm' | 'other') | undefined, is_locked?: boolean | undefined, lock_expires_at?: string | undefined, status?: ('active' | 'inactive' | 'deactivated' | 'terminated' | 'pending_activation' | 'expired') | undefined, status_detail?: string | undefined, entities?: (Array<{card_holder_type: 'primary' | 'secondary' | 'authorized_user', external_entity_id: string}>) | undefined, accounts?: (Array<{external_account_id: string, account_type: 'primary' | 'secondary'}>) | undefined, replaces_external_card_id?: string | undefined, replacement_reason?: string | undefined, external_entity_group_id?: string | undefined, entity_group_token?: string | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_card_id: string, external_entity_id: string, card_name?: string | undefined, product_name?: string | undefined, product_code?: string | undefined, card_type?: ('debit' | 'credit' | 'prepaid' | 'charge') | undefined, form_factor?: ('physical' | 'virtual') | undefined, issued_at?: string | undefined, expiry_month?: string | undefined, expiry_year?: string | undefined, pin_updated_at?: string | undefined, pin_update_method?: ('app' | 'ivr' | 'agent' | 'atm' | 'other') | undefined, is_locked?: boolean | undefined, lock_expires_at?: string | undefined, status?: ('active' | 'inactive' | 'deactivated' | 'terminated' | 'pending_activation' | 'expired') | undefined, status_detail?: string | undefined, entities?: (Array<{card_holder_type: 'primary' | 'secondary' | 'authorized_user', external_entity_id: string}>) | undefined, accounts?: (Array<{external_account_id: string, account_type: 'primary' | 'secondary'}>) | undefined, replaces_external_card_id?: string | undefined, replacement_reason?: string | undefined, external_entity_group_id?: string | undefined, entity_group_token?: string | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_device_id: string, vendor_name?: string | undefined, ip_address_latitude?: number | undefined, ip_address_longitude?: number | undefined, ip_address_city?: string | undefined, ip_address_region?: string | undefined, ip_address_country_code?: string | undefined, device_isp?: string | undefined, device_type?: string | undefined, device_os?: string | undefined, screen_resolution?: string | undefined, timezone_offset?: string | undefined, browser_type?: string | undefined, browser_version?: string | undefined, browser_language?: string | undefined, cookies_enabled?: DeviceDetailBool | undefined, javascript_enabled?: DeviceDetailBool | undefined, first_seen_at?: string | undefined, new_device?: boolean | undefined, entity_token?: string | undefined, external_entity_id: string, external_session_id?: (string | null) | undefined, registered_device?: boolean | undefined, ip_address_v4?: string | undefined, ip_address_v6?: string | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, external_device_id: string, vendor_name?: string | undefined, ip_address_latitude?: number | undefined, ip_address_longitude?: number | undefined, ip_address_city?: string | undefined, ip_address_region?: string | undefined, ip_address_country_code?: string | undefined, device_isp?: string | undefined, device_type?: string | undefined, device_os?: string | undefined, screen_resolution?: string | undefined, timezone_offset?: string | undefined, browser_type?: string | undefined, browser_version?: string | undefined, browser_language?: string | undefined, cookies_enabled?: DeviceDetailBool | undefined, javascript_enabled?: DeviceDetailBool | undefined, first_seen_at?: string | undefined, new_device?: boolean | undefined, entity_token: string, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, registered_device?: boolean | undefined, ip_address_v4?: string | undefined, ip_address_v6?: string | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, device_token: string, external_device_id?: string | undefined, ip_address_latitude?: number | undefined, ip_address_longitude?: number | undefined, ip_address_city?: string | undefined, ip_address_region?: string | undefined, ip_address_country_code?: string | undefined, device_isp?: string | undefined, device_type?: string | undefined, device_os?: string | undefined, screen_resolution?: string | undefined, timezone_offset?: string | undefined, browser_type?: string | undefined, browser_version?: string | undefined, browser_language?: string | undefined, cookies_enabled?: DeviceDetailBool | undefined, javascript_enabled?: DeviceDetailBool | undefined, first_seen_at?: string | undefined, new_device?: boolean | undefined, entity_token?: string | undefined, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, registered_device?: boolean | undefined, ip_address_v4?: string | undefined, ip_address_v6?: string | undefined} | {timestamp: string, meta?: ({[key: string]: unknown} | null) | undefined, supplemental_data?: ({[key: string]: unknown} | null) | undefined, device_token?: string | undefined, external_device_id: string, ip_address_latitude?: number | undefined, ip_address_longitude?: number | undefined, ip_address_city?: string | undefined, ip_address_region?: string | undefined, ip_address_country_code?: string | undefined, device_isp?: string | undefined, device_type?: string | undefined, device_os?: string | undefined, screen_resolution?: string | undefined, timezone_offset?: string | undefined, browser_type?: string | undefined, browser_version?: string | undefined, browser_language?: string | undefined, cookies_enabled?: DeviceDetailBool | undefined, javascript_enabled?: DeviceDetailBool | undefined, first_seen_at?: string | undefined, new_device?: boolean | undefined, entity_token?: string | undefined, external_entity_id?: string | undefined, external_session_id?: (string | null) | undefined, registered_device?: boolean | undefined, ip_address_v4?: string | undefined, ip_address_v6?: string | undefined}) | undefined}; export type CreateApiEventsArgs = {body: PostEvent}; export type CreateApiEventsOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; export const investigationsResponse = z.array(z.object({investigation_token: z.string().optional(), investigation_state: z.enum(["alert_review", "alert_review_closed", "case_review", "case_review_closed", "open"]).optional()})); export const eventsResponseOK = z.object({status_code: z.string().optional(), _links: z.object({self: z.object({_href: z.string().optional()}).optional()}).optional(), event: z.object({event_type: z.string().optional(), event_status: z.string().optional(), data: z.object({}).optional(), evaluations: z.array(z.record(z.string(), z.unknown())).optional(), journey_applications: z.array(z.object({error: z.string().optional(), journey_application_token: z.string().optional(), journey_application_status: z.string().optional(), journey_token: z.string().optional(), journey_version_id: z.number().optional(), source_evaluation_tokens: z.array(z.string()).optional(), investigations: investigationsResponse.optional(), _links: z.object({self: z.object({href: z.string().optional()}).optional()}).optional()})).optional()}).optional(), error: z.object({}).optional()}); export const validateResponse = async ( schema: { readonly '~standard': { readonly validate: (value: unknown) => ({ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }) | Promise<{ readonly value: Output; readonly issues?: undefined } | { readonly issues: ReadonlyArray<{ readonly message: string; readonly path?: ReadonlyArray | undefined }> }> } }, value: unknown ): Promise => { const result = await schema['~standard'].validate(value) if (result.issues !== undefined) { const detail = result.issues .map(({ message, path }) => path?.length ? `${path.map((segment) => String(typeof segment === 'object' ? segment.key : segment)).join('.')}: ${message}` : message ) .join('; ') throw new Error(`Response does not match the schema: ${detail}`, { cause: { issues: result.issues } }) } return result.value }; /** * Create an event * * POST /events/ * * Also accepts auth: basic */ export const createApiEvents = async (args: CreateApiEventsArgs, options?: CreateApiEventsOptions) => { const {baseUrl = "https://sandbox.alloy.co/v1", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "application/json") if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/events/${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return validateResponse(eventsResponseOK, await res.json()) };