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

# Cancel e-Invoice

> Cancel an e-Invoice by passing the invoice registration number (IRN).

#### Request body schema

<Card title="View request body schema" icon="code" href="https://raw.githubusercontent.com/in-co-sandbox/in-co-sandbox-docs/refs/heads/main/data/gst/schema/request/e-invoice/cancel_e_invoice.json" arrow="true" horizontal />


## OpenAPI

````yaml api-reference/gst/compliance/openapi.json POST /gst/compliance/e-invoice/tax-payer/invoice/{irn}/cancel
openapi: 3.0.1
info:
  title: compliance
  description: >-
    **GST Compliance API** enables businesses to automate compliance
    requirements like [Taxpayer
    verification](https://developer.sandbox.co.in/reference/search-gstin-api),
    [GSTR
    Filing](https://developer.sandbox.co.in/reference/gst-taxpayer-authentication),
    [Generating
    E-Invoices](https://developer.sandbox.co.in/reference/e-invoice-authentication-api),
    and [E-Way
    Bills](https://developer.sandbox.co.in/reference/e-way-bill-authentication-api).We
    provide these APIs from GSTN-authorised GST Suvidha Providers, handling the
    encryption-decryption and signing so you don't have to handle the
    complexities.
  version: 1.0.0
servers:
  - url: https://api.sandbox.co.in
  - url: https://test-api.sandbox.co.in
security: []
tags:
  - name: Public
  - name: Taxpayer
  - name: Taxpayer Auth
  - name: Returns
  - name: GSTR-1 Documents
  - name: File GSTR-1
  - name: GSTR-2A Documents
  - name: GSTR-2B Document
  - name: File GSTR-3B
  - name: GSTR-4
  - name: File GSTR-9
  - name: Invoice Management System
  - name: GSTR-1A Documents
  - name: File GSTR-1A
  - name: Ledgers
  - name: e-Invoice
  - name: Sales e-Invoices for return period
  - name: Purchase e-Invoices for return period
  - name: Front Office Notices
  - name: Front Office
  - name: AATO
  - name: e-Invoice1
  - name: Authentication
  - name: e-Invoice12
  - name: E-Way Bill
  - name: E-Way Bill1
  - name: Authentication1
  - name: Consignor
  - name: Consolidated E-Way Bill
  - name: Multi-Vehicle Movement
  - name: Consignee
  - name: Transporter
  - name: Consolidated E-Way Bill1
  - name: Multi-vehicle Movement
  - name: Common
paths:
  /gst/compliance/e-invoice/tax-payer/invoice/{irn}/cancel:
    post:
      tags:
        - e-Invoice1
        - e-Invoice12
      summary: Cancel E-Invoice
      operationId: cancelIrn
      parameters:
        - name: irn
          in: path
          description: ''
          required: true
          example: ''
          schema:
            type: string
        - name: authorization
          in: header
          description: >-
            E-Invoice access token. For token-generation steps, refer to the
            [Generate E-Invoice
            Session](/recipes/gst/authentication/generate_e_invoice_session)
            recipe, then pass the token in the authorization header.
          required: true
          example: ''
          schema:
            type: string
        - name: x-source
          in: header
          description: >-
            Specifies the source to access, either primary (NIC 1) or secondary
            (NIC 2)
          required: false
          example: ''
          schema:
            type: string
            enum:
              - primary
              - secondary
            default: primary
            example: primary
        - name: x-proxy
          in: header
          description: >-
            Enables criss-cross operations by routing requests through the
            specified source (e.g., access primary via secondary if primary is
            unavailable)
          required: false
          example: ''
          schema:
            type: string
            enum:
              - primary
              - secondary
            example: secondary
        - name: x-api-version
          in: header
          description: API version
          required: false
          example: ''
          schema:
            type: string
            default: 1.0.0
        - name: x-api-key
          in: header
          description: API key for identification
          required: true
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - Irn
                - CnlRsn
              properties:
                Irn:
                  type: string
                  description: IRN of E-Invoice to be cancelled
                CnlRsn:
                  type: string
                  description: >-
                    Cancel Reason. Possible values: 1 - Duplicate, 2 - Data
                    entry mistake, 3 - Order Cancelled, 4 - Others
                CnlRem:
                  type: string
                  description: Cancel Remarks
            examples:
              200 IRN cancelled:
                value:
                  Irn: >-
                    49a7c675b25f730d2353622e4767df203fed2495411953e0351737d47308d868
                  CnlRsn: '1'
                  CnlRem: Wrong entry
                summary: 200 IRN cancelled
              9999 IRN is not active:
                value:
                  Irn: >-
                    49a7c675b25f730d2353622e4767df203fed2495411953e0351737d47308d868
                  CnlRsn: '1'
                  CnlRem: Wrong entry
                summary: 9999 IRN is not active
              2270 More than 24 hrs old:
                value:
                  Irn: >-
                    467b434ef6b5f4562488f2934ca30aee372e53c124d5fa751da7b92dad6ee974
                  CnlRsn: '1'
                  CnlRem: Wrong entry
                summary: 2270 More than 24 hrs old
              2230 IRN cannot be cancelled as EWB is active:
                value:
                  Irn: >-
                    93106da01ab35e934ccf9ccf798b6c78cc8128307e268d819d69320cffa6985d
                  CnlRsn: '3'
                  CnlRem: Wrong entry
                summary: 2230 IRN cannot be cancelled as EWB is active
              2143 IRN doesn't belong to user:
                value:
                  Irn: >-
                    6b7aff92f6214c1acad5280128d67042baea53d31671e16a892c71d5ff648de
                  CnlRsn: '3'
                  CnlRem: Wrong entry
                summary: 2143 IRN doesn't belong to user
      responses:
        '200':
          description: >-
            200 IRN cancelled / 9999 IRN is not active / 2270 More than 24 hrs
            old / 2230 IRN cannot be cancelled as EWB is active / 2143 IRN
            doesn't belong to user
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: number
                    example: 200
                  data:
                    type: object
                    properties:
                      Data:
                        type: object
                        properties:
                          CancelDate:
                            type: string
                            example: '2023-03-30 17:11:00'
                          Irn:
                            type: string
                            example: >-
                              49a7c675b25f730d2353622e4767df203fed2495411953e0351737d47308d868
                        nullable: true
                      ErrorDetails:
                        type: array
                        items:
                          type: object
                          properties:
                            ErrorCode:
                              type: string
                            ErrorMessage:
                              type: string
                        nullable: true
                        example:
                          - ErrorCode: '2154'
                            ErrorMessage: IRN details are not found
                      InfoDtls:
                        type: array
                        items:
                          type: object
                          properties:
                            InfoCode:
                              type: string
                            InfoMessage:
                              type: string
                        nullable: true
                        example: null
                      Status:
                        type: number
                        example: 1
                  timestamp:
                    type: number
                    example: 1763446641000
                  transaction_id:
                    type: string
                    example: 4b8e067e-eb06-42bb-bd23-3fe49f89a2a3
              examples:
                200 IRN cancelled:
                  summary: 200 IRN cancelled
                  value:
                    code: 200
                    data:
                      Data:
                        CancelDate: '2023-03-30 17:11:00'
                        Irn: >-
                          49a7c675b25f730d2353622e4767df203fed2495411953e0351737d47308d868
                      ErrorDetails: null
                      InfoDtls: null
                      Status: 1
                    timestamp: 1763446641000
                    transaction_id: 4b8e067e-eb06-42bb-bd23-3fe49f89a2a3
                2143 IRN doesn't belong to user:
                  summary: 2143 IRN doesn't belong to user
                  value:
                    code: 200
                    data:
                      Data: null
                      ErrorDetails:
                        - ErrorCode: '2143'
                          ErrorMessage: Invoice does not belongs to the user GSTIN
                      InfoDtls: null
                      Status: 0
                    timestamp: 1763446641000
                    transaction_id: 55c9329b-6640-4bf4-bc38-7b38b434081d
                2230 IRN cannot be cancelled as EWB is active:
                  summary: 2230 IRN cannot be cancelled as EWB is active
                  value:
                    code: 200
                    data:
                      Data: null
                      ErrorDetails:
                        - ErrorCode: '2230'
                          ErrorMessage: >-
                            This IRN cannot be cancelled because  e-way bill has
                            been generated , you can cancel   e-way bill and
                            then try cancelling IRN
                      InfoDtls: null
                      Status: 0
                    timestamp: 1763446641000
                    transaction_id: 6835b2f4-53f1-46d4-bacd-1b17e02b4594
                2270 More than 24 hrs old:
                  summary: 2270 More than 24 hrs old
                  value:
                    code: 200
                    data:
                      Data: null
                      ErrorDetails:
                        - ErrorCode: '2270'
                          ErrorMessage: >-
                            The allowed cancellation time limit is crossed, you
                            cannot cancel the IRN
                      InfoDtls: null
                      Status: 0
                    timestamp: 1763446641000
                    transaction_id: 7ccca1c2-08de-4845-8ed6-8c1fb5528d4e
                9999 IRN is not active:
                  summary: 9999 IRN is not active
                  value:
                    code: 200
                    data:
                      Data: null
                      ErrorDetails:
                        - ErrorCode: '9999'
                          ErrorMessage: Invoice is not active
                      InfoDtls: null
                      Status: 0
                    timestamp: 1763446641000
                    transaction_id: 16cc3d37-0ecd-4b07-b063-ca32f4fe54f3
          headers: {}
      deprecated: false
      security: []

````