Class TaxRate

All Implemented Interfaces:
HasId, MetadataStore<TaxRate>, StripeActiveObject, StripeObjectInterface

public class TaxRate extends ApiResource implements HasId, MetadataStore<TaxRate>
Tax rates can be applied to invoices, subscriptions and Checkout Sessions to collect tax.

Related guide: Tax rates

  • Constructor Details

    • TaxRate

      public TaxRate()
  • Method Details

    • create

      public static TaxRate create(Map<String,Object> params) throws StripeException
      Creates a new tax rate.
      Throws:
      StripeException
    • create

      public static TaxRate create(Map<String,Object> params, RequestOptions options) throws StripeException
      Creates a new tax rate.
      Throws:
      StripeException
    • create

      public static TaxRate create(TaxRateCreateParams params) throws StripeException
      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

      public static TaxRateCollection list(Map<String,Object> params) 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
    • list

      public static TaxRateCollection list(Map<String,Object> 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
    • list

      public static TaxRateCollection list(TaxRateListParams params) 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
    • 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

      public static TaxRate retrieve(String taxRate) throws StripeException
      Retrieves a tax rate with the given ID.
      Throws:
      StripeException
    • retrieve

      public static TaxRate retrieve(String taxRate, RequestOptions options) throws StripeException
      Retrieves a tax rate with the given ID.
      Throws:
      StripeException
    • retrieve

      public static TaxRate retrieve(String taxRate, Map<String,Object> params, RequestOptions options) throws StripeException
      Retrieves 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

      public TaxRate update(Map<String,Object> params) throws StripeException
      Updates an existing tax rate.
      Specified by:
      update in interface MetadataStore<TaxRate>
      Throws:
      StripeException
    • update

      public TaxRate update(Map<String,Object> params, RequestOptions options) throws StripeException
      Updates an existing tax rate.
      Specified by:
      update in interface MetadataStore<TaxRate>
      Throws:
      StripeException
    • update

      public TaxRate update(TaxRateUpdateParams params) throws StripeException
      Updates an existing tax rate.
      Throws:
      StripeException
    • update

      public TaxRate update(TaxRateUpdateParams params, RequestOptions options) throws StripeException
      Updates an existing tax rate.
      Throws:
      StripeException
    • getActive

      public Boolean getActive()
      Defaults to true. When set to false, 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

      public String getCountry()
      Two-letter country code (ISO 3166-1 alpha-2).
    • getCreated

      public Long getCreated()
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • getDescription

      public String getDescription()
      An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
    • getDisplayName

      public String 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

      public BigDecimal 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.
    • getInclusive

      public Boolean getInclusive()
      This specifies if the tax rate is inclusive or exclusive.
    • getJurisdiction

      public String 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

      public String getJurisdictionLevel()
      The level of the jurisdiction that imposes this tax rate. Will be null for manually defined tax rates.

      One of city, country, county, district, multiple, or state.

    • getLivemode

      public Boolean getLivemode()
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • getObject

      public String getObject()
      String representing the object's type. Objects of the same type share the same value.

      Equal to tax_rate.

    • getPercentage

      public BigDecimal 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.
    • getState

      public String getState()
      ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States.
    • getTaxType

      public String getTaxType()
      The high-level tax type, such as vat or sales_tax.

      One of amusement_tax, communications_tax, gst, hst, igst, jct, lease_tax, pst, qst, rst, sales_tax, vat, or service_tax.

    • setActive

      public void setActive(Boolean active)
      Defaults to true. When set to false, 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

      public void setCountry(String country)
      Two-letter country code (ISO 3166-1 alpha-2).
    • setCreated

      public void setCreated(Long created)
      Time at which the object was created. Measured in seconds since the Unix epoch.
    • setDescription

      public void setDescription(String description)
      An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
    • setDisplayName

      public void setDisplayName(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.
    • setEffectivePercentage

      public void setEffectivePercentage(BigDecimal effectivePercentage)
      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.
    • setId

      public void setId(String id)
      Unique identifier for the object.
    • setInclusive

      public void setInclusive(Boolean inclusive)
      This specifies if the tax rate is inclusive or exclusive.
    • setJurisdiction

      public void setJurisdiction(String jurisdiction)
      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

      public void setJurisdictionLevel(String jurisdictionLevel)
      The level of the jurisdiction that imposes this tax rate. Will be null for manually defined tax rates.

      One of city, country, county, district, multiple, or state.

    • setLivemode

      public void setLivemode(Boolean livemode)
      Has the value true if the object exists in live mode or the value false if the object exists in test mode.
    • setMetadata

      public void setMetadata(Map<String,String> metadata)
      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

      public void setObject(String object)
      String representing the object's type. Objects of the same type share the same value.

      Equal to tax_rate.

    • setPercentage

      public void setPercentage(BigDecimal percentage)
      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.
    • setState

      public void setState(String state)
      ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States.
    • setTaxType

      public void setTaxType(String taxType)
      The high-level tax type, such as vat or sales_tax.

      One of amusement_tax, communications_tax, gst, hst, igst, jct, lease_tax, pst, qst, rst, sales_tax, vat, or service_tax.

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getId

      public String getId()
      Unique identifier for the object.
      Specified by:
      getId in interface HasId
    • getMetadata

      public Map<String,String> 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:
      getMetadata in interface MetadataStore<TaxRate>