Interface StandalonePriceDraft

All Superinterfaces:
CustomizableDraft<StandalonePriceDraft>, Draft<StandalonePriceDraft>, WithKey

public interface StandalonePriceDraft extends CustomizableDraft<StandalonePriceDraft>, WithKey, Draft<StandalonePriceDraft>
StandalonePriceDraft
Example to create an instance using the builder pattern

     StandalonePriceDraft standalonePriceDraft = StandalonePriceDraft.builder()
             .sku("{sku}")
             .value(valueBuilder -> valueBuilder)
             .build()
 
  • Method Details

    • getKey

      String getKey()

      User-defined unique identifier for the StandalonePrice.

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

      @NotNull @NotNull String getSku()

      Specifies to which ProductVariant the API associates this Price. It is not validated to exist in product variants.

      Returns:
      sku
    • getValue

      @NotNull @Valid @NotNull @Valid Money getValue()

      Sets the money value of this Price.

      To set the money value in high precision, use HighPrecisionMoneyDraft.

      Returns:
      value
    • getCountry

      String getCountry()

      Sets the country for which this Price is valid.

      Returns:
      country
    • getCustomerGroup

      @Valid @Valid CustomerGroupResourceIdentifier getCustomerGroup()

      Sets the CustomerGroup for which this Price is valid.

      Returns:
      customerGroup
    • getChannel

      @Valid @Valid ChannelResourceIdentifier getChannel()

      Sets the product distribution Channel for which this Price is valid.

      Returns:
      channel
    • getValidFrom

      ZonedDateTime getValidFrom()

      Sets the date from which the Price is valid. Must be at least 1 ms earlier than validUntil.

      Returns:
      validFrom
    • getValidUntil

      ZonedDateTime getValidUntil()

      Sets the date until the Price is valid. Must be at least 1 ms later than validFrom. Standalone Prices that are no longer valid are not automatically deleted, but they can be deleted if necessary.

      Returns:
      validUntil
    • getTiers

      @Valid @Valid List<PriceTierDraft> getTiers()

      Sets price tiers.

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

      Returns:
      tiers
    • getDiscounted

      @Valid @Valid DiscountedPriceDraft getDiscounted()

      Sets a discounted price for this Price that is different from the base price with value.

      Returns:
      discounted
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields for the StandalonePrice.

      Specified by:
      getCustom in interface CustomizableDraft<StandalonePriceDraft>
      Returns:
      custom
    • getStaged

      @Valid @Valid StagedPriceDraft getStaged()

      Staged changes for the StandalonePrice.

      Returns:
      staged
    • getActive

      Boolean getActive()

      Set to false, if the StandalonePrice should not be considered during Product price selection.

      Returns:
      active
    • setKey

      void setKey(String key)

      User-defined unique identifier for the StandalonePrice.

      Parameters:
      key - value to be set
    • setSku

      void setSku(String sku)

      Specifies to which ProductVariant the API associates this Price. It is not validated to exist in product variants.

      Parameters:
      sku - value to be set
    • setValue

      void setValue(Money value)

      Sets the money value of this Price.

      To set the money value in high precision, use HighPrecisionMoneyDraft.

      Parameters:
      value - value to be set
    • setCountry

      void setCountry(String country)

      Sets the country for which this Price is valid.

      Parameters:
      country - value to be set
    • setCustomerGroup

      void setCustomerGroup(CustomerGroupResourceIdentifier customerGroup)

      Sets the CustomerGroup for which this Price is valid.

      Parameters:
      customerGroup - value to be set
    • setChannel

      void setChannel(ChannelResourceIdentifier channel)

      Sets the product distribution Channel for which this Price is valid.

      Parameters:
      channel - value to be set
    • setValidFrom

      void setValidFrom(ZonedDateTime validFrom)

      Sets the date from which the Price is valid. Must be at least 1 ms earlier than validUntil.

      Parameters:
      validFrom - value to be set
    • setValidUntil

      void setValidUntil(ZonedDateTime validUntil)

      Sets the date until the Price is valid. Must be at least 1 ms later than validFrom. Standalone Prices that are no longer valid are not automatically deleted, but they can be deleted if necessary.

      Parameters:
      validUntil - value to be set
    • setTiers

      void setTiers(PriceTierDraft... tiers)

      Sets price tiers.

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

      Parameters:
      tiers - values to be set
    • setTiers

      void setTiers(List<PriceTierDraft> tiers)

      Sets price tiers.

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

      Parameters:
      tiers - values to be set
    • setDiscounted

      void setDiscounted(DiscountedPriceDraft discounted)

      Sets a discounted price for this Price that is different from the base price with value.

      Parameters:
      discounted - value to be set
    • setCustom

      void setCustom(CustomFieldsDraft custom)

      Custom Fields for the StandalonePrice.

      Specified by:
      setCustom in interface CustomizableDraft<StandalonePriceDraft>
      Parameters:
      custom - value to be set
    • setStaged

      void setStaged(StagedPriceDraft staged)

      Staged changes for the StandalonePrice.

      Parameters:
      staged - value to be set
    • setActive

      void setActive(Boolean active)

      Set to false, if the StandalonePrice should not be considered during Product price selection.

      Parameters:
      active - value to be set
    • of

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

      factory method to create a shallow copy StandalonePriceDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • deepCopy

      factory method to create a deep copy of StandalonePriceDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static StandalonePriceDraftBuilder builder()
      builder factory method for StandalonePriceDraft
      Returns:
      builder
    • builder

      create builder for StandalonePriceDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withStandalonePriceDraft

      default <T> T withStandalonePriceDraft(Function<StandalonePriceDraft,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<StandalonePriceDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference