Transactions

|-/redux
    |
    |-/transactions
        |- index.ts
        |- transactionsSlice.ts
        |- transactionsThunks.ts
Initial State
transactionsSlice.ts
initialState: SliceState = {
  transactionsState: { 
    total_count: 0,
    limit: 0,
    offset: 0,
    transactions: [],
  },
    
  isLoadingTransactions: false,
};
Selectors
  • getTransactions: This selector gets transactions collection from the app state requested previously.

  • getIsLoadingTransactions: This selector helps to know the transactions request state when the request is pending it is true and it helps to give feedback enabling a spinner in transactions component.

How to get transactions?

Invoke fetchAccountTransactions from redux/transactions using LinkerStudio/core/hooks useAppDispatch

import {useAppDispatch} from 'LinkerStudio/core/hooks';

const dispatch = useAppDispatch();

dispatch(fetchAccountTransactions({}));

Get specific transactions

All transactions request parameters are optional to use.

ParameterTypeDescription

limit

number

Default: 100

type

string[]

Filter by types

status

string[]

Filter by statuses

search_description

string

Filter by description of a transaction. '*' can be used as a wild card at the start or the end of a description.

synthetic_account_id

string

Filter by synthetic account, either in source or destination

source_synthetic_account_id

string

Filter by synthetic account, but only in source

destination_synthectic_account_id

string

Filter by synthetic account, but only in destination

debit_card_uid

string

Filter by debit card uid

offset

string

Default: 0

sort

string

Filter by sort Default: "created_at_asc"

Transactions Request Example

fetchAccountTransactions({
    limit: 5,
    search_description: 'description',
    status: 'pending'
});

Last updated