View Source Stripe.TaxRate (stripity_stripe v3.1.1)

Tax rates can be applied to invoices, subscriptions and Checkout Sessions to collect tax.

Related guide: Tax rates

Link to this section Summary

Types

t()

The tax_rate type.

Functions

Creates a new tax rate.

Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.

Retrieves a tax rate with the given ID

Updates an existing tax rate.

Link to this section Types

@type created() :: %{
  optional(:gt) => integer(),
  optional(:gte) => integer(),
  optional(:lt) => integer(),
  optional(:lte) => integer()
}
@type t() :: %Stripe.TaxRate{
  active: boolean(),
  country: binary() | nil,
  created: integer(),
  description: binary() | nil,
  display_name: binary(),
  effective_percentage: term() | nil,
  id: binary(),
  inclusive: boolean(),
  jurisdiction: binary() | nil,
  livemode: boolean(),
  metadata: term() | nil,
  object: binary(),
  percentage: term(),
  state: binary() | nil,
  tax_type: binary() | nil
}

The tax_rate type.

  • 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.
  • country Two-letter country code (ISO 3166-1 alpha-2).
  • created Time at which the object was created. Measured in seconds since the Unix epoch.
  • description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers.
  • display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page.
  • effective_percentage 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.
  • id Unique identifier for the object.
  • inclusive This specifies if the tax rate is inclusive or exclusive.
  • 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.
  • livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode.
  • 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.
  • object String representing the object's type. Objects of the same type share the same value.
  • 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.
  • state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States.
  • tax_type The high-level tax type, such as vat or sales_tax.

Link to this section Functions

Link to this function

create(params \\ %{}, opts \\ [])

View Source
@spec create(
  params :: %{
    optional(:active) => boolean(),
    optional(:country) => binary(),
    optional(:description) => binary(),
    optional(:display_name) => binary(),
    optional(:expand) => [binary()],
    optional(:inclusive) => boolean(),
    optional(:jurisdiction) => binary(),
    optional(:metadata) => %{optional(binary()) => binary()},
    optional(:percentage) => number(),
    optional(:state) => binary(),
    optional(:tax_type) =>
      :amusement_tax
      | :communications_tax
      | :gst
      | :hst
      | :igst
      | :jct
      | :lease_tax
      | :pst
      | :qst
      | :rst
      | :sales_tax
      | :service_tax
      | :vat
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Creates a new tax rate.

Details

  • Method: post
  • Path: /v1/tax_rates
Link to this function

list(params \\ %{}, opts \\ [])

View Source
@spec list(
  params :: %{
    optional(:active) => boolean(),
    optional(:created) => created() | integer(),
    optional(:ending_before) => binary(),
    optional(:expand) => [binary()],
    optional(:inclusive) => boolean(),
    optional(:limit) => integer(),
    optional(:starting_after) => binary()
  },
  opts :: Keyword.t()
) ::
  {:ok, Stripe.List.t(t())} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first.

Details

  • Method: get
  • Path: /v1/tax_rates
Link to this function

retrieve(tax_rate, params \\ %{}, opts \\ [])

View Source
@spec retrieve(
  tax_rate :: binary(),
  params :: %{optional(:expand) => [binary()]},
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Retrieves a tax rate with the given ID

Details

  • Method: get
  • Path: /v1/tax_rates/{tax_rate}
Link to this function

update(tax_rate, params \\ %{}, opts \\ [])

View Source
@spec update(
  tax_rate :: binary(),
  params :: %{
    optional(:active) => boolean(),
    optional(:country) => binary(),
    optional(:description) => binary(),
    optional(:display_name) => binary(),
    optional(:expand) => [binary()],
    optional(:jurisdiction) => binary(),
    optional(:metadata) => %{optional(binary()) => binary()} | binary(),
    optional(:state) => binary(),
    optional(:tax_type) =>
      :amusement_tax
      | :communications_tax
      | :gst
      | :hst
      | :igst
      | :jct
      | :lease_tax
      | :pst
      | :qst
      | :rst
      | :sales_tax
      | :service_tax
      | :vat
  },
  opts :: Keyword.t()
) :: {:ok, t()} | {:error, Stripe.ApiErrors.t()} | {:error, term()}

Updates an existing tax rate.

Details

  • Method: post
  • Path: /v1/tax_rates/{tax_rate}