Codat.Platform.Integrations (codat v1.0.0)

Copy Markdown View Source

Browse and manage available Codat integrations.

Integrations are the accounting, banking, and commerce platforms that Codat supports. Use this module to discover platform keys for creating connections and to check feature support per integration.

Common Integration Keys

KeyPlatformType
gbolQuickBooks OnlineAccounting
hyvwXeroAccounting
fbrhSage Business CloudAccounting
tqwqSage IntacctAccounting
zsthNetSuiteAccounting
dfcmFreeAgentAccounting
sqpqFreshbooksAccounting
bxwsMYOB BusinessAccounting
djkpWave FinancialsAccounting
gwuqMonzoBanking
qhkqPlaidBanking

Example

{:ok, page} = Codat.Platform.Integrations.list(client)
qbo = Enum.find(page.results, &(&1["key"] == "gbol"))
qbo["name"]        # => "QuickBooks Online"
qbo["enabled"]     # => true
qbo["sourceType"]  # => "Accounting"

Summary

Functions

Fetches a single integration by its platform key.

Returns the branding assets (logo, icon, colours) for an integration.

Returns a paginated list of all available Codat integrations.

Functions

get(client_or_key, key_or_opts \\ [])

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

Fetches a single integration by its platform key.

Example

{:ok, integration} = Codat.Platform.Integrations.get(client, "gbol")
integration["name"]         # => "QuickBooks Online"
integration["sourceType"]   # => "Accounting"
integration["enabled"]      # => true
integration["datatypes"]    # => [%{"datatype" => "invoices", "supportedFeatures" => [...]}]

get_branding(client_or_key, key_or_opts \\ [])

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

Returns the branding assets (logo, icon, colours) for an integration.

Useful for building integration selector UIs.

Example

{:ok, branding} = Codat.Platform.Integrations.get_branding(client, "gbol")
branding["logo"]["full"]["source"]  # => "https://..."
branding["button"]["backgroundColor"]  # => "#2CA01C"

list(client_or_opts \\ [], opts \\ [])

@spec list(
  Codat.Client.t() | keyword(),
  keyword()
) :: {:ok, Codat.Pagination.t()} | {:error, Codat.Error.t()}

Returns a paginated list of all available Codat integrations.

Options

  • :page, :page_size — pagination
  • :query — filter, e.g. "sourceType=Accounting" or "enabled=true"
  • :order_by — sort field

Example

# All accounting integrations
{:ok, page} = Codat.Platform.Integrations.list(client,
  query: "sourceType=Accounting&&enabled=true"
)