> ## 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 Ratecard

<h2>
  Rate Card Description
</h2>

<Tabs>
  <Tab title="Flat Fee">
    * **Billing Scheme** **(Required)**- defines type of the rate card being used. Should be passed as `FIXED_RATE` for flat fee rate card.
    * **Fixed Price(Required)** - Fixed price that is to be charged irrespective of usage

    ```json theme={null}
    {
    	"billingScheme": "FIXED_RATE",
    	"fixedPrice": 100
    }
    ```
  </Tab>

  <Tab title="Per Unit Fee">
    * **Billing Scheme** **(Required)**- defines type of the rate card being used. Should be passed as `PER_UNIT` for per unit fee rate card.
    * **Per Unit Price (Required)** - Fixed price that is to be charged per unit of usage.
    * **Is Percentage (Optional)** - Determines if the rate is a percentage of usage value. Default to False.

    | Per Unit Price | Is Percentage | Usage Value | Amount Charged |
    | -------------- | ------------- | ----------- | -------------- |
    | 10             | False         | 50          | 500            |
    | 10             | False         | 50          | 5              |

    ```json theme={null}
    {
    	"billingScheme": "PER_UNIT",
    	"perUnitPrice": 10,
    	"isPercentage": False 
    }
    ```
  </Tab>

  <Tab title="Volume Based">
    [*What does this rate card mean?*](https://docs.valyx.com/documentation/billing/components/rate-card#volume-based-pricing)

    * **Billing Scheme** **(Required)**- defines type of the rate card being used. Should be passed as `VOLUME` for volume based rate card.
    * **Tiers (Required)** - Defines different tiers in the rate card -
      * **Name (Required)** - Name of the tier
      * **UpTo (Required)** - The upper usage limit of the tier (inclusive)
      * **Unit Price (Required)** - Price per usage for this tier
      * **Flat Price (Optional)** - Additional flat fee charged for this tier
      * **Is Percentage (Optional)** - Determines if the rate is a percentage of usage value. Default to False.
      * **Repeat Tier (Optional)** - If set to true, all the immediately following tiers will be ignored and this tier will be repeated at the same interval all the way to infinity. Defaults to False.

    ```json theme={null}
    {
    	"billingScheme": "VOLUME",
    	"tiers": [
    		{
    			"name": "10_rs_for_quantity_below_100",
    			"upTo": 100,
    			"unitPrice": 10,
    			"flatPrice": 50
    		}, {
    			"name": "8_rs_for_quantity_above_100_but_less_than_500",
    			"upTo": 500,
    			"unitPrice": 8
    		}, {
    			"name": "2_percent_for_quantity_above_500",
    			"upTo": infinity,
    			"unitPrice": 2,
    			"isPercentage": True
    		}
    	]
    }
    ```
  </Tab>

  <Tab title="Graduated">
    * **Billing Scheme** **(Required)**- defines type of the rate card being used. Should be passed as `GRADUATED` for volume based rate card.
    * **Tiers (Required)** - Defines different tiers in the rate card -
      * **Name (Required)** - Name of the tier
      * **UpTo (Required)** - The upper usage limit of the tier (inclusive)
      * **Unit Price (Required)** - Price per usage for this tier
      * **Flat Price (Optional)** - Additional flat fee charged for this tier
      * **Is Percentage (Optional)** - Determines if the rate is a percentage of usage value. Default to False.
      * **Repeat Tier (Optional)** - If set to true, all the immediately following tiers will be ignored and this tier will be repeated at the same interval all the way to infinity. Defaults to False.

    ```json theme={null}
    {
    	"billingScheme": "GRADUATED",
    	"tiers": [
    		{
    			"name": "10_rs_for_quantity_below_100",
    			"upTo": 100,
    			"unitPrice": 10,
    			"flatPrice": 50
    		}, {
    			"name": "8_rs_for_quantity_above_100_but_less_than_500",
    			"upTo": 500,
    			"unitPrice": 8
    		}, {
    			"name": "2_percent_for_quantity_above_500",
    			"upTo": infinity,
    			"unitPrice": 2,
    			"isPercentage": True
    		}
    	]
    }
    ```
  </Tab>
</Tabs>


## OpenAPI

````yaml POST /billing/ratecard
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/ratecard:
    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_rate_card
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRateCardRequestModel'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateCardResponseModel'
components:
  schemas:
    CreateRateCardRequestModel:
      type: object
      required:
        - feeComponentId
        - name
      properties:
        name:
          type: string
          description: The name of the rate card.
        description:
          $ref: 877cd209-22a0-435c-9db9-707a64d979ce
          description: >-
            Pricing strategy details for the rate card, including billing
            scheme, tiers, and prorated settings.
        feeComponentId:
          type: string
          description: Identifier of the fee component associated with this rate card.
        currency:
          type: string
          description: >-
            Currency used for this rate card. Must be a valid ISO 4217 currency
            code. See: https://www.iso.org/iso-4217-currency-codes.html
          example: INR
        currencyId:
          type: string
          description: Optional currency identifier if multiple currencies are supported.
        tags:
          type: object
          description: >-
            Custom key-value tags for categorizing or labeling the rate card.
            Multiple key-value pairs can be added dynamically.
          additionalProperties:
            type: string
        ratecardDescription:
          type: string
          description: >-
            Detailed description of the rate card, visible to users. See:
            https://docs.valyx.com/api-reference/endpoint/ratecard#rate-card-description
        contractId:
          type: string
          description: Optional associated contract ID for this rate card.
        isDefault:
          type: boolean
          description: Indicates whether this rate card is the default for the company.
          default: false
        isTierSplitEnabled:
          type: boolean
          description: >-
            Indicates if tier-wise split pricing is enabled. Only valid for
            graduated billing schemes.
          default: false
        startDate:
          type: string
          format: date
          description: Optional start date of the rate card.
        endDate:
          type: string
          format: date
          description: Optional end date of the rate card.
        fallBackRatecardId:
          type: string
          description: >-
            Required if the rate card has start or end dates; used as fallback
            for timed rate cards.
    RateCardResponseModel:
      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:
          $ref: '#/components/schemas/RateCardResponseData'
          description: Data object containing the result of the operation.
    RateCardResponseData:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the created or updated rate card.

````