> ## 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 a charge



## OpenAPI

````yaml specs/billing_api_docs.json patch /api/v1/charges/{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/charges/{id}:
    patch:
      tags:
        - charges
      summary: Update a charge
      operationId: ChargesController_update
      parameters:
        - name: id
          required: true
          in: path
          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/UpdateChargeDto'
      responses:
        '200':
          description: Charge updated successfully
        '400':
          description: Bad Request - Invalid charge data
        '401':
          description: Unauthorized - Missing or invalid admin API key
        '404':
          description: Not Found - Charge not found
        '409':
          description: Conflict - Charge with same code already exists
      security:
        - bearer: []
components:
  schemas:
    UpdateChargeDto:
      type: object
      properties:
        name:
          type: string
          description: The name of the charge
          example: Extra Storage
        code:
          type: string
          description: Unique code identifier for the charge
          example: extra_storage
        description:
          type: string
          description: Description of the charge
          example: Additional storage space for your account
        amount:
          type: number
          description: The price of the charge
          example: 1000
          minimum: 0
        currency:
          type: string
          description: The currency for the charge
          example: USD
        entitlementCode:
          type: string
          description: The entitlement code this charge is associated with
          example: EXTRA_STORAGE_ENTITLEMENT
        billableMetricOverrides:
          type: object
          description: Optional overrides for billable metric configuration
          example:
            fieldName: storage_gb
            aggregatorType: sum
            description: Total storage used in GB
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: opaque
      type: http

````