View Source ExOAPI.Stripe.Schemas.Invoiceitem (exoapi_stripe v0.1.4)

description: Sometimes you want to add a charge or credit to a customer, but actually charge or credit the customer's card only at the end of a regular billing cycle. This is useful for combining several charges (to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals.

Related guide: Subscription Invoices.

:amount :: :integer

Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity.

:currency :: :string

Three-letter ISO currency code, in lowercase. Must be a supported currency.

:customer :: ExOAPI.Stripe.Schemas.DeletedCustomer | ExOAPI.Stripe.Schemas.Customer | :string

The ID of the customer who will be billed when this invoice item is billed.

:date :: :integer

Time at which the object was created. Measured in seconds since the Unix epoch.

:description :: :string

An arbitrary string attached to the object. Often useful for displaying to users.

:discountable :: :boolean

If true, discounts will apply to this invoice item. Always false for prorations.

::discounts :: ExOAPI.Stripe.Schemas.Discount | :string

:id :: :string

Unique identifier for the object.

:invoice :: ExOAPI.Stripe.Schemas.Invoice | :string

The ID of the invoice this invoice item belongs to.

:livemode :: :boolean

Has the value true if the object exists in live mode or the value false if the object exists in test mode.

:metadata :: :map

Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.

:object :: :string

String representing the object's type. Objects of the same type share the same value.

:period :: ExOAPI.Stripe.Schemas.InvoiceLineItemPeriod

:price :: ExOAPI.Stripe.Schemas.Price

The price of the invoice item.

:proration :: :boolean

Whether the invoice item was created automatically as a proration adjustment when the customer switched plans.

:quantity :: :integer

Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for.

:subscription :: ExOAPI.Stripe.Schemas.Subscription | :string

The subscription that this invoice item has been created for, if any.

:subscription_item :: ExOAPI.Stripe.Schemas.SubscriptionItem

The subscription item that this invoice item has been created for, if any.

::tax_rates :: ExOAPI.Stripe.Schemas.TaxRate

:test_clock :: ExOAPI.Stripe.Schemas.TestHelpers_testClock | :string

ID of the test clock this invoice item belongs to.

:unit_amount :: :integer

Unit amount (in the currency specified) of the invoice item.

:unit_amount_decimal :: :string

Same as unit_amount, but contains a decimal value with at most 12 decimal places.

Link to this section Summary

Link to this section Types

@type params() :: map()
@type t() :: %ExOAPI.Stripe.Schemas.Invoiceitem{
  amount: integer() | nil,
  currency: String.t() | nil,
  customer: ExOAPI.EctoTypes.AnyOf.t() | nil,
  date: integer() | nil,
  description: String.t() | nil,
  discountable: boolean() | nil,
  discounts: [ExOAPI.EctoTypes.AnyOf.t()] | nil,
  id: String.t() | nil,
  invoice: ExOAPI.EctoTypes.AnyOf.t() | nil,
  livemode: boolean() | nil,
  metadata: map() | nil,
  object: :invoiceitem | nil,
  period: ExOAPI.Stripe.Schemas.InvoiceLineItemPeriod.t() | nil,
  price: ExOAPI.EctoTypes.AnyOf.t() | nil,
  proration: boolean() | nil,
  quantity: integer() | nil,
  subscription: ExOAPI.EctoTypes.AnyOf.t() | nil,
  subscription_item: String.t() | nil,
  tax_rates: [ExOAPI.Stripe.Schemas.TaxRate.t()],
  test_clock: ExOAPI.EctoTypes.AnyOf.t() | nil,
  unit_amount: integer() | nil,
  unit_amount_decimal: String.t() | nil
}

Link to this section Functions

Link to this function

changeset(struct \\ %__MODULE__{}, params)

View Source
@spec changeset(t(), params()) :: Ecto.Changeset.t()