Interface PriceChangedError

All Superinterfaces:
ErrorObject

public interface PriceChangedError extends ErrorObject

Returned when the Price or Tax Rate of some Line Items or Shipping Rate of some Shipping Methods changed since they were last added to the Cart.

When a Cart is frozen, the error can be returned as a failed response to all update actions on Carts and My Carts.

The error is also returned as a failed response to:

  • Create Order from Cart, Create Order in Store from Cart, and Create Order from Quote requests on Orders.
  • Create Order from Cart, Create Order in Store from Cart, and Create Order from Quote requests on My Orders.
  • Create Order from Cart in BusinessUnit request on Associate Orders.

Example to create an instance using the builder pattern

     PriceChangedError priceChangedError = PriceChangedError.builder()
             .message("{message}")
             .plusLineItems(lineItemsBuilder -> lineItemsBuilder)
             .shipping(true)
             .build()
 
  • Field Details

  • Method Details

    • getCode

      @NotNull @NotNull String getCode()
      Description copied from interface: ErrorObject

      Error identifier.

      Specified by:
      getCode in interface ErrorObject
      Returns:
      code
    • getMessage

      @NotNull @NotNull String getMessage()

      Plain text description of the reason for the Price change. For example, "The price or tax of some line items changed at the time of placing the order: $lineItems.".

      Specified by:
      getMessage in interface ErrorObject
      Returns:
      message
    • getLineItems

      @NotNull @NotNull List<String> getLineItems()

      Unique identifiers of the Line Items for which the Price or TaxRate has changed.

      Returns:
      lineItems
    • getShipping

      @NotNull @NotNull Boolean getShipping()

      true if the ShippingRate has changed.

      Returns:
      shipping
    • setMessage

      void setMessage(String message)

      Plain text description of the reason for the Price change. For example, "The price or tax of some line items changed at the time of placing the order: $lineItems.".

      Specified by:
      setMessage in interface ErrorObject
      Parameters:
      message - value to be set
    • setLineItems

      void setLineItems(String... lineItems)

      Unique identifiers of the Line Items for which the Price or TaxRate has changed.

      Parameters:
      lineItems - values to be set
    • setLineItems

      void setLineItems(List<String> lineItems)

      Unique identifiers of the Line Items for which the Price or TaxRate has changed.

      Parameters:
      lineItems - values to be set
    • setShipping

      void setShipping(Boolean shipping)

      true if the ShippingRate has changed.

      Parameters:
      shipping - value to be set
    • of

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

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

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

      static PriceChangedErrorBuilder builder()
      builder factory method for PriceChangedError
      Returns:
      builder
    • builder

      static PriceChangedErrorBuilder builder(PriceChangedError template)
      create builder for PriceChangedError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withPriceChangedError

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