Interface OutOfStockError

All Superinterfaces:
ErrorObject

public interface OutOfStockError extends ErrorObject

Returned when some of the Line Items are out of stock at the time of placing an Order.

The error is returned as a failed response to:

  • Create Order from Cart, Create Order in Store from Cart, and Create Order by Import requests on Orders.
  • Create Order from Cart and Create Order in Store from Cart requests on My Orders.

Example to create an instance using the builder pattern

     OutOfStockError outOfStockError = OutOfStockError.builder()
             .message("{message}")
             .plusLineItems(lineItemsBuilder -> lineItemsBuilder)
             .plusSkus(skusBuilder -> skusBuilder)
             .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()

      "Some line items are out of stock at the time of placing the order: $itemSku."

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

      @NotNull @NotNull List<String> getLineItems()

      Unique identifiers of the Line Items that are out of stock.

      Returns:
      lineItems
    • getSkus

      @NotNull @NotNull List<String> getSkus()

      SKUs of the Line Items that are out of stock.

      Returns:
      skus
    • setMessage

      void setMessage(String message)

      "Some line items are out of stock at the time of placing the order: $itemSku."

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

      void setLineItems(String... lineItems)

      Unique identifiers of the Line Items that are out of stock.

      Parameters:
      lineItems - values to be set
    • setLineItems

      void setLineItems(List<String> lineItems)

      Unique identifiers of the Line Items that are out of stock.

      Parameters:
      lineItems - values to be set
    • setSkus

      void setSkus(String... skus)

      SKUs of the Line Items that are out of stock.

      Parameters:
      skus - values to be set
    • setSkus

      void setSkus(List<String> skus)

      SKUs of the Line Items that are out of stock.

      Parameters:
      skus - values to be set
    • of

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

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

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

      static OutOfStockErrorBuilder builder()
      builder factory method for OutOfStockError
      Returns:
      builder
    • builder

      static OutOfStockErrorBuilder builder(OutOfStockError template)
      create builder for OutOfStockError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withOutOfStockError

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