Generate IRN With Notification#
Generate IRN With Notification API supports creation of e-invoice with Notification. It is an asynchronous API, task id will be returned as a response.
Given a task ID, user could check the task status using task Status API.
When status of task is completed
, notification would be sent to users(seller/buyer/both) depending upon the meta details provided and user can download the result of task using task Download API.
Along with generation of IRN, optionally you will be able to generate PDF and send emails with only json response, only pdf response or both to either self or counter parties.
Route
/enriched/einv/{flynn-version}/{irp}/invoice
- active ‘flynn-version’: v1.0
- method: POST
URL Parameters#
Name | Description | Type |
---|---|---|
flynn-version | version of the API for example, v1.0 |
string |
irp | IRP Provider as per GST registration for e-invoicing | enum (ni1, ni2) |
Headers#
All headers as mentioned in the Enriched E-Invoice API introduction.
Tip
The only valid values for the header keys Content-Type
and accept
must have to be application/json
.
Request#
Body consists of two sections, “payload” and “meta”.
payload
contains actual E-invoice document (invoice, credit note or debit note) information for which IRN that has to be generated.
meta
section of the request body consists of meta information for the call i.e., buyer and seller email id(only one email id for each) to whom email will be sent on successful/unsuccessful IRN generation with/without pdf or json.
The schema of the payload is guided by the NIC portal. Please check the published documentation.
Sample Request Body - with an email of buyer with send-json
and send-pdf
as true to send the PDF and json to, after successful generation of IRN and email of seller with send-json
and send-pdf
as true and notify for both successful and unsuccessful generation of IRN. Buyer will be notified only after successful generation of IRN
{
"payload": {
"Version": "1.1",
"Irn": "",
"TranDtls": {
"TaxSch": "GST",
"SupTyp": "B2B",
"RegRev": "N",
"IgstOnIntra": "N"
},
"DocDtls": {
"Typ": "INV",
"No": "Z13F34C3906B148E",
"Dt": "27/10/2020"
},
"SellerDtls": {
"Gstin": "24AAAPI3182M002",
"LglNm": "Acme Widgets Private Limited",
"Addr1": "2345",
"Loc": "Uttar Pradesh",
"Pin": 382424,
"Stcd": "24"
},
"BuyerDtls": {
"Gstin": "27ACBPN2353E1ZX",
"LglNm": "Long Term Enterprises LLP",
"Pos": "27",
"Addr1": "1234",
"Loc": "Pune",
"Pin": 400049,
"Stcd": "27"
},
"ValDtls": {
"AssVal": 0,
"CgstVal": 0,
"SgstVal": 222,
"IgstVal": 0,
"TotInvVal": 0
},
"DispDtls": {
"Nm": "Acme Widgets Private Limited",
"Addr1": "112",
"Addr2": "Acme Building",
"Loc": "ABC",
"Pin": 382424,
"Stcd": "24"
},
"ShipDtls": {
"Gstin": "27ACBPN2353E1ZX",
"LglNm": "Acme Widgets Private Limited",
"TrdNm": "Acme Widgets Private Limited",
"Addr1": "112",
"Addr2": "Acme Building",
"Loc": "ABC",
"Pin": 400049,
"Stcd": "27"
},
"PayDtls": {
"Nm": "Acme Widgets Private Limited",
"Mode": "Cash",
"PayTerm": "100",
"PayInstr": "100",
"CrTrn": "100",
"DirDr": "100",
"CrDay": 100,
"PaymtDue": 900,
"PaidAmt": 100
},
"RefDtls": {
"InvRm": "Remarks",
"DocPerdDtls": {
"InvStDt": "01/09/2020",
"InvEndDt": "01/09/2020"
}
},
"ExpDtls": {
"ShipBNo": "shpbill123",
"ShipBDt": "01/09/2020",
"Port": "INYNL6",
"RefClm": "N",
"ForCur": "INR",
"CntCode": "IN",
"ExpDuty": 0
},
"ItemList": [
{
"SlNo": "1",
"PrdDesc": "Acme product",
"IsServc": "N",
"HsnCd": "33052000",
"UnitPrice": 1631.36,
"TotAmt": 897.8,
"AssAmt": 500.0,
"GstRt": 18.0,
"TotItemVal": 0.0,
"Qty": 0,
"FreeQty": 30.0,
"Unit": "OTH",
"Discount": 48940.8,
"PreTaxVal": 0.0,
"SgstAmt": 0.0,
"CgstAmt": 0.0,
"IgstAmt": 100.0,
"CesRt": 0.0,
"CesAmt": 0.0,
"StateCesRt": 0,
"StateCesAmt": 0,
"StateCesNonAdvlAmt": 0,
"CesNonAdvlAmt": 0.0,
"OthChrg": 0.0
},
{
"SlNo": "2",
"PrdDesc": "Acme product",
"IsServc": "N",
"HsnCd": "33052000",
"UnitPrice": 1631.36,
"TotAmt": 897.8,
"AssAmt": 500.0,
"GstRt": 18.0,
"TotItemVal": 0.0,
"Qty": 0,
"FreeQty": 30.0,
"Unit": "OTH",
"Discount": 48940.8,
"PreTaxVal": 0.0,
"SgstAmt": 0.0,
"CgstAmt": 0.0,
"IgstAmt": 100.0,
"CesRt": 0.0,
"CesAmt": 0.0,
"StateCesRt": 0,
"StateCesAmt": 0,
"StateCesNonAdvlAmt": 0,
"CesNonAdvlAmt": 0.0,
"OthChrg": 0.0
}
]
},
"meta": {
"email": {
"seller": {
"recipient": "accounts@yourcompany.com",
"notify-on-success": true,
"notify-on-error": true,
"send-json": true,
"send-pdf": true
},
"buyer": {
"recipient": "accounts@yourcompany.com",
"send-json": true,
"send-pdf": true
}
}
}
}
Response#
200
:#
Successful response will an async task-id
.
Using this task-id
you will be able to fetch the status of the request.
Sample Response Body
{
"data": {
"task-id": "d139aedf-395a-4b6d-a76c-bb2c9bf83098"
}
}
Download API Response:#
Download API response is unique for each API.
Example
{
"data": {
{
"status": true,
"details": "{"AckDt":"2020-08-27 18:28:00","AckNo":122010011139775,"EwbDt":"2020-08-27 18:28:00","EwbNo":201008685293,"EwbValidTill":"2020-08-28 23:59:00","Irn":"f648b3d528bb5e5de18793dd7dcd4587d36ee225ab400a9afadc7f8ebe80908b","Remarks":null,"SignedInvoice":"eyJhbGciOiJSUzI1NiIsImtpZCI6IjExNUY0NDI2NjE3QTc5MzhCRTFCQTA2REJFRTkxQTQyNzU4NEVEQUIiLCJ0eXAiOiJKV1QiLCJ4NXQiOiJFVjlFSm1GNmVUaS1HNkJ0dnVrYVFuV0U3YXMifQ.eyJkYXRhIjoie1wiQWNrTm9cIjoxMjIwMTAwMTExMzk3NzUsXCJBY2tEdFwiOlwiMjAyMC0wOC0yNyAxODoyODowMFwiLFwiSXJuXCI6XCJmNjQ4YjNkNTI4YmI1ZTVkZTE4NzkzZGQ3ZGNkNDU4N2QzNmVlMjI1YWI0MDBhOWFmYWRjN2Y4ZWJlODA5MDhiXCIsXCJWZXJzaW9uXCI6XCIxLjAxXCIsXCJUcmFuRHRsc1wiOntcIlRheFNjaFwiOlwiR1NUXCIsXCJTdXBUeXBcIj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6XCJJTlZcIixcIkRvY0R0XCI6XCIyNy8wOC8yMDIwXCIsXCJUb3RJbnZWYWxcIjoyOTUwMDAwLFwiSXRlbUNudFwiOjEsXCJNYWluSHNuQ29kZVwiOlwiMTAwMVwiLFwiSXJuXCI6XCJmNjQ4YjNkNTI4YmI1ZTVkZTE4NzkzZGQ3ZGNkNDU4N2QzNmVlMjI1YWI0MDBhOWFmYWRjN2Y4ZWJlODA5MDhiXCJ9IiwiaXNzIjoiTklDIn0.HgppxgAWdMqiB4hjX8qinf0id7CEna8dXq2VRZ8VQryee32ICT2OlMN6wd4vv5Bh7bD2AZZed7do8hhyqqvsFE_TeIWnElv1a80JbEjHyFg2lbvPm8nkjQDSgPX8_w39uHgt2PH0mDm_NNvNh7ps5VmGjqxoUpDP8lT7aLfQ_J-8HrKhU2dOQ6amBimf_JLg28Fhsd2U5asGzGn_cx-9WKFIu0VSLgAQ5hj7yGQlprPibrNVWNojcArjreM-YY5SFy_aA-Qp_2zn5vzQod0b8qcvyiHGVlrFFSZi4q4ffQaFNGVlS6wJep6I9Pgqh5w-SpiYgcWSYk-D0MhjqAUFTg","Status":"ACT"}",
"pdf": "e278b407391b2b26d5b69781a523b332171e9a000ffef45002673ad131add0cd.pdf"
},
{
"status": false,
"error": {
"message": "err-irp-returned-error",
"type": "irp",
"args": {
"details": [
{
"ErrorCode": "2150",
"ErrorMessage": "Duplicate IRN"
}
],
"data": null
}
}
}
}
}
data
key will contain the response for the document requested for generating e-invoice.
The successful item contains, two key - status
and details
.
For successful generation of IRN status
will be True
and details
will contain response as per the ‘E-Invoice API Documentation’ published by NIC.
In the error scenario value of the status
key will be False
and error
will contain error details.
Notes#
IRP - nic is deprecated. Instead of it please use ni1 or ni2