Interface Price

All Superinterfaces:
Customizable<Price>, WithKey

public interface Price extends Customizable<Price>, WithKey

The representation for prices embedded in LineItems and in ProductVariants when the ProductPriceMode is Embedded. For the Standalone ProductPriceMode refer to StandalonePrice.


Example to create an instance using the builder pattern

     Price price = Price.builder()
             .id("{id}")
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Method Details

    • getId

      @NotNull @NotNull String getId()

      Unique identifier of this Price.

      Returns:
      id
    • getKey

      String getKey()

      User-defined identifier of the Price. It is unique per ProductVariant.

      Specified by:
      getKey in interface WithKey
      Returns:
      key
    • getValue

      @NotNull @Valid @NotNull @Valid TypedMoney getValue()

      Money value of this Price.

      Returns:
      value
    • getCountry

      String getCountry()

      Country for which this Price is valid.

      Returns:
      country
    • getCustomerGroup

      @Valid @Valid CustomerGroupReference getCustomerGroup()

      CustomerGroup for which this Price is valid.

      Returns:
      customerGroup
    • getChannel

      @Valid @Valid ChannelReference getChannel()

      ProductDistribution Channel for which this Price is valid.

      Returns:
      channel
    • getValidFrom

      ZonedDateTime getValidFrom()

      Date and time from which this Price is valid.

      Returns:
      validFrom
    • getValidUntil

      ZonedDateTime getValidUntil()

      Date and time until this Price is valid. Prices that are no longer valid are not automatically removed, but they can be removed if necessary.

      Returns:
      validUntil
    • getDiscounted

      @Valid @Valid DiscountedPrice getDiscounted()

      Is set if a ProductDiscount has been applied. If set, the API uses the DiscountedPrice value for the Line Item price selection. When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half-down rounding.

      Returns:
      discounted
    • getTiers

      @Valid @Valid List<PriceTier> getTiers()

      Present if different Prices for certain LineItem quantities have been specified.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Returns:
      tiers
    • getCustom

      @Valid @Valid CustomFields getCustom()

      Custom Fields defined for the Price.

      Specified by:
      getCustom in interface Customizable<Price>
      Returns:
      custom
    • setId

      void setId(String id)

      Unique identifier of this Price.

      Parameters:
      id - value to be set
    • setKey

      void setKey(String key)

      User-defined identifier of the Price. It is unique per ProductVariant.

      Parameters:
      key - value to be set
    • setValue

      void setValue(TypedMoney value)

      Money value of this Price.

      Parameters:
      value - value to be set
    • setCountry

      void setCountry(String country)

      Country for which this Price is valid.

      Parameters:
      country - value to be set
    • setCustomerGroup

      void setCustomerGroup(CustomerGroupReference customerGroup)

      CustomerGroup for which this Price is valid.

      Parameters:
      customerGroup - value to be set
    • setChannel

      void setChannel(ChannelReference channel)

      ProductDistribution Channel for which this Price is valid.

      Parameters:
      channel - value to be set
    • setValidFrom

      void setValidFrom(ZonedDateTime validFrom)

      Date and time from which this Price is valid.

      Parameters:
      validFrom - value to be set
    • setValidUntil

      void setValidUntil(ZonedDateTime validUntil)

      Date and time until this Price is valid. Prices that are no longer valid are not automatically removed, but they can be removed if necessary.

      Parameters:
      validUntil - value to be set
    • setDiscounted

      void setDiscounted(DiscountedPrice discounted)

      Is set if a ProductDiscount has been applied. If set, the API uses the DiscountedPrice value for the Line Item price selection. When a relative discount has been applied and the fraction part of the DiscountedPrice value is 0.5, the value is rounded in favor of the customer with half-down rounding.

      Parameters:
      discounted - value to be set
    • setTiers

      void setTiers(PriceTier... tiers)

      Present if different Prices for certain LineItem quantities have been specified.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      tiers - values to be set
    • setTiers

      void setTiers(List<PriceTier> tiers)

      Present if different Prices for certain LineItem quantities have been specified.

      If discounted is present, the tiered Price is ignored for a Product Variant.

      Parameters:
      tiers - values to be set
    • setCustom

      void setCustom(CustomFields custom)

      Custom Fields defined for the Price.

      Specified by:
      setCustom in interface Customizable<Price>
      Parameters:
      custom - value to be set
    • of

      static Price of()
      factory method
      Returns:
      instance of Price
    • of

      static Price of(Price template)
      factory method to create a shallow copy Price
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      @Nullable static Price deepCopy(@Nullable Price template)
      factory method to create a deep copy of Price
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static PriceBuilder builder()
      builder factory method for Price
      Returns:
      builder
    • builder

      static PriceBuilder builder(Price template)
      create builder for Price instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withPrice

      default <T> T withPrice(Function<Price,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<Price> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference