> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Set the cart tax identifier

> Sets the tax registration this cart is taxed against, overriding the one on the
customer's profile — for a buyer paying through a different company than the one
on their account. Send both `kind` and `value` every time. The cart's totals are
recalculated. Returns 201 when the cart had no override yet, 200 when it replaced one.




## OpenAPI

````yaml /api-reference/store.yaml patch /api/v3/store/carts/{cart_id}/tax_identifier
openapi: 3.0.3
info:
  title: Store API
  contact:
    name: Spree Commerce
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  description: >
    Spree Store API v3 - Customer-facing storefront API for building headless
    commerce experiences.


    ## Authentication


    The Store API uses two authentication methods:


    ### API Key (Required)

    All requests must include a publishable API key in the `x-spree-api-key`
    header.


    ### JWT Bearer Token (For authenticated customers)

    After login, include the JWT token in the `Authorization: Bearer <token>`
    header.


    ### Order Token (For guest checkout)

    When creating an order, a `token` is returned. Include this in the
    `x-spree-token` header

    for guest access to that specific order.


    ## Response Format


    All responses are JSON. List endpoints return paginated responses with
    `data` and `meta` keys.


    ## Error Handling


    Errors return a consistent format:

    ```json

    {
      "error": {
        "code": "record_not_found",
        "message": "Product not found"
      }
    }

    ```
  version: v3
servers:
  - url: http://{defaultHost}
    variables:
      defaultHost:
        default: localhost:3000
security: []
tags:
  - name: Authentication
    description: Customer authentication (login, logout, token refresh)
  - name: Product Catalog
    description: Products and categories
  - name: Carts
    description: Shopping cart management
  - name: Orders
    description: Order lookup
  - name: Customers
    description: Customer account, addresses, saved payment methods, and order history
  - name: Markets
    description: Markets, countries, currencies, and locales
  - name: Wishlists
    description: Customer wishlists
  - name: Newsletter Subscribers
    description: Guest and customer newsletter subscriptions (double opt-in)
  - name: Policies
    description: Store policies (return policy, privacy policy, terms of service)
  - name: Digitals
    description: Digital product downloads
paths:
  /api/v3/store/carts/{cart_id}/tax_identifier:
    parameters:
      - name: cart_id
        in: path
        required: true
        description: Cart prefixed ID
        schema:
          type: string
    patch:
      tags:
        - Carts
      summary: Set the cart tax identifier
      description: >
        Sets the tax registration this cart is taxed against, overriding the one
        on the

        customer's profile — for a buyer paying through a different company than
        the one

        on their account. Send both `kind` and `value` every time. The cart's
        totals are

        recalculated. Returns 201 when the cart had no override yet, 200 when it
        replaced one.
      parameters:
        - name: x-spree-api-key
          in: header
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          required: false
          schema:
            type: string
        - name: x-spree-token
          in: header
          required: false
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxIdentifierParams'
        required: true
      responses:
        '201':
          description: tax identifier set
          content:
            application/json:
              example:
                id: txi_UkLWZg9DAJ
                kind: eu_vat
                value: DE100000008
              schema:
                $ref: '#/components/schemas/TaxIdentifier'
      security:
        - api_key: []
          bearer_auth: []
components:
  schemas:
    TaxIdentifierParams:
      type: object
      properties:
        kind:
          type: string
          description: >-
            The registration the number belongs to, such as `eu_vat` or
            `gb_vat`. Any kind is accepted; one with a registered validator is
            checked by it. Built-in: `eu_vat`. Extensions may register more.
          example: eu_vat
        value:
          type: string
          example: DE123456789
      required:
        - kind
        - value
    TaxIdentifier:
      type: object
      properties:
        id:
          type: string
        kind:
          type: string
          description: >-
            Tax identifier kind, keyed to a registered validator. Built-in:
            eu_vat. Extensions may register more.
        value:
          type: string
      required:
        - id
        - kind
        - value
      x-typelizer: true
  securitySchemes:
    api_key:
      type: apiKey
      name: x-spree-api-key
      in: header
      description: Publishable API key for store access
    bearer_auth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT token for authenticated customers

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.