# `Codat.Platform.Integrations`
[🔗](https://github.com/iamkanishka/codat.git/blob/v1.0.0/lib/codat/platform/integrations.ex#L1)

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

| Key     | Platform                    | Type       |
|---------|-----------------------------|------------|
| `gbol`  | QuickBooks Online           | Accounting |
| `hyvw`  | Xero                        | Accounting |
| `fbrh`  | Sage Business Cloud         | Accounting |
| `tqwq`  | Sage Intacct                | Accounting |
| `zsth`  | NetSuite                    | Accounting |
| `dfcm`  | FreeAgent                   | Accounting |
| `sqpq`  | Freshbooks                  | Accounting |
| `bxws`  | MYOB Business               | Accounting |
| `djkp`  | Wave Financials             | Accounting |
| `gwuq`  | Monzo                       | Banking    |
| `qhkq`  | Plaid                       | Banking    |

## 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"

# `get`

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

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

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

---

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