# `LatticeStripe.Invoice.AutomaticTax`
[🔗](https://github.com/szTheory/lattice_stripe/blob/v1.1.0/lib/lattice_stripe/invoice/automatic_tax.ex#L1)

Represents automatic tax calculation settings on a Stripe Invoice.

Returned as a nested field on `LatticeStripe.Invoice` and
`LatticeStripe.Subscription` structs (both Stripe resources carry an
`automatic_tax` sub-object with the same shape).

## Fields

- `enabled` - Whether automatic tax is enabled for this invoice
- `status` - Calculation status: `nil`, `"requires_location_inputs"`, `"complete"`, or `"failed"`
- `liability` - Tax liability object (raw map); present when Stripe Tax is active.
  Kept as a raw map per SDK convention — no sub-struct needed.
- `extra` - Unknown fields from Stripe not yet in this struct. Future Stripe
  API additions to `automatic_tax` are preserved here rather than silently
  dropped.

## Stripe API Reference

See the [Stripe Invoice object](https://docs.stripe.com/api/invoices/object#invoice_object-automatic_tax)
for field definitions.

# `t`

```elixir
@type t() :: %LatticeStripe.Invoice.AutomaticTax{
  enabled: boolean() | nil,
  extra: map(),
  liability: map() | nil,
  status: String.t() | nil
}
```

Automatic tax calculation settings for a Stripe Invoice or Subscription.

# `from_map`

```elixir
@spec from_map(map() | nil) :: t() | nil
```

Converts a decoded Stripe API map to a `%AutomaticTax{}` struct.

Maps all known `automatic_tax` fields. Any unrecognized fields are collected
into the `extra` map so forward-compatible additions from Stripe are not
silently lost.

Returns `nil` when given `nil` (invoice has no automatic_tax field).

## Example

    iex> LatticeStripe.Invoice.AutomaticTax.from_map(%{
    ...>   "enabled" => true,
    ...>   "status" => "complete",
    ...>   "liability" => %{"type" => "self"}
    ...> })
    %LatticeStripe.Invoice.AutomaticTax{
      enabled: true,
      status: "complete",
      liability: %{"type" => "self"},
      extra: %{}
    }

---

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