Interface TaxRateDraft

All Superinterfaces:
Draft<TaxRateDraft>

public interface TaxRateDraft extends Draft<TaxRateDraft>
TaxRateDraft
Example to create an instance using the builder pattern

     TaxRateDraft taxRateDraft = TaxRateDraft.builder()
             .name("{name}")
             .includedInPrice(true)
             .country("{country}")
             .build()
 
  • Method Details

    • getName

      @NotNull @NotNull String getName()

      Name of the TaxRate.

      Returns:
      name
    • getAmount

      Double getAmount()

      Tax rate. Must be supplied if no subRates are specified. If subRates are specified, this field can be omitted or it must be the sum of amounts of all subRates.

      Returns:
      amount
    • getIncludedInPrice

      @NotNull @NotNull Boolean getIncludedInPrice()

      If true, tax is included in Embedded Prices or Standalone Prices, and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

      Returns:
      includedInPrice
    • getCountry

      @NotNull @NotNull String getCountry()

      Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.

      Returns:
      country
    • getState

      String getState()

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

      Returns:
      state
    • getSubRates

      @Valid @Valid List<SubRate> getSubRates()

      Used to calculate the taxPortions field in a Cart or Order or (Custom) Line Items. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes). The total of all subrates must equal the TaxRate amount.

      Returns:
      subRates
    • getKey

      String getKey()

      User-defined unique identifier of the TaxRate.

      Returns:
      key
    • setName

      void setName(String name)

      Name of the TaxRate.

      Parameters:
      name - value to be set
    • setAmount

      void setAmount(Double amount)

      Tax rate. Must be supplied if no subRates are specified. If subRates are specified, this field can be omitted or it must be the sum of amounts of all subRates.

      Parameters:
      amount - value to be set
    • setIncludedInPrice

      void setIncludedInPrice(Boolean includedInPrice)

      If true, tax is included in Embedded Prices or Standalone Prices, and the taxedPrice is present on LineItems. In this case, the totalNet price on TaxedPrice includes the TaxRate.

      Parameters:
      includedInPrice - value to be set
    • setCountry

      void setCountry(String country)

      Country in which the tax rate is applied in ISO 3166-1 alpha-2 format.

      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
    • setSubRates

      void setSubRates(SubRate... subRates)

      Used to calculate the taxPortions field in a Cart or Order or (Custom) Line Items. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes). The total of all subrates must equal the TaxRate amount.

      Parameters:
      subRates - values to be set
    • setSubRates

      void setSubRates(List<SubRate> subRates)

      Used to calculate the taxPortions field in a Cart or Order or (Custom) Line Items. It is useful if the total tax of a country (such as the US) is a combination of multiple taxes (such as state and local taxes). The total of all subrates must equal the TaxRate amount.

      Parameters:
      subRates - values to be set
    • setKey

      void setKey(String key)

      User-defined unique identifier of the TaxRate.

      Parameters:
      key - value to be set
    • of

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

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

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

      static TaxRateDraftBuilder builder()
      builder factory method for TaxRateDraft
      Returns:
      builder
    • builder

      static TaxRateDraftBuilder builder(TaxRateDraft template)
      create builder for TaxRateDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withTaxRateDraft

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