AccessGrid.LedgerItem (AccessGrid v0.1.0)

Copy Markdown View Source

A line item from the account's billing ledger. Returned by AccessGrid.Console.list_ledger_items/1.

access_pass is populated when the ledger item is tied to a specific access pass — typically credit/debit lines for issuance, renewals, etc. It is nil for line items that aren't pass-scoped.

The API returns both id and ex_id for ledger items (same value); ex_id is deprecated. This struct reads from id.

Summary

Functions

Creates a LedgerItem struct from an API response map.

Types

t()

@type t() :: %AccessGrid.LedgerItem{
  access_pass: AccessGrid.LedgerItem.AccessPass.t() | nil,
  amount: number() | nil,
  created_at: String.t() | nil,
  event: String.t() | nil,
  id: String.t() | nil,
  kind: String.t() | nil,
  metadata: map()
}

Functions

from_response(data)

@spec from_response(map()) :: t()

Creates a LedgerItem struct from an API response map.