# `Codat.BankFeeds.AccountMapping`
[🔗](https://github.com/iamkanishka/codat.git/blob/v1.0.0/lib/codat/bank_feeds/bank_feeds.ex#L129)

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.

# `get_options`

```elixir
@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
    )

# `set`

```elixir
@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 to
- `feed_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"}
    )

---

*Consult [api-reference.md](api-reference.md) for complete listing*
