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

# Create Pricing Module

> Create a new pricing module under a pricing template. A pricing module defines the pricing logic (component rules, value formulas) applied when generating bills. A plan is a pricing module that can be directly subscribed to.



## OpenAPI

````yaml POST /billspree/tariffs/create-tariff
openapi: 3.1.0
info:
  title: Billspree API
  description: REST API for Billspree — billing, AR management, and workspace operations.
  version: 1.0.0
servers:
  - url: https://{workspace}.spreesuite.com
    variables:
      workspace:
        default: your-workspace
        description: Your organization's subdomain (e.g. demo → demo.spreesuite.com)
security:
  - apiKeyAuth: []
paths:
  /billspree/tariffs/create-tariff:
    post:
      tags:
        - Pricing Modules
      summary: Create Pricing Module
      description: >-
        Create a new pricing module under a pricing template. A pricing module
        defines the pricing logic (component rules, value formulas) applied when
        generating bills. A plan is a pricing module that can be directly
        subscribed to.
      operationId: createTariff
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTariffRequest'
            example:
              method: Create
              action: Create Plan
              apiVersion: v2
              tariff:
                serviceCode: DEMO-001
                code: DemoPlan
                name: Demo Plan
                uniqueLabel: DemoPlan
                description: null
                parentTariffCode: null
                planType: BASE_PLAN
                chargeType: Postpaid
                abstract: 0
                custom: 1
                visibility: Public
                billingPeriodID: null
                valueFormulas: []
                componentRules: []
                usageData: []
                securityAttributes: []
      responses:
        '200':
          description: Plan created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
              example:
                success: true
                statusCode: 200
                message: Request Succeeded.
                error: null
                data: {}
components:
  schemas:
    CreateTariffRequest:
      type: object
      required:
        - method
        - action
        - apiVersion
        - tariff
      properties:
        method:
          type: string
          description: Always `"Create"`
          example: Create
        action:
          type: string
          description: Always `"Create Plan"`
          example: Create Plan
        apiVersion:
          type: string
          description: Always `"v2"`
          example: v2
        tariff:
          $ref: '#/components/schemas/TariffPayload'
    GenericSuccessResponse:
      type: object
      properties:
        success:
          type: boolean
        statusCode:
          type: integer
        message:
          type: string
        error:
          nullable: true
        data:
          type: object
    TariffPayload:
      type: object
      required:
        - serviceCode
        - code
        - name
        - uniqueLabel
        - planType
        - chargeType
        - abstract
        - custom
        - visibility
        - valueFormulas
        - componentRules
        - usageData
        - securityAttributes
      properties:
        serviceCode:
          type: string
          description: Pricing template this plan belongs to
        code:
          type: string
          description: >-
            Unique plan code within the template. Used as the stable identifier
            on updates — cannot be changed
        name:
          type: string
          description: Display name of the plan
        uniqueLabel:
          type: string
          description: >-
            Workspace-wide unique label — used for plan linking (e.g. linking an
            ADDON_PLAN to its BASE_PLAN across templates)
        description:
          type: string
          nullable: true
          description: Description
        parentTariffCode:
          type: string
          nullable: true
          description: >-
            Code of the parent plan to inherit from. Child plans inherit
            component rules and value formulas and can override individual
            components
        planType:
          type: string
          description: '`"BASE_PLAN"` or `"ADDON_PLAN"`. Cannot be changed after creation'
        chargeType:
          type: string
          description: '`"Postpaid"` or `"Prepaid"`. Not sent on update'
        abstract:
          type: integer
          description: >-
            `1` = template plan (not directly subscribable), `0` = concrete
            plan. Not sent on update
        custom:
          type: integer
          description: '`1` = custom pricing allowed, `0` = fixed pricing'
        visibility:
          type: string
          description: '`"Public"` or `"Private"`'
        billingPeriodID:
          type: integer
          nullable: true
          description: Linked billing schedule ID (for BASE_PLAN)
        valueFormulas:
          type: array
          description: Value formula components — send `[]` if unused
          items: {}
        componentRules:
          type: array
          description: >-
            Pricing component rules — each entry maps to a component on the
            pricing template. Send `[]` for no charges. Plans with active
            subscriptions (`connCount > 0`) — changes here affect future billing
            runs
          items: {}
        usageData:
          type: array
          description: Usage/metered data configuration — send `[]` if unused
          items: {}
        securityAttributes:
          type: array
          description: Access control attributes — send `[]` if unused
          items: {}
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Auth token returned from the login endpoint. Send as: `Authorization:
        <token>` (no Bearer prefix)

````