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

# Void credit

> Void credit



## OpenAPI

````yaml post /credits/{credit_id}/void
openapi: 3.0.3
info:
  version: '1.0'
  title: Togai Apis
  contact:
    email: engg@togai.com
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  description: APIs for Togai App
servers:
  - description: Api endpoint
    url: https://api.togai.com/
  - description: Sandbox api endpoint
    url: https://sandbox-api.togai.com/
security:
  - bearerAuth: []
tags:
  - name: Customers
    description: Customer level calls
  - name: Accounts
    description: Account level calls
  - name: Event Schemas
    description: Event Schema level calls
  - name: Usage Meters
    description: Usage Meter level calls
  - name: Price Plans
    description: (DEPRECATED) Price Plan level calls
  - name: PricePlanV2
    description: Price Plan V2 level calls
  - name: Schedules
    description: Account Schedule level calls
  - name: Pricing Rules
    description: Pricing Rules level calls
  - name: Settings
    description: Settings
  - name: Price Experimentation
    description: Price Experimentation apis
  - name: InvoiceGroups
    description: Invoice Group level calls
  - name: Organization
    description: Organization level calls
  - name: FileStorage
    description: File Storage level calls
  - name: Aliases
    description: Alias level calls
  - name: Reports
    description: Report level calls
  - name: ReportTemplates
    description: Report Template level calls
  - name: Customer Portal
    description: Portal level calls
  - name: Alerts
    description: Alert level calls
  - name: Event Management
    description: APIs for getting events ingested in Togai
    externalDocs:
      description: docs
      url: https://togai.com/docs/billing/events
  - name: Metrics
    description: APIs for getting Togai metrics
    externalDocs:
      description: docs
      url: https://togai.com/docs/metrics
  - name: Licenses
    description: APIs for getting or updating license records in Togai
  - name: Entitlements
    description: APIs related to entitlements
  - name: Invoices
    description: Invoices API
  - name: Credits
    description: Credits API
  - name: Wallet
    description: Wallet API
  - name: InvoiceTemplates
    description: InvoiceTemplates API
  - name: InvoiceSequence
    description: InvoiceSequence API
  - name: Payments
    description: Payments API
  - name: Authentication
    description: Authentication API
externalDocs:
  description: Find out more about Togai
  url: https://docs.togai.com/docs
paths:
  /credits/{credit_id}/void:
    post:
      tags:
        - Credits
      summary: Void credit
      description: Void credit
      operationId: voidCredit
      parameters:
        - $ref: '#/components/parameters/credit_id'
      responses:
        '200':
          $ref: '#/components/responses/VoidCreditResponse'
        '400':
          $ref: '#/components/responses/ErrorResponse'
        '401':
          $ref: '#/components/responses/ErrorResponse'
        '403':
          $ref: '#/components/responses/ErrorResponse'
        '404':
          $ref: '#/components/responses/ErrorResponse'
        '429':
          $ref: '#/components/responses/ErrorResponse'
        default:
          $ref: '#/components/responses/ErrorResponse'
components:
  parameters:
    credit_id:
      in: path
      name: credit_id
      required: true
      schema:
        type: string
        example: creds.1znQx9jiIXw.r44fc
  responses:
    VoidCreditResponse:
      description: Response for Void credit request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Credit'
          examples:
            Credit:
              $ref: '#/components/examples/VoidCreditResponse'
    ErrorResponse:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          examples:
            ErrorResponse:
              summary: Error message
              value:
                message: <Reason message>
  schemas:
    Credit:
      allOf:
        - $ref: '#/components/schemas/CreditRequest'
        - type: object
          additionalProperties: false
          required:
            - id
            - customerId
            - status
            - createdAt
          properties:
            id:
              description: Identifier of credits
              type: string
              maxLength: 50
              example: cred.1znqBOVcai0.0tBFz
            customerId:
              type: string
              example: 7VcRw9xZDIqsC5E
            status:
              type: string
              enum:
                - ACTIVE
                - CONSUMED
                - EXPIRED
                - VOIDED
              example: ACTIVE
            creditUnit:
              type: string
              example: USD
            holdAmount:
              type: number
              example: 500
            consumedAmount:
              type: number
              example: 400
            createdAt:
              type: string
              format: date-time
            updatedAt:
              type: string
              format: date-time
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - message
      properties:
        message:
          type: string
          description: error description
          maxLength: 500
    CreditRequest:
      description: Payload to grant Credits
      type: object
      additionalProperties: false
      required:
        - accountId
        - effectiveFrom
        - priority
        - purpose
      properties:
        accountId:
          type: string
          example: ACC001
        purpose:
          type: string
          example: PREPAID_CREDIT
        applicableEntityIds:
          description: >
            List of entity ids for which the credit is applicable. If null or
            empty, the credit is applicable to all ids. This list can accept
            special values like: - ALL_USAGE_METER_RATE_CARDS: To apply the
            credit to all usage meter rate cards - ALL_FIXED_FEE_RATE_CARDS: To
            apply the credit to all fixed fee rate cards
          type: array
          uniqueItems: true
          items:
            type: string
            example:
              - umg.1znQx9jiIXw.r44fc
              - ALL_USAGE_METER_RATE_CARDS
              - ALL_FIXED_FEE_RATE_CARDS
        effectiveFrom:
          type: string
          format: date
          example: '2020-07-04'
        effectiveUntil:
          type: string
          format: date
          example: '2021-07-04'
        creditAmount:
          type: number
          example: 1000
        priority:
          type: integer
          example: 1
        grantorId:
          description: The entity through which the credit has been granted
          type: string
        idempotencyKey:
          description: The idempotency key for uniqueness of the credit record
          type: string
  examples:
    VoidCreditResponse:
      summary: A sample Credit
      value:
        accountId: biswa
        purpose: credits
        effectiveFrom: '2024-03-06'
        priority: 1
        id: cred.22LLLScunZg.om5kC
        customerId: biswa
        status: VOIDED
        createdAt: '2024-03-13T12:33:39.986252Z'
        applicableEntityIds: []
        effectiveUntil: '2025-03-06'
        creditAmount: 10
        grantorId: addon.22IZs2ZVEnw.0zDFe
        creditUnit: USD
        holdAmount: 0
        consumedAmount: 0
        updatedAt: '2024-03-13T12:42:33.489822Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer <credential>

````