Interface MissingTaxRateForCountryError

All Superinterfaces:
ErrorObject

public interface MissingTaxRateForCountryError extends ErrorObject

Returned when the Tax Category of at least one of the lineItems, customLineItems, or shippingInfo in the Cart is missing the TaxRate matching country and state given in the shippingAddress of that Cart.

The error is returned as a failed response to:

  • Set Default Shipping Address, Add LineItem, Add CustomLineItem, Set Shipping Address, Add LineItem, Add LineItem, and Add CustomLineItem update actions
  • Create Order from Cart and Create Order in Store from Cart requests.

Example to create an instance using the builder pattern

     MissingTaxRateForCountryError missingTaxRateForCountryError = MissingTaxRateForCountryError.builder()
             .message("{message}")
             .taxCategoryId("{taxCategoryId}")
             .build()
 
  • Field Details

    • MISSING_TAX_RATE_FOR_COUNTRY

      static final String MISSING_TAX_RATE_FOR_COUNTRY
      discriminator value for MissingTaxRateForCountryError
      See Also:
  • 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()

      "Tax category $taxCategoryId is missing a tax rate for country $countriesAndStates."

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

      @NotNull @NotNull String getTaxCategoryId()

      Unique identifier of the TaxCategory.

      Returns:
      taxCategoryId
    • getCountry

      String getCountry()

      Country code of the geographic location.

      Returns:
      country
    • getState

      String getState()

      State within the country, such as Texas in the United States.

      Returns:
      state
    • setMessage

      void setMessage(String message)

      "Tax category $taxCategoryId is missing a tax rate for country $countriesAndStates."

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

      void setTaxCategoryId(String taxCategoryId)

      Unique identifier of the TaxCategory.

      Parameters:
      taxCategoryId - value to be set
    • setCountry

      void setCountry(String country)

      Country code of the geographic location.

      Parameters:
      country - value to be set
    • setState

      void setState(String state)

      State within the country, such as Texas in the United States.

      Parameters:
      state - value to be set
    • of

      factory method
      Returns:
      instance of MissingTaxRateForCountryError
    • of

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

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

      builder factory method for MissingTaxRateForCountryError
      Returns:
      builder
    • builder

      create builder for MissingTaxRateForCountryError instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMissingTaxRateForCountryError

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