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

# Cancel Invoice Route

> Void an invoice in Stripe and record VOID on its transaction.

``invoice_id`` is the Stripe invoice id (``providerTransactionId``), and it
is checked against the wallet, so an invoice cannot be voided through a
wallet it does not belong to. Already-voided and paid invoices are refused.



## OpenAPI

````yaml https://api.primeintellect.ai/openapi.json post /api/admin/invoices/{wallet_id}/{invoice_id}/cancel
openapi: 3.1.0
info:
  title: PI API
  version: 0.1.0
servers:
  - url: https://api.primeintellect.ai
security: []
paths:
  /api/admin/invoices/{wallet_id}/{invoice_id}/cancel:
    post:
      tags:
        - admin-invoices
      summary: Cancel Invoice Route
      description: >-
        Void an invoice in Stripe and record VOID on its transaction.


        ``invoice_id`` is the Stripe invoice id (``providerTransactionId``), and
        it

        is checked against the wallet, so an invoice cannot be voided through a

        wallet it does not belong to. Already-voided and paid invoices are
        refused.
      operationId: >-
        cancel_invoice_route_api_admin_invoices__wallet_id___invoice_id__cancel_post
      parameters:
        - name: wallet_id
          in: path
          required: true
          schema:
            type: string
            title: Wallet Id
        - name: invoice_id
          in: path
          required: true
          schema:
            type: string
            title: Invoice Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenericResponse_dict_'
        '401':
          description: Authorization failed
        '403':
          description: Insufficient permissions
        '422':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - HTTPBearer: []
components:
  schemas:
    GenericResponse_dict_:
      properties:
        data:
          anyOf:
            - type: object
            - type: 'null'
          title: Data
          description: Response data
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
          description: Response status
      type: object
      title: GenericResponse[dict]
    ErrorResponse:
      properties:
        errors:
          items:
            $ref: '#/components/schemas/ErrorDetail'
          type: array
          title: Errors
      type: object
      required:
        - errors
      title: ErrorResponse
    ErrorDetail:
      properties:
        param:
          type: string
          title: Param
        details:
          type: string
          title: Details
      type: object
      required:
        - param
        - details
      title: ErrorDetail
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````