Represents a line item in a Checkout Session.
Returned by Checkout.Session.list_line_items/4 and Checkout.Session.stream_line_items!/4.
Line items cannot be created or fetched independently — they are always accessed
in the context of a Checkout Session.
Fields
id- Unique identifier for the line itemobject- Always"item"amount_discount- Total discount amount in the smallest currency unitamount_subtotal- Subtotal amount before taxes and discountsamount_tax- Total tax amountamount_total- Total amount after discounts and taxescurrency- Three-letter ISO currency codedescription- Human-readable description of the itemprice- The price object associated with this line itemquantity- Quantity of the item purchased
Summary
Functions
Converts a decoded Stripe API map to a %LineItem{} struct.
Types
@type t() :: %LatticeStripe.Checkout.LineItem{ amount_discount: integer() | nil, amount_subtotal: integer() | nil, amount_tax: integer() | nil, amount_total: integer() | nil, currency: String.t() | nil, description: String.t() | nil, extra: map(), id: String.t() | nil, object: String.t(), price: map() | nil, quantity: integer() | nil }
A line item within a Stripe Checkout Session.
Line items are accessed through Checkout.Session.list_line_items/4 or
Checkout.Session.stream_line_items!/4. They cannot be fetched independently.
See Stripe Checkout Sessions line items for field definitions.
Functions
Converts a decoded Stripe API map to a %LineItem{} struct.
Maps all known line item fields. Any unrecognized fields are collected
into the extra map so no data is silently lost.
Example
item = LatticeStripe.Checkout.LineItem.from_map(%{
"id" => "li_...",
"object" => "item",
"description" => "T-Shirt",
"quantity" => 1,
"amount_total" => 2000
})