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

# Get Tax Rate (Sandbox)

> Retrieve a simulated tax rate breakdown using specific test values in the sandbox environment.

Use this endpoint in the **Sandbox environment** to simulate tax rate scenarios for different countries, product types, and customer classifications. This helps validate integration logic and test edge cases before moving to production.

***

### Tax Rate Simulation

The Sandbox environment supports **specific input values** to simulate deterministic behavior. You can use these values in your requests to test various scenarios.

<Expandable title="Valid Tax Rates- Sandbox">
  | Country | Product Category | Customer Type | Outcome Description    |
  | :------ | :--------------- | :------------ | :--------------------- |
  | DE      | `SAAS`           | `B2B`         | Reverse charge applied |
  | IN      | `PRSFT`          | `B2C`         | Standard GST 18%       |
  | US      | `CSS`            | `NGO`         | Tax-exempt scenario    |

  > You can mix and match valid combinations to simulate real-world use cases like exemption, reverse charge, invalid ID, and total tax.
</Expandable>

***

### Request Paramters

The request body accepts the following fields:

<Accordion title="Request Paramters">
  * `product_id` *(string, optional)* – Reference to a specific product (if known).
  * `product_category` *(string, optional)* – Category of the product. Examples:
    * `CSS` – Custom Software
    * `DTSP` – Dev & Tech Support Services (with product)
    * `DAW` – Digital Audio Works (e.g., music tracks, podcasts)
    * `DAVW` – Digital Audio-Visual Works (e.g., multimedia videos)
    * `DB` – Digital Books
    * `DP` – Digital Photographs
    * `IAAS` – Infrastructure-as-a-Service
    * `PAAS` – Platform-as-a-Service
    * `SAAS` – Software-as-a-Service (CRM, HRM, etc.)
    * `PRSFT` – Prewritten Software (e.g., antivirus)
    * `RNGT` – Ringtones
    * `DSWS` – Data & Web Hosting Services
    * `GMO` – Gaming Services
    * `SSS` – Streaming Services
    * `DTSS` – Dev & Tech Support Services (separate)
    * `INGMO` – In-Game Purchases
  * `is_security` *(boolean, optional)* – Whether the product qualifies as a financial/security-type good.
  * `delivery_method` *(string, required)* – Method of product delivery. One of:
    * `CLOUD` – Delivered via cloud services
    * `PHYSICAL` – Physically transferred (e.g., hardware, CDs)
    * `DOWN` – Electronically transferred/downloaded
  * `customer_id` *(string, optional)* – Unique identifier for a customer (overrides `customer_type`).
  * `customer_type` *(string, optional)* – Type of customer. One of:
    * `B2C` – Business to Consumer
    * `B2B` – Business to Business
    * `PRISCH` – Private School
    * `PRIEDUI` – Private Educational Institution (Non-School)
    * `GOV` – Government Entity
    * `PUBSCH` – Public School
    * `PUBEDU` – Public Educational Institution (Non-School)
    * `PRIHOS` – Private Hospital
    * `PUBHOS` – Public Hospital
    * `NGO` – Non-Governmental Organization
  * `location`: *(object, required)*\
    Provide customer jurisdictional context using any of:
    * `country` *(string)* – ISO country code
    * `state` *(string)* – State or province
    * `county` *(string)* – County or district
    * `postal_code` *(string)* – ZIP or postal code
    * `ip_address` *(string)* – Used for fallback geolocation
</Accordion>

***

### Response Fields

Returns tax determination and detailed rates:

<Accordion title="Response Fields">
  * `taxable` *(boolean)* – Whether the product is taxable in this scenario.
  * `country_rate` *(integer)* – Country-level tax rate (in basis points, e.g., `18000` = 18%).
  * `state_rate` *(integer)* – State-level tax rate.
  * `county_rate` *(integer)* – County-level tax rate.
  * `special_rate` *(integer)* – Any special jurisdiction-specific rate.
  * `additional_rate` *(integer)* – Supplementary rate applied.
  * `total_rate` *(integer)* – Total computed effective tax rate.
  * `reverse_charge_applicable` *(boolean)* – Whether reverse charge mechanism applies.
  * `exempt` *(boolean)* – Whether the transaction is exempt from tax.
</Accordion>

***

### Notes

