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

# Create a new tax

> Creates a new tax rate that can be applied to products, invoices, and payment links.

## Use Cases
- Set up sales tax for different regions
- Create VAT rates for international customers
- Configure state and local tax rates
- Manage tax compliance requirements

## Example: Create Basic Sales Tax
```json
{
  "name": "Sales Tax",
  "description": "Standard sales tax for retail transactions",
  "percentage": 8.5,
  "active": true
}
```

## Required Fields
- `name`: Tax name for identification (1-100 characters)
- `percentage`: Tax rate percentage (0-100)

## Optional Fields
- `description`: Explanation of what this tax covers (max 255 characters)
- `active`: Whether this tax is currently active (default: true)
- `appIds`: Array of app IDs where this tax should be available



## OpenAPI

````yaml /swagger.yml post /api/v0/taxes
openapi: 3.0.0
info:
  title: Devdraft AI Payment & Business Management API
  description: >-

    A comprehensive payment processing and business management API that enables
    seamless integration of cryptocurrency and traditional payment methods.
        
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.devdraft.ai
    description: Production Server
security: []
tags: []
paths:
  /api/v0/taxes:
    post:
      tags:
        - Taxes
      summary: Create a new tax
      description: >-
        Creates a new tax rate that can be applied to products, invoices, and
        payment links.


        ## Use Cases

        - Set up sales tax for different regions

        - Create VAT rates for international customers

        - Configure state and local tax rates

        - Manage tax compliance requirements


        ## Example: Create Basic Sales Tax

        ```json

        {
          "name": "Sales Tax",
          "description": "Standard sales tax for retail transactions",
          "percentage": 8.5,
          "active": true
        }

        ```


        ## Required Fields

        - `name`: Tax name for identification (1-100 characters)

        - `percentage`: Tax rate percentage (0-100)


        ## Optional Fields

        - `description`: Explanation of what this tax covers (max 255
        characters)

        - `active`: Whether this tax is currently active (default: true)

        - `appIds`: Array of app IDs where this tax should be available
      operationId: TaxController_create
      parameters: []
      requestBody:
        required: true
        description: Tax creation data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTaxDto'
      responses:
        '201':
          description: Tax created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    example: tax_123e4567-e89b-12d3-a456-426614174000
                  name:
                    type: string
                    example: Sales Tax
                  description:
                    type: string
                    example: Standard sales tax for retail transactions
                  percentage:
                    type: number
                    example: 8.5
                  active:
                    example: true
                    type: boolean
                  created_at:
                    type: string
                    format: date-time
                  updated_at:
                    type: string
                    format: date-time
        '400':
          description: Bad Request - Invalid input data
        '401':
          description: Unauthorized - Invalid API credentials
      security:
        - x-client-secret: []
        - x-client-key: []
components:
  schemas:
    CreateTaxDto:
      type: object
      properties:
        name:
          type: string
          description: Tax name. Used to identify and reference this tax rate.
          example: Sales Tax
          minLength: 1
          maxLength: 100
        description:
          type: string
          description: Optional description explaining what this tax covers.
          example: Standard sales tax for retail transactions
          maxLength: 255
        percentage:
          type: number
          description: Tax percentage rate. Must be between 0 and 100.
          example: 8.5
          minimum: 0
          maximum: 100
        active:
          type: boolean
          description: Whether this tax is currently active and can be applied.
          example: true
          default: true
        appIds:
          type: array
          description: >-
            Array of app IDs where this tax should be available. If not
            provided, tax will be available for the current app.
          example:
            - app_123e4567-e89b-12d3-a456-426614174000
          items:
            type: string
            format: uuid
      required:
        - name
        - percentage
  securitySchemes:
    x-client-secret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        Your secret API key. Keep this secure and never expose it in client-side
        code.
    x-client-key:
      type: apiKey
      in: header
      name: x-client-key
      description: Your unique client API key. Obtain this from your Devdraft AI dashboard.

````