# `Pluggy.Transactions`
[🔗](https://github.com/fellipessanha/pluggy_ai_ex/blob/main/lib/pluggy/transactions.ex#L1)

Functions for interacting with the Pluggy Transactions API.

# `get`

```elixir
@spec get(Pluggy.Client.t(), String.t()) :: {:ok, term()} | {:error, Pluggy.Error.t()}
```

Gets a transaction by ID.

# `get!`

```elixir
@spec get!(Pluggy.Client.t(), String.t()) :: term()
```

# `list`

```elixir
@spec list(Pluggy.Client.t(), String.t() | map(), keyword()) ::
  {:ok, term()} | {:error, Pluggy.Error.t()}
```

Lists transactions for a given account.

The second argument accepts either an account ID string or an account map
(e.g. an entry from `Pluggy.Accounts.list/2`) — the `:id` field is extracted
automatically, making it easy to pipe the two calls together:

    {:ok, %{results: [account | _]}} = Pluggy.Accounts.list(client, item_id)
    Pluggy.Transactions.list(client, account)

## Options

  * `:from` - Start date filter
  * `:to` - End date filter
  * `:page_size` - Number of results per page (1-500)
  * `:page` - Page number

# `list!`

```elixir
@spec list!(Pluggy.Client.t(), String.t() | map(), keyword()) :: term()
```

# `list_with_cursor`

```elixir
@spec list_with_cursor(Pluggy.Client.t(), String.t() | map(), keyword()) ::
  {:ok, map(), Pluggy.HTTP.Cursor.t() | nil} | {:error, Pluggy.Error.t()}
```

Lists transactions with cursor-based pagination.

The second argument accepts either an account ID string or an account map —
the `:id` field is extracted automatically.

Returns `{:ok, response, cursor}` where `cursor` is a `%Pluggy.HTTP.Cursor{}`
when more pages are available, or `nil` when on the last page.

Pass the cursor to `Pluggy.HTTP.with_cursor/1` to fetch the next page.

# `update`

```elixir
@spec update(Pluggy.Client.t(), String.t(), map()) ::
  {:ok, term()} | {:error, Pluggy.Error.t()}
```

Updates a transaction (e.g. to change its category).

# `update!`

```elixir
@spec update!(Pluggy.Client.t(), String.t(), map()) :: term()
```

---

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