Interface ExternalTaxRateDraft
- All Superinterfaces:
Draft<ExternalTaxRateDraft>
Controls calculation of taxed prices for Line Items, Custom Line Items, and Shipping Methods as explained in Cart tax calculation.
Example to create an instance using the builder pattern
ExternalTaxRateDraft externalTaxRateDraft = ExternalTaxRateDraft.builder()
.name("{name}")
.country("{country}")
.build()
-
Method Summary
Modifier and TypeMethodDescriptionstatic ExternalTaxRateDraftBuilder
builder()
builder factory method for ExternalTaxRateDraftstatic ExternalTaxRateDraftBuilder
builder
(ExternalTaxRateDraft template) create builder for ExternalTaxRateDraft instancestatic ExternalTaxRateDraft
deepCopy
(ExternalTaxRateDraft template) factory method to create a deep copy of ExternalTaxRateDraftPercentage in the range of 0-1.@NotNull String
Country for which the tax applies.If set tofalse
, the related price is considered the net price and the providedamount
is applied to calculate the gross price. If set totrue
, the related price is considered the gross price, and the providedamount
is applied to calculate the net price.@NotNull String
getName()
Name of the Tax Rate.getState()
State within the specified country.Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).static ExternalTaxRateDraft
of()
factory methodstatic ExternalTaxRateDraft
of
(ExternalTaxRateDraft template) factory method to create a shallow copy ExternalTaxRateDraftvoid
Percentage in the range of 0-1.void
setCountry
(String country) Country for which the tax applies.void
setIncludedInPrice
(Boolean includedInPrice) If set tofalse
, the related price is considered the net price and the providedamount
is applied to calculate the gross price. If set totrue
, the related price is considered the gross price, and the providedamount
is applied to calculate the net price.void
Name of the Tax Rate.void
State within the specified country.void
setSubRates
(SubRate... subRates) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).void
setSubRates
(List<SubRate> subRates) Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes).static com.fasterxml.jackson.core.type.TypeReference<ExternalTaxRateDraft>
gives a TypeReference for usage with Jackson DataBinddefault <T> T
withExternalTaxRateDraft
(Function<ExternalTaxRateDraft, T> helper) accessor map function
-
Method Details
-
getName
Name of the Tax Rate.
- Returns:
- name
-
getAmount
Double getAmount()Percentage in the range of 0-1.
- If no
subRates
are specified, a value must be defined. - If
subRates
are specified, this can be omitted or its value must be the sum of allsubRates
amounts.
- Returns:
- amount
- If no
-
getIncludedInPrice
Boolean getIncludedInPrice()- If set to
false
, the related price is considered the net price and the providedamount
is applied to calculate the gross price. - If set to
true
, the related price is considered the gross price, and the providedamount
is applied to calculate the net price.
- Returns:
- includedInPrice
- If set to
-
getCountry
Country for which the tax applies.
- Returns:
- country
-
getState
String getState()State within the specified country.
- Returns:
- state
-
getSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Returns:
- subRates
-
setName
Name of the Tax Rate.
- Parameters:
name
- value to be set
-
setAmount
Percentage in the range of 0-1.
- If no
subRates
are specified, a value must be defined. - If
subRates
are specified, this can be omitted or its value must be the sum of allsubRates
amounts.
- Parameters:
amount
- value to be set
- If no
-
setIncludedInPrice
- If set to
false
, the related price is considered the net price and the providedamount
is applied to calculate the gross price. - If set to
true
, the related price is considered the gross price, and the providedamount
is applied to calculate the net price.
- Parameters:
includedInPrice
- value to be set
- If set to
-
setCountry
Country for which the tax applies.
- Parameters:
country
- value to be set
-
setState
State within the specified country.
- Parameters:
state
- value to be set
-
setSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
subRates
- values to be set
-
setSubRates
Used when the total tax is a combination of multiple taxes (for example, local, state/provincial, and/or federal taxes). The total of all subrates must equal the TaxRate
amount
. These subrates are used to calculate thetaxPortions
field of a Cart or Order and thetaxedPrice
field of LineItems, CustomLineItems, and ShippingInfos.- Parameters:
subRates
- values to be set
-
of
factory method- Returns:
- instance of ExternalTaxRateDraft
-
of
factory method to create a shallow copy ExternalTaxRateDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
deepCopy
factory method to create a deep copy of ExternalTaxRateDraft- Parameters:
template
- instance to be copied- Returns:
- copy instance
-
builder
builder factory method for ExternalTaxRateDraft- Returns:
- builder
-
builder
create builder for ExternalTaxRateDraft instance- Parameters:
template
- instance with prefilled values for the builder- Returns:
- builder
-
withExternalTaxRateDraft
accessor map function- Type Parameters:
T
- mapped type- Parameters:
helper
- function to map the object- Returns:
- mapped value
-
typeReference
gives a TypeReference for usage with Jackson DataBind- Returns:
- TypeReference
-