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

# Void credit

Immediately voids a credit. If the credit is already expired or has already been consumed, nothing will happen.

<CodeGroup>
  ```py Python theme={null}
  lotus.void_credit(credit_id='credit_0569173ee6654369')
  ```

  ```ts Typescript theme={null}
  await lotus.voidCredit({
    credit_id: "credit_0569173ee6654369",
  });
  ```
</CodeGroup>


## OpenAPI

````yaml POST /api/credits/{credit_id}/void/
openapi: 3.0.3
info:
  title: Lotus API
  version: 0.9.3
  description: >-
    Lotus is an open-core pricing and billing engine. We enable API companies to
    automate and optimize their custom usage-based pricing for any metric.
servers: []
security: []
paths:
  /api/credits/{credit_id}/void/:
    post:
      tags:
        - api
      operationId: api_credits_void_create
      parameters:
        - in: path
          name: credit_id
          schema:
            type: string
          description: The ID of the credit to retrieve or update.
          required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerBalanceAdjustment'
          description: ''
      security:
        - knoxTokenAuth: []
        - OrganizationApiKeyAuth: []
          TokenAuth: []
components:
  schemas:
    CustomerBalanceAdjustment:
      type: object
      properties:
        credit_id:
          type: string
        customer:
          $ref: '#/components/schemas/LightweightCustomer'
        amount:
          type: number
          format: double
          maximum: 10000000000
          minimum: 0
          exclusiveMaximum: true
        amount_remaining:
          type: number
          format: double
          maximum: 10000000000
          minimum: 0
          exclusiveMaximum: true
          readOnly: true
        currency:
          $ref: '#/components/schemas/PricingUnit'
        description:
          type: string
          nullable: true
          readOnly: true
        effective_at:
          type: string
          format: date-time
          readOnly: true
        expires_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        status:
          enum:
            - active
            - inactive
          type: string
          description: |-
            * `active` - Active
            * `inactive` - Inactive
          readOnly: true
        amount_paid:
          type: number
          format: double
          maximum: 10000000000
          minimum: -10000000000
          exclusiveMaximum: true
          exclusiveMinimum: true
          readOnly: true
        amount_paid_currency:
          allOf:
            - $ref: '#/components/schemas/PricingUnit'
          nullable: true
        drawdowns:
          type: array
          items:
            $ref: '#/components/schemas/CreditDrawdown'
          readOnly: true
      required:
        - amount
        - amount_paid
        - amount_paid_currency
        - amount_remaining
        - credit_id
        - currency
        - customer
        - description
        - drawdowns
        - effective_at
        - expires_at
        - status
    LightweightCustomer:
      type: object
      properties:
        customer_name:
          type: string
          readOnly: true
          nullable: true
          description: The display name of the customer
        email:
          type: string
          format: email
          readOnly: true
          nullable: true
          description: >-
            The primary email address of the customer, must be the same as the
            email address used to create the customer in the payment provider
        customer_id:
          type: string
          readOnly: true
          nullable: true
          description: >-
            The id provided when creating the customer, we suggest matching with
            your internal customer id in your backend
      required:
        - customer_id
        - customer_name
        - email
    PricingUnit:
      type: object
      properties:
        code:
          type: string
          maxLength: 10
        name:
          type: string
          maxLength: 100
        symbol:
          type: string
          maxLength: 10
      required:
        - code
        - name
        - symbol
    CreditDrawdown:
      type: object
      properties:
        credit_id:
          type: string
        amount:
          type: number
          format: double
          maximum: 0
          minimum: -10000000000
          exclusiveMinimum: true
        description:
          type: string
          nullable: true
        applied_at:
          type: string
          format: date-time
      required:
        - amount
        - applied_at
        - credit_id
  securitySchemes:
    knoxTokenAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Token-based authentication with required prefix "Token"
    OrganizationApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````