# `Stripe.Resources.InvoiceLineItem`
[🔗](https://github.com/jeffhuen/tiger_stripe/blob/main/lib/stripe/resources/invoice_line_item.ex#L2)

InvoiceLineItem

Invoice Line Items represent the individual lines within an [invoice](https://docs.stripe.com/api/invoices) and only exist within the context of an invoice.

Each line item is backed by either an [invoice item](https://docs.stripe.com/api/invoiceitems) or a [subscription item](https://docs.stripe.com/api/subscription_items).

# `discount_amounts`

```elixir
@type discount_amounts() :: %{
  optional(:amount) =&gt; integer() | nil,
  optional(:discount) =&gt; String.t() | Stripe.Resources.Discount.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `amount` - The amount, in cents (or local equivalent), of the discount.
* `discount` - The discount that was applied to get this discount amount.

# `parent`

```elixir
@type parent() :: %{
  optional(:invoice_item_details) =&gt; parent_invoice_item_details() | nil,
  optional(:subscription_item_details) =&gt;
    parent_subscription_item_details() | nil,
  optional(:type) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `invoice_item_details` - Details about the invoice item that generated this line item Nullable.
* `subscription_item_details` - Details about the subscription item that generated this line item Nullable.
* `type` - The type of parent that generated this line item Possible values: `invoice_item_details`, `subscription_item_details`.

# `parent_invoice_item_details`

```elixir
@type parent_invoice_item_details() :: %{
  optional(:invoice_item) =&gt; String.t() | nil,
  optional(:proration) =&gt; boolean() | nil,
  optional(:proration_details) =&gt;
    parent_invoice_item_details_proration_details() | nil,
  optional(:subscription) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `invoice_item` - The invoice item that generated this line item Max length: 5000.
* `proration` - Whether this is a proration
* `proration_details` - Additional details for proration line items Nullable.
* `subscription` - The subscription that the invoice item belongs to Max length: 5000. Nullable.

# `parent_invoice_item_details_proration_details`

```elixir
@type parent_invoice_item_details_proration_details() :: %{
  optional(:credited_items) =&gt;
    parent_invoice_item_details_proration_details_credited_items() | nil,
  optional(String.t()) =&gt; term()
}
```

* `credited_items` - For a credit proration `line_item`, the original debit line_items to which the credit proration applies. Nullable.

# `parent_invoice_item_details_proration_details_credited_items`

```elixir
@type parent_invoice_item_details_proration_details_credited_items() :: %{
  optional(:invoice) =&gt; String.t() | nil,
  optional(:invoice_line_items) =&gt; [String.t()] | nil,
  optional(String.t()) =&gt; term()
}
```

* `invoice` - Invoice containing the credited invoice line items Max length: 5000.
* `invoice_line_items` - Credited invoice line items

# `parent_subscription_item_details`

```elixir
@type parent_subscription_item_details() :: %{
  optional(:invoice_item) =&gt; String.t() | nil,
  optional(:proration) =&gt; boolean() | nil,
  optional(:proration_details) =&gt;
    parent_subscription_item_details_proration_details() | nil,
  optional(:subscription) =&gt; String.t() | nil,
  optional(:subscription_item) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `invoice_item` - The invoice item that generated this line item Max length: 5000. Nullable.
* `proration` - Whether this is a proration
* `proration_details` - Additional details for proration line items Nullable.
* `subscription` - The subscription that the subscription item belongs to Max length: 5000. Nullable.
* `subscription_item` - The subscription item that generated this line item Max length: 5000.

# `parent_subscription_item_details_proration_details`

```elixir
@type parent_subscription_item_details_proration_details() :: %{
  optional(:credited_items) =&gt;
    parent_subscription_item_details_proration_details_credited_items() | nil,
  optional(String.t()) =&gt; term()
}
```

* `credited_items` - For a credit proration `line_item`, the original debit line_items to which the credit proration applies. Nullable.

# `parent_subscription_item_details_proration_details_credited_items`

```elixir
@type parent_subscription_item_details_proration_details_credited_items() :: %{
  optional(:invoice) =&gt; String.t() | nil,
  optional(:invoice_line_items) =&gt; [String.t()] | nil,
  optional(String.t()) =&gt; term()
}
```

* `invoice` - Invoice containing the credited invoice line items Max length: 5000.
* `invoice_line_items` - Credited invoice line items

# `period`

```elixir
@type period() :: %{
  optional(:end) =&gt; integer() | nil,
  optional(:start) =&gt; integer() | nil,
  optional(String.t()) =&gt; term()
}
```

* `end` - The end of the period, which must be greater than or equal to the start. This value is inclusive. Format: Unix timestamp.
* `start` - The start of the period. This value is inclusive. Format: Unix timestamp.

# `pretax_credit_amounts`

```elixir
@type pretax_credit_amounts() :: %{
  optional(:amount) =&gt; integer() | nil,
  optional(:credit_balance_transaction) =&gt;
    String.t() | Stripe.Resources.Billing.CreditBalanceTransaction.t() | nil,
  optional(:discount) =&gt; String.t() | Stripe.Resources.Discount.t() | nil,
  optional(:type) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `amount` - The amount, in cents (or local equivalent), of the pretax credit amount.
* `credit_balance_transaction` - The credit balance transaction that was applied to get this pretax credit amount. Nullable.
* `discount` - The discount that was applied to get this pretax credit amount.
* `type` - Type of the pretax credit amount referenced. Possible values: `credit_balance_transaction`, `discount`.

# `pricing`

```elixir
@type pricing() :: %{
  optional(:price_details) =&gt; pricing_price_details() | nil,
  optional(:type) =&gt; String.t() | nil,
  optional(:unit_amount_decimal) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `price_details`
* `type` - The type of the pricing details. Possible values: `price_details`.
* `unit_amount_decimal` - The unit amount (in the `currency` specified) of the item which contains a decimal value with at most 12 decimal places. Format: decimal string. Nullable.

# `pricing_price_details`

```elixir
@type pricing_price_details() :: %{
  optional(:price) =&gt; String.t() | Stripe.Resources.Price.t() | nil,
  optional(:product) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `price` - The ID of the price this item is associated with.
* `product` - The ID of the product this item is associated with. Max length: 5000.

# `t`

```elixir
@type t() :: %Stripe.Resources.InvoiceLineItem{
  amount: integer(),
  currency: String.t(),
  description: String.t(),
  discount_amounts: [discount_amounts()],
  discountable: boolean(),
  discounts: [String.t() | Stripe.Resources.Discount.t()],
  id: String.t(),
  invoice: String.t(),
  livemode: boolean(),
  metadata: %{required(String.t()) =&gt; String.t()},
  object: String.t(),
  parent: parent(),
  period: period(),
  pretax_credit_amounts: [pretax_credit_amounts()],
  pricing: pricing(),
  quantity: integer(),
  subscription: String.t() | Stripe.Resources.Subscription.t(),
  subtotal: integer(),
  taxes: [taxes()]
}
```

* `amount` - The amount, in cents (or local equivalent).
* `currency` - Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). Format: ISO 4217 currency code.
* `description` - An arbitrary string attached to the object. Often useful for displaying to users. Max length: 5000. Nullable.
* `discount_amounts` - The amount of discount calculated per discount for this line item. Nullable. Expandable.
* `discountable` - If true, discounts will apply to this line item. Always false for prorations.
* `discounts` - The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. Expandable.
* `id` - Unique identifier for the object. Max length: 5000.
* `invoice` - The ID of the invoice that contains this line item. Max length: 5000. Nullable.
* `livemode` - Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.
* `metadata` - Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation.
* `object` - String representing the object's type. Objects of the same type share the same value. Possible values: `line_item`.
* `parent` - The parent that generated this line item. Nullable. Expandable.
* `period` - Expandable.
* `pretax_credit_amounts` - Contains pretax credit amounts (ex: discount, credit grants, etc) that apply to this line item. Nullable. Expandable.
* `pricing` - The pricing information of the line item. Nullable. Expandable.
* `quantity` - The quantity of the subscription, if the line item is a subscription or a proration. Nullable.
* `subscription` - Nullable. Expandable.
* `subtotal` - The subtotal of the line item, in cents (or local equivalent), before any discounts or taxes.
* `taxes` - The tax information of the line item. Nullable. Expandable.

# `taxes`

```elixir
@type taxes() :: %{
  optional(:amount) =&gt; integer() | nil,
  optional(:tax_behavior) =&gt; String.t() | nil,
  optional(:tax_rate_details) =&gt; taxes_tax_rate_details() | nil,
  optional(:taxability_reason) =&gt; String.t() | nil,
  optional(:taxable_amount) =&gt; integer() | nil,
  optional(:type) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `amount` - The amount of the tax, in cents (or local equivalent).
* `tax_behavior` - Whether this tax is inclusive or exclusive. Possible values: `exclusive`, `inclusive`.
* `tax_rate_details` - Additional details about the tax rate. Only present when `type` is `tax_rate_details`. Nullable.
* `taxability_reason` - The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. Possible values: `customer_exempt`, `not_available`, `not_collecting`, `not_subject_to_tax`, `not_supported`, `portion_product_exempt`, `portion_reduced_rated`, `portion_standard_rated`, `product_exempt`, `product_exempt_holiday`, `proportionally_rated`, `reduced_rated`, `reverse_charge`, `standard_rated`, `taxable_basis_reduced`, `zero_rated`.
* `taxable_amount` - The amount on which tax is calculated, in cents (or local equivalent). Nullable.
* `type` - The type of tax information. Possible values: `tax_rate_details`.

# `taxes_tax_rate_details`

```elixir
@type taxes_tax_rate_details() :: %{
  optional(:tax_rate) =&gt; String.t() | nil,
  optional(String.t()) =&gt; term()
}
```

* `tax_rate` - ID of the tax rate Max length: 5000.

# `expandable_fields`

# `object_name`

---

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