Packages
Complete Stripe SDK for Elixir with parity to the official Ruby SDK. V1+V2 coverage (193 services, 320 resource structs, 525 documented params). Per-event modules, Finch HTTP/2, RustyJSON, automatic retries, OAuth, webhooks, telemetry, per-client config, streaming pagination.
Current section
Files
Jump to
Current section
Files
lib/stripe/params/invoice_item_update_params.ex
# File generated from our OpenAPI spec
defmodule Stripe.Params.InvoiceItemUpdateParams do
@moduledoc "Parameters for invoice item update."
@typedoc """
* `amount` - The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount.
* `description` - An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. Max length: 5000.
* `discountable` - Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations.
* `discounts` - The coupons, promotion codes & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts.
* `expand` - Specifies which fields in the response should be expanded.
* `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. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`.
* `period` - The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://docs.stripe.com/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://docs.stripe.com/revenue-recognition/methodology/subscriptions-and-invoicing) for details.
* `price_data` - Data used to generate a new [Price](https://docs.stripe.com/api/prices) object inline.
* `pricing` - The pricing information for the invoice item.
* `quantity` - Non-negative integer. The quantity of units for the invoice item.
* `tax_behavior` - Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. Possible values: `exclusive`, `inclusive`, `unspecified`.
* `tax_code` - A [tax code](https://docs.stripe.com/tax/tax-categories) ID.
* `tax_rates` - The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates.
* `unit_amount_decimal` - The decimal unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount_decimal` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount_decimal` will reduce the `amount_due` on the invoice. Accepts at most 12 decimal places. Format: decimal string.
"""
@type t :: %__MODULE__{
amount: integer() | nil,
description: String.t() | nil,
discountable: boolean() | nil,
discounts: map() | nil,
expand: [String.t()] | nil,
metadata: map() | nil,
period: __MODULE__.Period.t() | nil,
price_data: __MODULE__.PriceData.t() | nil,
pricing: __MODULE__.Pricing.t() | nil,
quantity: integer() | nil,
tax_behavior: String.t() | nil,
tax_code: map() | nil,
tax_rates: map() | nil,
unit_amount_decimal: String.t() | nil
}
defstruct [
:amount,
:description,
:discountable,
:discounts,
:expand,
:metadata,
:period,
:price_data,
:pricing,
:quantity,
:tax_behavior,
:tax_code,
:tax_rates,
:unit_amount_decimal
]
defmodule Period do
@moduledoc "Nested parameters."
@typedoc """
* `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.
"""
@type t :: %__MODULE__{
end: integer() | nil,
start: integer() | nil
}
defstruct [:end, :start]
end
defmodule PriceData do
@moduledoc "Nested parameters."
@typedoc """
* `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.
* `product` - The ID of the [Product](https://docs.stripe.com/api/products) that this [Price](https://docs.stripe.com/api/prices) will belong to. Max length: 5000.
* `tax_behavior` - Only required if a [default tax behavior](https://docs.stripe.com/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. Possible values: `exclusive`, `inclusive`, `unspecified`.
* `unit_amount` - A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge.
* `unit_amount_decimal` - Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. Format: decimal string.
"""
@type t :: %__MODULE__{
currency: String.t() | nil,
product: String.t() | nil,
tax_behavior: String.t() | nil,
unit_amount: integer() | nil,
unit_amount_decimal: String.t() | nil
}
defstruct [:currency, :product, :tax_behavior, :unit_amount, :unit_amount_decimal]
end
defmodule Pricing do
@moduledoc "Nested parameters."
@typedoc """
* `price` - The ID of the price object. Max length: 5000.
"""
@type t :: %__MODULE__{
price: String.t() | nil
}
defstruct [:price]
end
end