Inttegro.Prices.Price (inttegro v0.2.0)

Copy Markdown View Source

Represents Price data in the Prices API.

Inttegro decodes API responses into this struct. Required fields are always present; optional fields are nil when they do not apply or were not returned. Follow the linked types in t/0 for nested domain values.

Manages reusable catalog prices.

Prices express currency and integer minor-unit amounts and can be attached to products. Use a new price when commercial terms materially change so existing orders retain their original price history.

Summary

Types

t()

The decoded price value.

Functions

Builds a Inttegro.Prices.Price and raises KeyError when a required field is missing.

Types

t()

@type t() :: %Inttegro.Prices.Price{
  currency: Inttegro.Money.Currency.t(),
  value: integer()
}

The decoded price value.

Functions

new!(attrs \\ %{})

@spec new!(map() | keyword()) :: t()

Builds a Inttegro.Prices.Price and raises KeyError when a required field is missing.