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

# Update billable metric



## OpenAPI

````yaml specs/billing_api_docs.json put /api/v1/billable-metric/{code}
openapi: 3.0.1
info:
  title: Billing API
  description: Billing service for managing subscriptions, payments, and entitlements
  contact: {}
  version: '1.0'
servers:
  - url: https://dev-billing-api.iqraa.ai/api/v1
security: []
tags:
  - name: Customers
    description: Customers related endpoints
  - name: Subscriptions
    description: Subscription related endpoints
  - name: Plans
    description: Plans related endpoints
  - name: Entitlements
    description: Entitlements related endpoints
  - name: Payments
    description: Payments related endpoints
  - name: Emails
    description: Email related endpoints
paths:
  /api/v1/billable-metric/{code}:
    put:
      tags:
        - Billable Metric
      summary: Update billable metric
      operationId: BillableMetricController_updateBillableMetric
      parameters:
        - name: code
          required: true
          in: path
          description: The Code of the billable metrics
          example: storage
          schema:
            type: string
        - name: x-admin-api-key
          in: header
          description: The API key to access the admin API
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBillableMetricDto'
      responses:
        '200':
          description: Updates Billable Metric
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateBillableMetricDto'
        '400':
          description: Bad Request - Invalid metric data
        '401':
          description: Unauthorized - Missing or invalid admin API key
        '404':
          description: Not Found - Billable metric not found
      security:
        - bearer: []
components:
  schemas:
    UpdateBillableMetricDto:
      type: object
      properties:
        name:
          type: string
          example: Storage
        description:
          type: string
          example: storage billable metric
        recurring:
          type: boolean
          example: false
        aggregatorType:
          type: string
          enum:
            - count_agg
            - sum_agg
            - max_agg
            - unique_count_agg
            - weighted_sum_agg
            - latest_agg
          example: sum_agg
          description: Billing Aggregator
        fieldName:
          type: string
          example: gb
          description: aggregating usage data
      required:
        - name
        - description
        - recurring
        - aggregatorType
        - fieldName
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: opaque
      type: http

````