LatticeStripe.TaxId (LatticeStripe v1.7.0)

Copy Markdown View Source

Operations on Stripe Tax ID objects.

Tax IDs store customer tax identification numbers (VAT, EIN, etc.) for tax reporting and calculation. Stripe exposes two URL families for the same resource shape — this module routes by arity so adopters call one module for both paths.

Dual-path URL table

OperationTop-level (/v1/tax_ids)Customer-nested (/v1/customers/:id/tax_ids)
Createcreate/3create/4customer_id is 2nd arg after client
Retrieveretrieve/3retrieve/4
Listlist/3list/4
Deletedelete/3delete/4
Streamstream!/3stream!/4

Top-level paths apply when the tax ID is not scoped to a single customer URL prefix. Customer-nested paths apply when managing tax IDs on a known cus_... record. Nested create/4 omits "customer" from the request body — Stripe infers the customer from the URL path.

Usage

# Top-level create
{:ok, tax_id} =
  LatticeStripe.TaxId.create(client, %{"type" => "eu_vat", "value" => "DE123456789"})

# Customer-nested create
{:ok, tax_id} =
  LatticeStripe.TaxId.create(client, "cus_123", %{"type" => "eu_vat", "value" => "DE123456789"})

Not LatticeStripe.Invoice.AutomaticTax

Tax IDs on customers are separate from automatic tax on invoices. Use LatticeStripe.Invoice.AutomaticTax when Stripe calculates tax on an invoice from the customer's address and tax settings — not this module.

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

Operations not supported by the Stripe API

  • update — Tax IDs are immutable once created (Coupon precedent).
  • search — No /v1/tax_ids/search endpoint exists.

See the Stripe Tax ID API.

Summary

Types

t()

@type t() :: %LatticeStripe.TaxId{
  country: String.t() | nil,
  created: integer() | nil,
  customer: struct() | String.t() | nil,
  customer_account: String.t() | nil,
  deleted: boolean(),
  extra: map(),
  id: String.t() | nil,
  livemode: boolean() | nil,
  object: String.t(),
  owner: LatticeStripe.TaxId.Owner.t() | nil,
  type: String.t() | nil,
  value: String.t() | nil,
  verification: LatticeStripe.TaxId.Verification.t() | nil
}

Functions

create(client, params)

create(client, customer_id, params)

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

create(client, customer_id, params, opts)

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

Creates a Tax ID.

  • create(client, params, opts) — POST /v1/tax_ids
  • create(client, customer_id, params, opts) — POST /v1/customers/:customer_id/tax_ids (omits "customer" from the request body)

create!(c, p)

create!(c, cid, p)

create!(c, cid, p, o)

delete(client, id)

delete(client, customer_id, id)

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

delete(client, customer_id, id, opts)

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

Deletes a Tax ID.

  • delete(client, id, opts) — DELETE /v1/tax_ids/:id
  • delete(client, customer_id, id, opts) — DELETE /v1/customers/:customer_id/tax_ids/:id

delete!(c, id)

delete!(c, cid, id)

delete!(c, cid, id, o)

list(client, params)

list(client, customer_id, params)

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

list(client, customer_id, params, opts)

Lists Tax IDs.

  • list(client, params, opts) — GET /v1/tax_ids
  • list(client, customer_id, params, opts) — GET /v1/customers/:customer_id/tax_ids

list!(c, p)

list!(c, cid, p)

list!(c, cid, p, o)

retrieve(client, id)

retrieve(client, customer_id, id)

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

retrieve(client, customer_id, id, opts)

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

Retrieves a Tax ID.

  • retrieve(client, id, opts) — GET /v1/tax_ids/:id
  • retrieve(client, customer_id, id, opts) — GET /v1/customers/:customer_id/tax_ids/:id

retrieve!(c, id)

retrieve!(c, cid, id)

retrieve!(c, cid, id, o)

stream!(client, params \\ %{})

stream!(client, customer_id, params)

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

stream!(client, customer_id, params, opts)

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