Accounts

|-/redux
    |
    |-/accounts
        |- index.ts
        |- accountsSlice.ts
        |- accountsThunks.ts
Initial State
const initialState: SliceState = {
  primaryAccount: {
    account_number: '',
    account_number_masked: '',
    custodial_partner_name: '',
    custodial_partner_uid: '',
    customer_uid: '',
    liability: false,
    name: '',
    net_usd_available_balance: '',
    net_usd_balance: '',
    net_usd_pending_balance: '',
    opened_at: '',
    pool_uid: '',
    primary_account: false,
    routing_number: '',
    status: '',
    type: '',
    uid: '',
  },
  statements: [],
  isLoadingCustomerPrimaryAccount: false,
   internalAccounts: {
    data: [],
  },
  isLoadingInternalAccounts: false,
};
Selectors
  • getPrimaryAccount: retrieves customer's primary account data, which is the primaryAccount object in the state.

  • getIsLoadingCustomerPrimaryAccount: whether the primary account data is being requested or not.

  • getInternalAccounts: retrieves synthetic account's data with the syntheticAccountCategory -> general filter, which is the internalAccounts object of the state.

  • getIsLoadingInternalAccounts: whether the synthetic account's data is being requested or not.

  • getStatements: retrieves user statement data.

  • getInternalAccountsTransferType: retrieves the synthetic account data with the filter syntheticAccountCategory -> general, which is the internalAccounts object from the state, and then, it formats the accounts to a suitable object to display the information.

  • getAchAccountsTransferType: retrieves ACH accounts previously saved by the user.

  • getIsLoadingAchAccounts: whether the ACH accounts' data is being requested or not.

How to get Internal Accounts?

Invoke fetchInternalAccounts, from redux/accounts using LinkerStudio/core/hooks useAppDispatch.

import {useAppDispatch} from 'LinkerStudio/core/hooks';
import {fetchInternalAccounts} from 'LinkerStudio/modules/baas/redux/accounts';

const dispatch = useAppDispatch();

dispatch(fetchInternalAccounts({}));

Get Specific Accounts

The use of all account request parameters is optional.

Parameter
Type
Description

syntheticAccountCategory

string

Filter by account type

Accounts Request Example

How to get Statements?

Invoke fetchCustomerStatements, from redux/accounts using LinkerStudio/core/hooks useAppDispatch.

Get Specific Statement

Get a document from a statement. The following environment variables are required:

Parameter
Type
Description

statementId

string

Filter by statement id

Response
Type
Description

document

base64

Show PDF in base64

isLoadingDocument

boolean

Show loading document

Last updated

Was this helpful?