LatticeStripe.Invoice.AutomaticTax (LatticeStripe v1.1.0)

Copy Markdown View Source

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 for field definitions.

Summary

Types

t()

Automatic tax calculation settings for a Stripe Invoice or Subscription.

Functions

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

Types

t()

@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.

Functions

from_map(map)

@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: %{}
}