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
| Operation | Top-level (/v1/tax_ids) | Customer-nested (/v1/customers/:id/tax_ids) |
|---|---|---|
| Create | create/3 | create/4 — customer_id is 2nd arg after client |
| Retrieve | retrieve/3 | retrieve/4 |
| List | list/3 | list/4 |
| Delete | delete/3 | delete/4 |
| Stream | stream!/3 | stream!/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/searchendpoint exists.
See the Stripe Tax ID API.
Summary
Types
@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
@spec create(LatticeStripe.Client.t(), map(), keyword()) :: {:ok, t()} | {:error, LatticeStripe.Error.t()}
@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_idscreate(client, customer_id, params, opts)— POST/v1/customers/:customer_id/tax_ids(omits"customer"from the request body)
@spec delete(LatticeStripe.Client.t(), String.t(), keyword()) :: {:ok, t()} | {:error, LatticeStripe.Error.t()}
@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/:iddelete(client, customer_id, id, opts)— DELETE/v1/customers/:customer_id/tax_ids/:id
@spec list(LatticeStripe.Client.t(), map(), keyword()) :: {:ok, LatticeStripe.Response.t()} | {:error, LatticeStripe.Error.t()}
@spec list(LatticeStripe.Client.t(), String.t(), map(), keyword()) :: {:ok, LatticeStripe.Response.t()} | {:error, LatticeStripe.Error.t()}
Lists Tax IDs.
list(client, params, opts)— GET/v1/tax_idslist(client, customer_id, params, opts)— GET/v1/customers/:customer_id/tax_ids
@spec retrieve(LatticeStripe.Client.t(), String.t(), keyword()) :: {:ok, t()} | {:error, LatticeStripe.Error.t()}
@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/:idretrieve(client, customer_id, id, opts)— GET/v1/customers/:customer_id/tax_ids/:id
@spec stream!(LatticeStripe.Client.t(), map(), keyword()) :: Enumerable.t()
@spec stream!(LatticeStripe.Client.t(), String.t(), map(), keyword()) :: Enumerable.t()