Interface TaxMode

All Superinterfaces:
JsonEnum
All Known Implementing Classes:
TaxMode.TaxModeEnum

public interface TaxMode extends JsonEnum

Indicates how taxes are set on the Cart.

  • Field Details

    • PLATFORM

      static final TaxMode PLATFORM
      • Tax Rates are selected automatically from the TaxCategories based on the Cart shippingAddress. This is the default tax mode for a new Cart.

      • The totalNet, totalGross, and taxPortions fields are calculated based on the taxRoundingMode.

    • EXTERNAL

      static final TaxMode EXTERNAL
      • Tax Rates are set externally with ExternalTaxRateDraft. A Cart can be ordered only if all Line Items, Custom Line Items, and the Shipping Method have an external Tax Rate set.

      • The totalNet, totalGross, and taxPortions fields are calculated based on the taxRoundingMode.

    • EXTERNAL_AMOUNT

      static final TaxMode EXTERNAL_AMOUNT
      • Tax amounts, Tax Rates, and tax portions are set externally with ExternalTaxAmountDraft. A Cart can be ordered only if the Cart and all Line Items, Custom Line Items, and the Shipping Method have an external tax amount and rate set.

      • The Cart taxedPrice field must be set using Set Cart Total Tax. The Cart taxedShippingPrice field is always empty in this tax mode.

      • Price-affecting update actions on Carts require external recalculation of the total gross price. In these cases, taxedPrice and taxRate are removed and must be set again. The order in which the individual update actions are issued is important:

        1. Issue the price-affecting update action(s).

        2. Update the tax amounts using Set LineItem TaxAmount, Set CustomLineItem TaxAmount, or Set ShippingMethod TaxAmount.

          • If the update action changes the Line Item price, for Line Items with Platform LineItemPriceMode, you must issue Set LineItem TaxAmount in a separate request.

          • If the update action removes the externally set tax amount for the Shipping Method, you must issue Set ShippingMethod TaxAmount in a separate request.

        3. Update the taxedPrice on Cart using Set Cart Total Tax.

      • Tax-inclusive pricing should be avoided when using TaxMode ExternalAmount because taxedItemPrice.totalNet is automatically set by the platform to the Line Item's totalPrice.

    • DISABLED

      static final TaxMode DISABLED
      • No taxes are added to the Cart.
      • This tax mode cannot be set on the My Carts API.
  • Method Details

    • getJsonName

      String getJsonName()
      the JSON value
      Specified by:
      getJsonName in interface JsonEnum
      Returns:
      json value
    • name

      String name()
      the enum value
      Specified by:
      name in interface JsonEnum
      Returns:
      name
    • toString

      String toString()
      convert value to string
      Specified by:
      toString in interface JsonEnum
      Overrides:
      toString in class Object
      Returns:
      string representation
    • findEnum

      static TaxMode findEnum(String value)
      factory method for a enum value of TaxMode if no enum has been found an anonymous instance will be created
      Parameters:
      value - the enum value to be wrapped
      Returns:
      enum instance
    • findEnumViaJsonName

      static Optional<TaxMode> findEnumViaJsonName(String jsonName)
      method to find enum using the JSON value
      Parameters:
      jsonName - the json value to be wrapped
      Returns:
      optional of enum instance
    • values

      static TaxMode[] values()
      possible enum values
      Returns:
      array of possible enum values