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

# Resolve the applicable tax rate for a destination

> Same code path billing uses — given a tax category + destination + date, return the single applicable rate breakdown plus its fingerprint. 404 when no row matches; 422 when the configuration is ambiguous (multiple rows match — caller must close one's effective_to or deactivate it).



## OpenAPI

````yaml /openAPI/openapi-20240301.json post /tax/business_entities/{business_entity_id}/rates/lookup
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /tax/business_entities/{business_entity_id}/rates/lookup:
    post:
      tags:
        - Tax
      summary: Resolve the applicable tax rate for a destination
      description: >-
        Same code path billing uses — given a tax category + destination + date,
        return the single applicable rate breakdown plus its fingerprint. 404
        when no row matches; 422 when the configuration is ambiguous (multiple
        rows match — caller must close one's effective_to or deactivate it).
      operationId: Resolve-the-applicable-tax-rate-for-a-destination
      parameters:
        - name: business_entity_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Business Entity Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LookupTaxRatesRequestSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResolvedRates'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    LookupTaxRatesRequestSchema:
      properties:
        tax_category_id:
          type: string
          format: uuid
          title: Tax Category Id
        country_code:
          type: string
          maxLength: 2
          minLength: 2
          title: Country Code
        state_code:
          anyOf:
            - type: string
              maxLength: 10
            - type: 'null'
          title: State Code
        city:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: City
        zip_code:
          anyOf:
            - type: string
              maxLength: 20
            - type: 'null'
          title: Zip Code
        effective_date:
          type: string
          format: date
          title: Effective Date
      type: object
      required:
        - tax_category_id
        - country_code
        - effective_date
      title: LookupTaxRatesRequestSchema
      description: >-
        Request body for the rate-lookup endpoint.


        Strict-level matching against the deepest field provided. A missing
        input

        field is treated as 'row must be empty at that level' — not 'ignore that

        level'. So `city=SF` alone matches rows with state='' AND city='SF' AND

        zip=''. Whatever combination of geography fields the caller supplies,
        the

        lookup either matches a row pinned to that exact shape or returns [].
    ResolvedRates:
      properties:
        source_jurisdiction_rate_id:
          type: string
          format: uuid
          title: Source Jurisdiction Rate Id
        rate_breakdown:
          items:
            $ref: '#/components/schemas/RateRow'
          type: array
          title: Rate Breakdown
        fingerprint:
          type: string
          title: Fingerprint
      type: object
      required:
        - source_jurisdiction_rate_id
        - rate_breakdown
        - fingerprint
      title: ResolvedRates
      description: >-
        Output of :meth:`TaxLookupService.resolve_rates_for_destination` — one
        matched jurisdiction.


        ``source_jurisdiction_rate_id`` is provenance (which

        ``tax_jurisdiction_rates`` row matched). ``fingerprint`` is a sha256

        over the resolved set so a future reverify can detect drift against

        current rate tables without re-shipping the breakdown.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    RateRow:
      properties:
        jurisdiction_level:
          anyOf:
            - type: string
            - type: 'null'
          title: Jurisdiction Level
        jurisdiction_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Jurisdiction Code
        tax_name:
          type: string
          title: Tax Name
        rate_percent:
          type: string
          title: Rate Percent
        is_compound:
          type: boolean
          title: Is Compound
        compound_order:
          type: integer
          title: Compound Order
        source_tax_rate_id:
          type: string
          format: uuid
          title: Source Tax Rate Id
      type: object
      required:
        - tax_name
        - rate_percent
        - is_compound
        - compound_order
        - source_tax_rate_id
      title: RateRow
      description: >-
        One element of the resolved rate breakdown — mirrors ``tax_rates``
        columns.


        This is the unit the backend ships to its caller. The caller applies it

        against a line amount to compute tax (additive stacking only today).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````