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

# Create Fee Component



## OpenAPI

````yaml POST /billing/feeComponent
openapi: 3.1.0
info:
  title: OpenAPI Valyx API
  description: To demonstrate features in the Valyx
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.valyx.com
security:
  - bearerAuth:
      - demo-api
tags:
  - name: billing
    description: External Billing APIs
  - name: external
    description: External APIs for customers
  - name: invoice
    description: Invoice APIs
  - name: creditNote
    description: Credit Note APIs
paths:
  /billing/feeComponent:
    parameters:
      - name: X-Valyx-Signature
        in: header
        required: true
        description: Auth key to authenticate the request
        schema:
          type: string
    post:
      tags:
        - billing
      operationId: post_create_fee_component
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateFeeComponentAPIRequestModel'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/FeeComponentResponseModel'
components:
  schemas:
    CreateFeeComponentAPIRequestModel:
      type: object
      required:
        - name
        - taxRate
      properties:
        name:
          type: string
          description: The unique name of the fee component.
        taxRate:
          type: array
          description: >-
            List of taxes applicable to this fee component. Each tax includes
            its name, value, and category.
          items:
            $ref: '#/components/schemas/CreateFeeComponentAPIRequestModeltaxRate'
        hsnOrSacCode:
          type: string
          description: >-
            HSN (Harmonized System of Nomenclature) code or SAC (Service
            Accounting Code) for GST classification.
        sku:
          type: string
          description: >-
            Stock Keeping Unit (SKU) – a unique identifier for the product or
            service. Useful for inventory or internal tracking.
        unit:
          type: string
          description: >-
            The unit of measurement for this fee component (e.g., 'GB', 'Hour',
            'User'). Used when calculating usage-based charges.
        description:
          type: string
          description: Optional detailed description of the fee component.
        billLimit:
          $ref: '#/components/schemas/CreateContractAPIRequestModelbillingReportLimit'
          description: >-
            Optional limits for billing this component, e.g., min/max values or
            usage-based tiers.
        driverUpsertRequest:
          $ref: >-
            #/components/schemas/CreateFeeComponentAPIRequestModeldriverUpsertRequest
          description: >-
            Optional usage driver relationships, defining how different usage
            drivers contribute to this fee component's calculations.
    FeeComponentResponseModel:
      type: object
      properties:
        error:
          type: string
          description: >-
            Error message if the operation failed. Null if the operation was
            successful.
        message:
          type: string
          description: Informational message about the result of the operation.
        data:
          type: object
          properties:
            id:
              type: string
              description: Unique identifier of the created fee component.
          required:
            - id
      required:
        - error
        - message
        - data
    CreateFeeComponentAPIRequestModeltaxRate:
      type: object
      required:
        - name
        - value
      properties:
        name:
          type: string
          description: The name of the tax, e.g., 'GST', 'CESS', or 'Service Tax'.
        value:
          type: number
          description: The percentage value of the tax (e.g., 18 for 18%).
        isActive:
          type: boolean
          description: Whether this tax is currently active. Defaults to true.
          default: true
        taxCategory:
          type: string
          description: >-
            The category of the tax. Helps classify taxes for reporting and
            compliance.
          example: GST
          enum:
            - GST
            - CESS
            - SERVICE
            - TDS
            - OTHER
    CreateContractAPIRequestModelbillingReportLimit:
      type: object
      required:
        - isUsageBased
      properties:
        tiers:
          type: array
          description: Optional list of tiered limits that apply based on usage thresholds.
          items:
            $ref: >-
              #/components/schemas/CreateContractAPIRequestModelbillingReportLimittiers
        isUsageBased:
          type: boolean
          description: >-
            Indicates if the report limit is based on usage. If true, the tiers
            and min/max values are interpreted per usage unit.
          default: false
        minValue:
          type: number
          description: >-
            Minimum allowed value for the billing report. Can be omitted if no
            minimum is required.
        maxValue:
          type: number
          description: >-
            Maximum allowed value for the billing report. Can be omitted if no
            maximum is required.
    CreateFeeComponentAPIRequestModeldriverUpsertRequest:
      type: object
      properties:
        upsertRequests:
          type: array
          description: >-
            List of usage driver relationships. Each entry defines a usage
            driver and its weight in calculating the fee.
          items:
            $ref: >-
              #/components/schemas/CreateFeeComponentAPIRequestModeldriverUpsertRequestupsertRequests
    CreateContractAPIRequestModelbillingReportLimittiers:
      type: object
      required:
        - upTo
      properties:
        minValue:
          type: number
          description: >-
            The minimum value for this tier. Billing will start counting from
            this value. Optional if no lower bound is needed.
        maxValue:
          type: number
          description: >-
            The maximum value for this tier. Optional if no upper bound is
            required.
        upTo:
          type: number
          description: >-
            The upper limit of this tier. Usage or billing beyond this value
            will fall into the next tier. Can be set to a very large number to
            indicate no limit.
          default: Infinity
    CreateFeeComponentAPIRequestModeldriverUpsertRequestupsertRequests:
      type: object
      required:
        - usageDriverId
        - weight
      properties:
        usageDriverId:
          type: string
          description: >-
            The unique identifier of the usage driver, e.g., 'API_CALLS',
            'STORAGE_GB'.
        weight:
          type: number
          description: >-
            The factor by which the usage driver contributes to this fee
            component. For example, 1.5 means 150% of the usage is charged.

````