Package com.stripe.model
Class TaxRate
java.lang.Object
com.stripe.model.StripeObject
com.stripe.net.ApiResource
com.stripe.model.TaxRate
- All Implemented Interfaces:
HasId,MetadataStore<TaxRate>,StripeActiveObject,StripeObjectInterface
Tax rates can be applied to invoices,
subscriptions and Checkout Sessions to collect
tax.
Related guide: Tax rates
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe amount of the tax rate when therate_type`` isflat_amount. Tax rates withrate_typepercentagecan vary based on the transaction, resulting in this field beingnull`.Nested classes/interfaces inherited from class com.stripe.net.ApiResource
ApiResource.RequestMethod -
Field Summary
Fields inherited from class com.stripe.net.ApiResource
CHARSET, GSON, INTERNAL_GSONFields inherited from class com.stripe.model.StripeObject
PRETTY_PRINT_GSON -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic TaxRatecreate(TaxRateCreateParams params) Creates a new tax rate.static TaxRatecreate(TaxRateCreateParams params, RequestOptions options) Creates a new tax rate.static TaxRateCreates a new tax rate.static TaxRatecreate(Map<String, Object> params, RequestOptions options) Creates a new tax rate.booleanDefaults totrue.Two-letter country code (ISO 3166-1 alpha-2).Time at which the object was created.An arbitrary string attached to the tax rate for your internal use only.The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.Actual/effective tax rate percentage out of 100.The amount of the tax rate when therate_typeisflat_amount.getId()Unique identifier for the object.This specifies if the tax rate is inclusive or exclusive.The jurisdiction for the tax rate.The level of the jurisdiction that imposes this tax rate.Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.Set of key-value pairs that you can attach to an object.String representing the object's type.Tax rate percentage out of 100.Indicates the type of tax rate applied to the taxable amount.getState()ISO 3166-2 subdivision code, without country prefix.The high-level tax type, such asvatorsales_tax.inthashCode()static TaxRateCollectionlist(TaxRateListParams params) Returns a list of your tax rates.static TaxRateCollectionlist(TaxRateListParams params, RequestOptions options) Returns a list of your tax rates.static TaxRateCollectionReturns a list of your tax rates.static TaxRateCollectionlist(Map<String, Object> params, RequestOptions options) Returns a list of your tax rates.static TaxRateRetrieves a tax rate with the given ID.static TaxRateretrieve(String taxRate, RequestOptions options) Retrieves a tax rate with the given ID.static TaxRateretrieve(String taxRate, TaxRateRetrieveParams params, RequestOptions options) Retrieves a tax rate with the given ID.static TaxRateRetrieves a tax rate with the given ID.voidDefaults totrue.voidsetCountry(String country) Two-letter country code (ISO 3166-1 alpha-2).voidsetCreated(Long created) Time at which the object was created.voidsetDescription(String description) An arbitrary string attached to the tax rate for your internal use only.voidsetDisplayName(String displayName) The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.voidsetEffectivePercentage(BigDecimal effectivePercentage) Actual/effective tax rate percentage out of 100.voidsetFlatAmount(TaxRate.FlatAmount flatAmount) The amount of the tax rate when therate_typeisflat_amount.voidUnique identifier for the object.voidsetInclusive(Boolean inclusive) This specifies if the tax rate is inclusive or exclusive.voidsetJurisdiction(String jurisdiction) The jurisdiction for the tax rate.voidsetJurisdictionLevel(String jurisdictionLevel) The level of the jurisdiction that imposes this tax rate.voidsetLivemode(Boolean livemode) Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode.voidsetMetadata(Map<String, String> metadata) Set of key-value pairs that you can attach to an object.voidString representing the object's type.voidsetPercentage(BigDecimal percentage) Tax rate percentage out of 100.voidsetRateType(String rateType) Indicates the type of tax rate applied to the taxable amount.voidsetResponseGetter(StripeResponseGetter responseGetter) Method is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.voidISO 3166-2 subdivision code, without country prefix.voidsetTaxType(String taxType) The high-level tax type, such asvatorsales_tax.update(TaxRateUpdateParams params) Updates an existing tax rate.update(TaxRateUpdateParams params, RequestOptions options) Updates an existing tax rate.Updates an existing tax rate.update(Map<String, Object> params, RequestOptions options) Updates an existing tax rate.Methods inherited from class com.stripe.net.ApiResource
checkNullTypedParams, getGlobalResponseGetter, getResponseGetter, setExpandableFieldId, setGlobalResponseGetter, urlEncode, urlEncodeIdMethods inherited from class com.stripe.model.StripeObject
deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, deserializeStripeObject, equals, getLastResponse, getRawJsonObject, setLastResponse, toJson, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.stripe.model.StripeActiveObject
trySetResponseGetter
-
Constructor Details
-
TaxRate
public TaxRate()
-
-
Method Details
-
create
Creates a new tax rate.- Throws:
StripeException
-
create
public static TaxRate create(Map<String, Object> params, RequestOptions options) throws StripeExceptionCreates a new tax rate.- Throws:
StripeException
-
create
Creates a new tax rate.- Throws:
StripeException
-
create
public static TaxRate create(TaxRateCreateParams params, RequestOptions options) throws StripeException Creates a new tax rate.- Throws:
StripeException
-
list
Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.- Throws:
StripeException
-
list
public static TaxRateCollection list(Map<String, Object> params, RequestOptions options) throws StripeExceptionReturns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.- Throws:
StripeException
-
list
Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.- Throws:
StripeException
-
list
public static TaxRateCollection list(TaxRateListParams params, RequestOptions options) throws StripeException Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.- Throws:
StripeException
-
retrieve
Retrieves a tax rate with the given ID.- Throws:
StripeException
-
retrieve
Retrieves a tax rate with the given ID.- Throws:
StripeException
-
retrieve
public static TaxRate retrieve(String taxRate, Map<String, Object> params, RequestOptions options) throws StripeExceptionRetrieves a tax rate with the given ID.- Throws:
StripeException
-
retrieve
public static TaxRate retrieve(String taxRate, TaxRateRetrieveParams params, RequestOptions options) throws StripeException Retrieves a tax rate with the given ID.- Throws:
StripeException
-
update
Updates an existing tax rate.- Specified by:
updatein interfaceMetadataStore<TaxRate>- Throws:
StripeException
-
update
Updates an existing tax rate.- Specified by:
updatein interfaceMetadataStore<TaxRate>- Throws:
StripeException
-
update
Updates an existing tax rate.- Throws:
StripeException
-
update
Updates an existing tax rate.- Throws:
StripeException
-
setResponseGetter
Description copied from interface:StripeActiveObjectMethod is used by the containing object orStripeResponseGetterimplementations to set theStripeResponseGetterinstance used to make further requests.- Specified by:
setResponseGetterin interfaceStripeActiveObject- Overrides:
setResponseGetterin classApiResource- Parameters:
responseGetter- theStripeResponseGetterinstance to use for making further requests.
-
getActive
Defaults totrue. When set tofalse, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. -
getCountry
Two-letter country code (ISO 3166-1 alpha-2). -
getCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
getDescription
An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. -
getDisplayName
The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. -
getEffectivePercentage
Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction. -
getFlatAmount
The amount of the tax rate when therate_typeisflat_amount. Tax rates withrate_typepercentagecan vary based on the transaction, resulting in this field beingnull. This field exposes the amount and currency of the flat tax rate. -
getInclusive
This specifies if the tax rate is inclusive or exclusive. -
getJurisdiction
The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. -
getJurisdictionLevel
The level of the jurisdiction that imposes this tax rate. Will benullfor manually defined tax rates.One of
city,country,county,district,multiple, orstate. -
getLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
getObject
String representing the object's type. Objects of the same type share the same value.Equal to
tax_rate. -
getPercentage
Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. -
getRateType
Indicates the type of tax rate applied to the taxable amount. This value can benullwhen no tax applies to the location. This field is only present for TaxRates created by Stripe Tax.One of
flat_amount, orpercentage. -
getState
ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. -
getTaxType
The high-level tax type, such asvatorsales_tax.One of
amusement_tax,communications_tax,gst,hst,igst,jct,lease_tax,pst,qst,retail_delivery_fee,rst,sales_tax,service_tax, orvat. -
setActive
Defaults totrue. When set tofalse, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. -
setCountry
Two-letter country code (ISO 3166-1 alpha-2). -
setCreated
Time at which the object was created. Measured in seconds since the Unix epoch. -
setDescription
An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. -
setDisplayName
The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. -
setEffectivePercentage
Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction. -
setFlatAmount
The amount of the tax rate when therate_typeisflat_amount. Tax rates withrate_typepercentagecan vary based on the transaction, resulting in this field beingnull. This field exposes the amount and currency of the flat tax rate. -
setId
Unique identifier for the object. -
setInclusive
This specifies if the tax rate is inclusive or exclusive. -
setJurisdiction
The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. -
setJurisdictionLevel
The level of the jurisdiction that imposes this tax rate. Will benullfor manually defined tax rates.One of
city,country,county,district,multiple, orstate. -
setLivemode
Has the valuetrueif the object exists in live mode or the valuefalseif the object exists in test mode. -
setMetadata
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. -
setObject
String representing the object's type. Objects of the same type share the same value.Equal to
tax_rate. -
setPercentage
Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. -
setRateType
Indicates the type of tax rate applied to the taxable amount. This value can benullwhen no tax applies to the location. This field is only present for TaxRates created by Stripe Tax.One of
flat_amount, orpercentage. -
setState
ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. -
setTaxType
The high-level tax type, such asvatorsales_tax.One of
amusement_tax,communications_tax,gst,hst,igst,jct,lease_tax,pst,qst,retail_delivery_fee,rst,sales_tax,service_tax, orvat. -
equals
-
canEqual
-
hashCode
public int hashCode() -
getId
Unique identifier for the object. -
getMetadata
Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.- Specified by:
getMetadatain interfaceMetadataStore<TaxRate>
-