Generate IRN

You can generate an IRN by sending a POST request to E-Invoicing API with the following request headers.

Taxpayers with AATO greater than or equal to 100 crores have to report the invoices to the IRP portal within 30 days of it's issuance.

Request URL

POST: {{HOST}}/einv/v1/govt/api/Invoice/

Request Headers

ParameterTypeDescription

x-cleartax-auth-token

String

Mandatory. The access token generated for the workspace.

x-cleartax-product

String

Should always be "EInvoice" without the double quotes.

gstin

String

Users GSTIN

Content-Type

String

Mandatory. This will always be "application/json".

branch

String

Optional. Branch name for the user.

Request Parameters

Refer to the E-Invoice Object schema.

Sample Request Body

{
  "Version": "1.1",
  "TranDtls": {
    "TaxSch": "GST",
    "SupTyp": "B2B",
    "RegRev": "N",
    "EcmGstin": null,
    "IgstOnIntra": "N"
  },
  "DocDtls": {
    "Typ": "INV",
    "No": "DOC/007",
    "Dt": "12/12/2020"
  },
  "SellerDtls": {
    "Gstin": "24AAFCD5862R005",
    "LglNm": "NIC company pvt ltd",
    "TrdNm": "NIC Industries",
    "Addr1": "5th block, kuvempu layout",
    "Addr2": "kuvempu layout",
    "Loc": "GANDHINAGAR",
    "Pin": 382010,
    "Stcd": "24",
    "Ph": "9000000000",
    "Em": "abc@gmail.com"
  },
  "BuyerDtls": {
    "Gstin": "29AWGPV7107B1Z1",
    "LglNm": "XYZ company pvt ltd",
    "TrdNm": "XYZ Industries",
    "Pos": "12",
    "Addr1": "7th block, kuvempu layout",
    "Addr2": "kuvempu layout",
    "Loc": "GANDHINAGAR",
    "Pin": 562160,
    "Stcd": "29",
    "Ph": "91111111111",
    "Em": "xyz@yahoo.com"
  },
  "DispDtls": {
    "Nm": "ABC company pvt ltd",
    "Addr1": "7th block, kuvempu layout",
    "Addr2": "kuvempu layout",
    "Loc": "Banagalore",
    "Pin": 562160,
    "Stcd": "29"
  },
  "ShipDtls": {
    "Gstin": "29AWGPV7107B1Z1",
    "LglNm": "CBE company pvt ltd",
    "TrdNm": "kuvempu layout",
    "Addr1": "7th block, kuvempu layout",
    "Addr2": "kuvempu layout",
    "Loc": "Banagalore",
    "Pin": 562160,
    "Stcd": "29"
  },
  "ItemList": [
    {
      "SlNo": "1",
      "PrdDesc": "Rice",
      "IsServc": "N",
      "HsnCd": "10019920",
      "Barcde": "123456",
      "Qty": 100.345,
      "FreeQty": 10,
      "Unit": "BAG",
      "UnitPrice": 99.545,
      "TotAmt": 9988.84,
      "Discount": 10,
      "PreTaxVal": 1,
      "AssAmt": 9978.84,
      "GstRt": 12.0,
      "IgstAmt": 1197.46,
      "CgstAmt": 0,
      "SgstAmt": 0,
      "CesRt": 5,
      "CesAmt": 498.94,
      "CesNonAdvlAmt": 10,
      "StateCesRt": 12,
      "StateCesAmt": 1197.46,
      "StateCesNonAdvlAmt": 5,
      "OthChrg": 10,
      "TotItemVal": 12897.7,
      "OrdLineRef": "3256",
      "OrgCntry": "AG",
      "PrdSlNo": "12345",
      "BchDtls": {
        "Nm": "123456",
        "ExpDt": "01/08/2020",
        "WrDt": "01/09/2020"
      },
      "AttribDtls": [
        {
          "Nm": "Rice",
          "Val": "10000"
        }
      ]
    }
  ],
  "ValDtls": {
    "AssVal": 9978.84,
    "CgstVal": 0,
    "SgstVal": 0,
    "IgstVal": 1197.46,
    "CesVal": 508.94,
    "StCesVal": 1202.46,
    "Discount": 10,
    "OthChrg": 20,
    "RndOffAmt": 0.3,
    "TotInvVal": 12908,
    "TotInvValFc": 12897.7
  },
  "PayDtls": {
    "Nm": "ABCDE",
    "AccDet": "5697389713210",
    "Mode": "Cash",
    "FinInsBr": "SBIN11000",
    "PayTerm": "100",
    "PayInstr": "Gift",
    "CrTrn": "test",
    "DirDr": "test",
    "CrDay": 100,
    "PaidAmt": 10000,
    "PaymtDue": 5000
  },
  "RefDtls": {
    "InvRm": "TEST",
    "DocPerdDtls": {
      "InvStDt": "12/12/2020",
      "InvEndDt": "12/12/2020"
    },
    "PrecDocDtls": [
      {
        "InvNo": "DOC/002",
        "InvDt": "12/12/2020",
        "OthRefNo": "123456"
      }
    ],
    "ContrDtls": [
      {
        "RecAdvRef": "Doc/003",
        "RecAdvDt": "01/08/2020",
        "TendRefr": "Abc001",
        "ContrRefr": "Co123",
        "ExtRefr": "Yo456",
        "ProjRefr": "Doc-456",
        "PORefr": "Doc-789",
        "PORefDt": "01/08/2020"
      }
    ]
  },
  "AddlDocDtls": [
    {
      "Url": "https://einv-apisandbox.nic.in",
      "Docs": "Test Doc",
      "Info": "Document Test"
    }
  ],
  "ExpDtls": {
    "ShipBNo": "A-248",
    "ShipBDt": "12/12/2020",
    "Port": "INABG1",
    "RefClm": "N",
    "ForCur": "AED",
    "CntCode": "AE"
  },
  "EwbDtls": {
    "TransId": "12AWGPV7107B1Z1",
    "TransName": "XYZ EXPORTS",
    "Distance": 100,
    "TransDocNo": "DOC01",
    "TransDocDt": "12/12/2020",
    "VehNo": "ka123456",
    "VehType": "R",
    "TransMode": "1"
  }
}

