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

Tracks lifecycle Unix timestamps for a Stripe Invoice.

Returned as a nested field on `LatticeStripe.Invoice` structs. All fields are
optional Unix timestamps that record when the invoice entered each lifecycle state.

## Fields

- `finalized_at` - Unix timestamp when the invoice was finalized (moved to open status)
- `marked_uncollectible_at` - Unix timestamp when the invoice was marked uncollectible
- `paid_at` - Unix timestamp when the invoice was paid
- `voided_at` - Unix timestamp when the invoice was voided

## Stripe API Reference

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

# `t`

```elixir
@type t() :: %LatticeStripe.Invoice.StatusTransitions{
  finalized_at: integer() | nil,
  marked_uncollectible_at: integer() | nil,
  paid_at: integer() | nil,
  voided_at: integer() | nil
}
```

Lifecycle timestamps for a Stripe Invoice.

# `from_map`

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

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

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

## Example

    iex> LatticeStripe.Invoice.StatusTransitions.from_map(%{
    ...>   "finalized_at" => 1_700_000_000,
    ...>   "paid_at" => 1_700_000_200,
    ...>   "marked_uncollectible_at" => nil,
    ...>   "voided_at" => nil
    ...> })
    %LatticeStripe.Invoice.StatusTransitions{
      finalized_at: 1_700_000_000,
      paid_at: 1_700_000_200,
      marked_uncollectible_at: nil,
      voided_at: nil
    }

---

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