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

# Update Pricing Module

> Update an existing pricing module. The `code` and `serviceCode` fields identify which pricing module to update. `planType` cannot be changed after creation. `abstract` and `chargeType` are not sent on update.



## OpenAPI

````yaml POST /billspree/tariffs/update-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/update-tariff:
    post:
      tags:
        - Pricing Modules
      summary: Update Pricing Module
      description: >-
        Update an existing pricing module. The `code` and `serviceCode` fields
        identify which pricing module to update. `planType` cannot be changed
        after creation. `abstract` and `chargeType` are not sent on update.
      operationId: updateTariff
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTariffRequest'
            example:
              method: Update
              action: Update Plan
              apiVersion: v2
              tariff:
                serviceCode: DEMO-001
                code: DemoPlan
                name: Demo Plan Updated
                uniqueLabel: DemoPlan
                description: Updated description
                parentTariffCode: null
                planType: BASE_PLAN
                custom: 1
                visibility: Public
                billingPeriodID: null
                valueFormulas: []
                componentRules: []
                usageData: []
                securityAttributes: []
      responses:
        '200':
          description: Plan updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericSuccessResponse'
              example:
                success: true
                statusCode: 200
                message: Request Succeeded.
                error: null
                data: {}
components:
  schemas:
    UpdateTariffRequest:
      type: object
      required:
        - method
        - action
        - apiVersion
        - tariff
      properties:
        method:
          type: string
          description: Always `"Update"`
          example: Update
        action:
          type: string
          description: Always `"Update Plan"`
          example: Update 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)

````