Codat.Expenses.Mappings (codat v1.0.0)

Copy Markdown View Source

Manage expense mapping options.

Mappings associate expense transactions with accounts, tax rates, and tracking categories in the customer's accounting software.

Summary

Functions

Returns the mapping options available for a company.

Functions

get_options(client_or_company_id, id_or_opts \\ [])

@spec get_options(Codat.Client.t() | String.t(), String.t() | keyword()) ::
  {:ok, map()} | {:error, Codat.Error.t()}

Returns the mapping options available for a company.

Example

{:ok, options} = Codat.Expenses.Mappings.get_options(client, company_id)
options["accounts"]  # => [%{"id" => "...", "name" => "..."}]
options["taxRates"]  # => [...]