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

# Cancel a document



## OpenAPI

````yaml delete /v2/doc/{doc_hash_id}
openapi: 3.0.1
info:
  title: SwipeAPI
  description: Partner API
  version: '2.0'
servers:
  - url: https://app.getswipe.in/api/partner
security:
  - bearerAuth: []
tags:
  - name: Document
    description: Document related operations
  - name: Customer
    description: Customer related operations
  - name: Payment
    description: Payment related operations
  - name: Product
    description: Product related operations
  - name: Utility
    description: Generic operations
  - name: Subscriptions
    description: Subscriptions related operations
  - name: Document V2
    description: Document related operations
  - name: Customer V2
    description: Customer related operations
  - name: Payment V2
    description: Payment related operations
  - name: Product V2
    description: Product related operations
  - name: Subscriptions V2
    description: Subscriptions related operations
  - name: Utility V2
    description: Generic operations
  - name: Vendor V2
    description: Vendor related operations
  - name: EwayBill
    description: EwayBill related operations
  - name: Inventory V2
    description: Inventory related operations
paths:
  /v2/doc/{doc_hash_id}:
    delete:
      tags:
        - Document V2
      summary: Cancel a document
      operationId: v2_delete_invoice
      parameters:
        - name: doc_hash_id
          in: path
          description: The hash id of the document to be cancelled
          required: true
          schema:
            type: string
        - name: cancel_einvoice
          in: query
          description: Set to 1 if you want to cancel a document with e-invoice
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocResponseV2'
components:
  schemas:
    DocResponseV2:
      type: object
      properties:
        success:
          type: boolean
          example: true
          default: true
        message:
          type: string
          description: Success Message
          example: Message
        error_code:
          type: string
          description: Error Code
          example: ''
        errors:
          type: object
          properties: {}
          description: Error details
        data:
          $ref: '#/components/schemas/Data'
    Data:
      type: object
      properties:
        hash_id:
          type: string
          description: Hash ID
          example: SL123
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication header of the form Bearer <token>, where <token>
        is your auth token.

````