Since you can generate IRN for an invoice only once, make sure to change the Document Number DocDtls.No for every new request.

Response Parameters

  • For successful request

Parameter

Type

Description

Success

String

"Y" if the request is successful,

"N" otherwise

AckNo

Long

Acknowledgement Number

AckDt

String

Format YYYY-MM-DD HH:MM:SS,

Acknowledgement date

Irn

String

Invoice Reference Number. SHA256 hash of Gstin, DocDtls.No, DocDtls.Typ, financial year of DoctDtls.Dt

There is no need to decode or decrypt this string.

SignedInvoice

String

Signed Invoice Data

SignedQRCode

String

QR Code for Invoice

Status

String

"ACT" for active invoice,

"CNL" for cancelled invoice

EwbNo

Number

E-waybill number. This will be null if E-Waybill is not generated.

EwbDt

String

E-Waybill date. This will be null if E-Waybill is not generated.

EwbValidTill

String

E-waybill valid till. This will be null if E-Waybill is not generated.

  • For failed request

Parameter

Type

Description

Success

String

"N" for failed request

ErrorDetails

Array of Error Detail

Details of all errors

Info

Array of Info Detail

Additional Information

Error Details

Parameter

Type

Description

error_code

String

Error Code

error_message

String

Error Message

error_source

String

Error Source can either be GOVT or CLEARTAX

error_id

String

Optional

Info Details

Parameter

Type

Description

InfCd

String

Information Code

Desc

Object

Description or additional details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