Manage source bank accounts for bank feeds.
Source accounts are the bank/credit card accounts in your application that you want to feed into a customer's accounting software.
Lifecycle
- Create a bank feed connection via
Codat.Platform.Connections.create/3with the appropriate Bank Feeds integration key - Create source accounts here
- Ask the customer to map source accounts to their chart of accounts
via
Codat.BankFeeds.AccountMapping - Push transactions via
Codat.BankFeeds.Transactions
Example
{:ok, account} = Codat.BankFeeds.SourceAccounts.create(client, company_id, conn_id, %{
accountName: "Business Checking",
accountNumber: "12345678",
accountType: "Checking",
currency: "USD",
balance: 10_000.00
})
Summary
Functions
Creates a new bankFeedAccounts (async). Returns a push operation.
Deletes a bankFeedAccounts by ID (async).
Fetches all bankFeedAccounts across all pages concurrently.
Fetches a single bankFeedAccounts by ID.
Returns the push model for creating bankFeedAccounts.
Returns the push model for updating a bankFeedAccounts record.
Returns a paginated list of bankFeedAccounts.
Returns a lazy Stream of all results.
Updates an existing bankFeedAccounts (async).
Updates multiple source accounts in a single request.
Functions
@spec create( Codat.Client.t() | String.t(), String.t(), String.t() | map(), map() | keyword() ) :: {:ok, map()} | {:error, Codat.Error.t()}
Creates a new bankFeedAccounts (async). Returns a push operation.
@spec delete(Codat.Client.t() | String.t(), String.t(), String.t() | keyword()) :: {:ok, nil} | {:error, Codat.Error.t()}
Deletes a bankFeedAccounts by ID (async).
@spec fetch_all(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) :: {:ok, [map()]} | {:error, Codat.Error.t()}
Fetches all bankFeedAccounts across all pages concurrently.
@spec get(Codat.Client.t() | String.t(), String.t(), String.t() | keyword()) :: {:ok, map()} | {:error, Codat.Error.t()}
Fetches a single bankFeedAccounts by ID.
@spec get_create_model(Codat.Client.t() | String.t(), String.t(), keyword()) :: {:ok, map()} | {:error, Codat.Error.t()}
Returns the push model for creating bankFeedAccounts.
@spec get_update_model( Codat.Client.t() | String.t(), String.t(), String.t() | keyword(), keyword() ) :: {:ok, map()} | {:error, Codat.Error.t()}
Returns the push model for updating a bankFeedAccounts record.
@spec list(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) :: {:ok, Codat.Pagination.t()} | {:error, Codat.Error.t()}
Returns a paginated list of bankFeedAccounts.
@spec stream(Codat.Client.t() | String.t(), String.t() | keyword(), keyword()) :: Enumerable.t()
Returns a lazy Stream of all results.
@spec update( Codat.Client.t() | String.t(), String.t(), String.t(), String.t() | map(), map() | keyword() ) :: {:ok, map()} | {:error, Codat.Error.t()}
Updates an existing bankFeedAccounts (async).
@spec update_batch( Codat.Client.t() | String.t(), String.t(), String.t() | list(), list() | keyword() ) :: {:ok, map()} | {:error, Codat.Error.t()}
Updates multiple source accounts in a single request.
Example
{:ok, accounts} = Codat.BankFeeds.SourceAccounts.update_batch(
client, company_id, conn_id,
[%{id: "acc-1", balance: 12_500.00}, %{id: "acc-2", balance: 500.00}]
)