> ## 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 billing config

> Updates a billing config with the provided details. Note: This endpoint is restricted for internal use only.



## OpenAPI

````yaml specs/billing_api_docs.json put /api/v1/billing-configs/{id}
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/billing-configs/{id}:
    put:
      tags:
        - Billing Configs
      summary: Update billing config
      description: >-
        Updates a billing config with the provided details. Note: This endpoint
        is restricted for internal use only.
      operationId: BillingConfigController_update
      parameters:
        - name: x-admin-api-key
          in: header
          description: The API key to access the admin API
          required: true
          schema:
            type: string
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateBillingConfigDto'
      responses:
        '200':
          description: Billing config updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateBillingConfigDto'
        '400':
          description: Bad Request - Invalid billing config data
        '401':
          description: Unauthorized - Missing or invalid admin API key
        '404':
          description: Not Found - Billing config not found
      security:
        - bearer: []
components:
  schemas:
    UpdateBillingConfigDto:
      type: object
      properties:
        configValue:
          oneOf:
            - enum:
                - immediate
                - next_cycle
            - type: number
              minimum: 0
          description: Config value - either a type or grace period days
        status:
          type: string
          enum:
            - active
            - inactive
          example: active
        description:
          type: string
          example: Immediate Upgrade
          description: Description of the billing config
      required:
        - configValue
        - status
        - description
    CreateBillingConfigDto:
      type: object
      properties:
        configKey:
          oneOf:
            - enum:
                - timing_policy
            - type: string
              description: Plan code for grace periods
          description: Config key - either a type or plan code
        configValue:
          oneOf:
            - enum:
                - immediate
                - next_cycle
            - type: number
              minimum: 0
          description: Config value - either a type or grace period days
        configCategory:
          type: string
          example: upgrade
          description: Config key type (e.g. upgrade, downgrade, terminate)
        status:
          type: string
          example: active
          description: Status Type (e.g. active)
        description:
          type: string
          example: Immediate Upgrade
          description: Description of the billing config
      required:
        - configKey
        - configValue
        - configCategory
        - status
        - description
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: opaque
      type: http

````