Retrieve and configure the mapping between source accounts and the customer's chart of accounts.
Customers must map their bank feed source accounts to existing GL accounts (or create new ones) in their accounting software before transactions can flow.
Summary
Functions
Returns the mapping options for a source account (available target GL accounts).
Sets the mapping for a source account to a target GL account.
Functions
@spec get_options( Codat.Client.t() | String.t(), String.t(), String.t(), String.t() | keyword() ) :: {:ok, map()} | {:error, Codat.Error.t()}
Returns the mapping options for a source account (available target GL accounts).
Example
{:ok, mapping} = Codat.BankFeeds.AccountMapping.get_options(
client, company_id, conn_id, source_account_id
)
@spec set( Codat.Client.t() | String.t(), String.t(), String.t(), String.t(), map() | keyword() ) :: {:ok, map()} | {:error, Codat.Error.t()}
Sets the mapping for a source account to a target GL account.
Parameters
target_account_id— ID of the existing GL account to map tofeed_start_date— ISO8601 date from which to start feeding transactions
Example
{:ok, _} = Codat.BankFeeds.AccountMapping.set(
client, company_id, conn_id, source_account_id,
%{targetAccountId: "gl-account-id", feedStartDate: "2024-01-01"}
)