<Card>
  <Warning>All rate fields are returned in basis points. `18000` = 18%.</Warning>
  <Warning>Only specific test combinations are supported in the sandbox. Using other values will return a default fallback.</Warning>
  <Note>If both `product_id` and `product_category` are provided, `product_id` takes priority.</Note>
  <Note>If both `customer_id` and `customer_type` are provided, `customer_id` takes priority.</Note>
  <Check>Reverse charge logic is auto-detected using customer and jurisdiction info.</Check>
  <Tip>Use this API to validate integration logic before pushing to production.</Tip>
</Card>


## OpenAPI

````yaml api-reference/openapi_sandbox.json post /v1/tax/rate
openapi: 3.0.1
info:
  title: Antei Sandbox API
  description: >-
    Test and simulate integrations using Antei's sandbox environment. This is a
    sandbox-specific version exposing only limited endpoints for safe testing.
  version: 1.0.0
  license:
    name: MIT
  contact:
    name: Antei Developer Support
    email: support@antei.com
    url: https://antei.com
  x-sandbox: true
servers:
  - url: https://sandbox.antei.com
security:
  - bearerAuth: []
tags:
  - name: Tax Rate
    description: Calculate applicable tax rates based on product and customer details.
  - name: Tax ID Validation
    description: Validate tax identification numbers for compliance checks.
  - name: Taxation
    description: Unified tax calculation and validation workflows.
paths:
  /v1/tax/rate:
    post:
      tags:
        - Tax Rate
      summary: Calculate Tax Rate
      description: >-
        Returns a detailed breakdown of tax applicability and rates based on
        product, customer, and delivery location.
      parameters:
        - $ref: '#/components/parameters/IdempotencyKey'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TaxRateRequest'
      responses:
        '200':
          description: Successful tax rate breakdown
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaxRateResponse'
        '400':
          description: Bad request due to missing or invalid parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    IdempotencyKey:
      name: Idempotency-Key
      in: header
      description: >-
        Optional. Unique key to ensure idempotent operations (e.g., retry-safe
        requests).
      required: false
      schema:
        type: string
  schemas:
    TaxRateRequest:
      type: object
      properties:
        product_id:
          type: string
          description: Unique ID of the product (optional if product_category is provided)
        product_category:
          type: string
          description: Category of the product (e.g., 'SAAS', 'DIGITAL_GOODS')
          enum:
            - CSS
            - DTSP
            - DAW
            - DAVW
            - DB
            - DP
            - IAAS
            - PAAS
            - SAAS
            - PRSFT
            - RNGT
            - DSWS
            - GMO
            - SSS
            - DTSS
            - INGMO
        is_security:
          type: boolean
          description: If true, the product is considered a security
        delivery_method:
          type: string
          enum:
            - CLOUD
            - PHYSICAL
            - DOWN
          description: How the product is delivered
        customer_id:
          type: string
          description: Customer ID (optional if customer_type is provided)
        customer_type:
          type: string
          enum:
            - B2C
            - B2B
            - PRISCH
            - PRIEDUI
            - GOV
            - PUBSCH
            - PUBEDU
            - PRIHOS
            - PUBHOS
            - NGO
          description: Customer classification
        location:
          type: object
          description: Location of the customer for tax purposes
          properties:
            country:
              type: string
              description: ISO 3166 country code
            state:
              type: string
              description: State or region
            county:
              type: string
              description: County or district
            postal_code:
              type: string
              description: Postal or ZIP code
            ip_address:
              type: string
              format: ipv4
              description: Customer IP address
      required:
        - delivery_method
        - location
      example:
        product_category: SAAS
        delivery_method: CLOUD
        customer_type: B2B
        location:
          country: US
          state: CA
          postal_code: '94016'
          ip_address: 192.168.1.1
    TaxRateResponse:
      type: object
      properties:
        taxable:
          type: boolean
          description: Whether the transaction is taxable
        country_rate:
          type: integer
          description: Country-level tax rate in basis points (×1000)
        state_rate:
          type: integer
          description: State-level tax rate in basis points (×1000)
        county_rate:
          type: integer
          description: County-level tax rate in basis points (×1000)
        additional_rate:
          type: integer
          description: Any additional applicable rate in basis points (×1000)
        special_rate:
          type: integer
          description: Special condition tax rate in basis points (×1000)
        total_rate:
          type: integer
          description: Total calculated tax rate in basis points (×1000)
        reverse_charge_applicable:
          type: boolean
          description: If reverse charge is applicable
        exempt:
          type: boolean
          description: If the transaction is exempt from taxes
      required:
        - taxable
        - total_rate
    Error:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        status:
          type: integer
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````