# `Beancount.Directives.Close`
[🔗](https://github.com/thanos/beancount_ex/blob/v0.6.0/lib/beancount/directives/close.ex#L1)

The `close` directive marks an account as inactive.

See the [Beancount Close directive](https://beancount.github.io/docs/beancount_language_syntax/#close).

## Beancount syntax

    2026-12-31 close Assets:Bank
      archived: TRUE

General form: `YYYY-MM-DD close Account`

## Elixir struct

    %Beancount.Directives.Close{
      date: ~D[2026-12-31],
      account: "Assets:Bank",
      metadata: %{"archived" => true}
    }

Or use `Beancount.close/3`:

    Beancount.close(~D[2026-12-31], "Assets:Bank",
      metadata: %{"archived" => true}
    )

## Fields

  * `date` - `Date.t()` after which postings to this account are invalid.
  * `account` - colon-separated account name being closed.
  * `metadata` - optional map of key/value pairs rendered below the directive.

# `t`

```elixir
@type t() :: %Beancount.Directives.Close{
  account: String.t(),
  date: Date.t(),
  metadata: map()
}
```

---

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