LatticeStripe.Tax.Registration (LatticeStripe v1.7.0)

Copy Markdown View Source

Stripe Tax Registration objects for declaring where you collect tax.

Does not register with tax authorities

Creating a registration via create/3 does not register you with tax authorities. It tells Stripe which jurisdictions you are configured to collect tax in so calculations and reporting can run. Legal registration with government agencies remains your responsibility.

Relationship to other tax surfaces

Registrations work alongside LatticeStripe.Tax.Settings (account defaults) and LatticeStripe.Tax.Calculation (ephemeral tax amounts). This module is not LatticeStripe.Invoice.AutomaticTax. Tax filing, returns, and threshold monitoring are out of SDK scope.

country_options

Registration params require a nested country_options map keyed by lowercase ISO country codes that match the top-level "country" field. For US state sales tax:

%{
  "country" => "US",
  "country_options" => %{
    "us" => %{"type" => "state_sales_tax", "state" => "CA"}
  }
}

For EU OSS:

%{
  "country" => "DE",
  "country_options" => %{
    "de" => %{"type" => "oss_union", "oss_union" => "standard"}
  }
}

Do not pass type at the top level of the create params — it belongs inside the country-specific nested map.

Usage

{:ok, registration} =
  LatticeStripe.Tax.Registration.create(client, %{
    "country" => "US",
    "country_options" => %{
      "us" => %{"type" => "state_sales_tax", "state" => "CA"}
    }
  })

{:ok, response} = LatticeStripe.Tax.Registration.list(client)

Pagination

list/3 returns a single page of results as %LatticeStripe.List{}. %LatticeStripe.List{} is not Enumerable. For many jurisdictions, use stream!/3, which auto-paginates and yields %Registration{} structs.

See Standalone Tax API for the canonical calculate → record → reverse workflow.

See Stripe Tax Registrations.

Summary

Functions

Creates a Tax Registration.

Like create/3 but raises on failure.

Lists Tax Registrations with optional filters.

Like list/3 but raises on failure.

Retrieves a Tax Registration by ID.

Like retrieve/3 but raises on failure.

Returns a lazy stream of Tax Registrations matching the given filters.

Updates a Tax Registration by ID.

Types

t()

@type t() :: %LatticeStripe.Tax.Registration{
  active_from: integer() | nil,
  country: String.t() | nil,
  country_options: map() | nil,
  created: integer() | nil,
  expires_at: integer() | nil,
  extra: map(),
  id: String.t() | nil,
  livemode: boolean() | nil,
  object: String.t(),
  status: atom() | String.t() | nil
}

Functions

create(client, params, opts \\ [])

@spec create(LatticeStripe.Client.t(), map(), keyword()) ::
  {:ok, t()} | {:error, LatticeStripe.Error.t()}

Creates a Tax Registration.

Sends POST /v1/tax/registrations with the raw params map.

create!(client, params, opts \\ [])

@spec create!(LatticeStripe.Client.t(), map(), keyword()) :: t()

Like create/3 but raises on failure.

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

@spec list(LatticeStripe.Client.t(), map(), keyword()) ::
  {:ok, LatticeStripe.Response.t()} | {:error, LatticeStripe.Error.t()}

Lists Tax Registrations with optional filters.

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

Like list/3 but raises on failure.

retrieve(client, id, opts \\ [])

@spec retrieve(LatticeStripe.Client.t(), String.t(), keyword()) ::
  {:ok, t()} | {:error, LatticeStripe.Error.t()}

Retrieves a Tax Registration by ID.

retrieve!(client, id, opts \\ [])

@spec retrieve!(LatticeStripe.Client.t(), String.t(), keyword()) :: t()

Like retrieve/3 but raises on failure.

stream!(client, params \\ %{}, opts \\ [])

@spec stream!(LatticeStripe.Client.t(), map(), keyword()) :: Enumerable.t()

Returns a lazy stream of Tax Registrations matching the given filters.

update(client, id, params, opts \\ [])

@spec update(LatticeStripe.Client.t(), String.t(), map(), keyword()) ::
  {:ok, t()} | {:error, LatticeStripe.Error.t()}

Updates a Tax Registration by ID.

update!(client, id, params, opts \\ [])

@spec update!(LatticeStripe.Client.t(), String.t(), map(), keyword()) :: t()

Like update/4 but raises on failure.