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

# Create tariff

> Create a new tariff



## OpenAPI

````yaml post /v1/tariffs
openapi: 3.0.0
info:
  title: Tariffs API
  version: 1.0.0
  description: API for managing tariffs and fee calculations
servers: []
security:
  - bearerAuth: []
tags:
  - name: Tariffs
    description: Tariff management operations
  - name: Fee Ranges
    description: Fee range operations
  - name: Fee Calculation
    description: Fee calculation operations
  - name: Dictionaries
    description: Dictionary data operations
paths:
  /v1/tariffs:
    post:
      tags:
        - Tariffs
      summary: Create tariff
      description: Create a new tariff
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTariffRequest'
      responses:
        '201':
          description: Tariff created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tariff'
        '400':
          $ref: '#/components/responses/ValidationError'
        '409':
          $ref: '#/components/responses/TariffExistsError'
components:
  schemas:
    CreateTariffRequest:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        description:
          type: string
        fallback_tariff_id:
          type: string
          format: uuid
        active:
          type: boolean
          default: true
        default:
          type: boolean
          default: false
    Tariff:
      type: object
      properties:
        id:
          type: string
          format: uuid
        name:
          type: string
        description:
          type: string
        fallback_tariff_id:
          type: string
          format: uuid
        active:
          type: boolean
        default:
          type: boolean
        fee_ranges:
          type: array
          items:
            $ref: '#/components/schemas/FeeRange'
        velocity_rules:
          type: array
          items:
            $ref: '#/components/schemas/VelocityRule'
        created_at:
          type: string
          format: date-time
        created_by:
          type: string
          format: uuid
    FeeRange:
      type: object
      properties:
        id:
          type: string
          format: uuid
        tariff_id:
          type: string
          format: uuid
        range_start:
          type: number
          minimum: 0
        range_end:
          type: number
          minimum: 0
        fixed_fee:
          type: number
          minimum: 0
        percent_fee:
          type: number
          minimum: 0
        method:
          type: string
          enum:
            - fixed
            - percentage
            - greater
            - lesser
            - sum
        min_fee:
          type: number
          minimum: 0
        max_fee:
          type: number
          minimum: 0
        media:
          type: string
        asset:
          type: string
        from_channel:
          type: string
        to_channel:
          type: string
        valid_from:
          type: string
          format: date-time
        valid_to:
          type: string
          format: date-time
        active:
          type: boolean
    VelocityRule:
      type: object
      properties:
        id:
          type: string
          format: uuid
        type:
          type: string
          enum:
            - transaction_count
            - amount
        interval:
          type: string
          enum:
            - once
            - daily
            - weekly
            - monthly
            - annually
        limit:
          type: number
          minimum: 0
        active:
          type: boolean
    Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
  responses:
    ValidationError:
      description: Invalid input data
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: tariffs.invalid_tariff_data
            message: Invalid tariff data provided
    TariffExistsError:
      description: Tariff already exists
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            code: tariffs.tariff_already_exists
            message: Tariff with this name already exists
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````