Overview

This API is used to generate the e-waybill using Invoice Registration Number (IRN). The details and parameters of the requests and responses are explained.

The format and details of EWB Generation by IRN API request is depicted in following table.

URL

<URL>api/einvewb/ewaybill

Content-Type

application/json

Method

POST

Request Payload

Request Header

Attributes Description
client_id

Client id to be provided by e-invoice system

client_secret

Client secret to be provided by e-invoice system

Gstin GSTIN of authenticated user

sup_gstin

(Optional) Supplier GSTIN, only in case E Comm. operator is generating the E Way Bill

irp blinking New

(Optional, Required for criss-cross operations) If operations on IRNs to be performed at eInvoice 1 System on IRNs generated at eInvoice 2 System,’NIC2’ has to be passed and If operations on IRNs to be performed at eInvoice 2 System on IRNs generated at eInvoice 1 System, ‘NIC1’ has to be passed.

user_name

User name of the authenticated user

AuthToken

Authentication token returned by the e-invoice system

Request Payload

Attributes Description
Data

Base 64 encoded string of encrypted invoice JSON using SEK

Response Payload

Attributes Description
Status Status of the generate IRN request (values 1- Success and 0-Failure)
Data If Status is "1"
ErrorDetails If Status is "0"
InfoDtls Any additional message to be conveyed would be passed.

If Status is ‘1’

Data Base 64 encoded string of decrypted invoice JSON using Sek.
After decrypting Data the following attributes are obtained as below.
Attributes Description
EwbNo e-waybill Number
EwbDt e-waybill date
EwbValidTill e-waybill validity
Remarks Additional information such as, If distance is passed is 0, shows actual distance calculated for the pair of PIN codes

If Status is ‘0’

ErrorDetails Base 64 encoded string.
On decoding ErrorDetals the following attributes from JSON array are obtained as follows.
ErrorCode Unique error code
ErrorMessage Error Description

Sample JSON

Sample Request JSON
  {
  "Irn": "",
  "Distance": 100,
  "TransMode": "1",
  "TransId":"12AWGPV7107B1Z1",  
  "TransName": "trans name",
  "TransDocDt": "01/08/2020",
  "TransDocNo": "TRAN/DOC/11",
  "VehNo": "KA12ER1234",
  "VehType": "R",
  "ExpShipDtls": {
    "Addr1": "7th block, kuvempu layout",
    "Addr2": "kuvempu layout",
    "Loc": "Banagalore",
    "Pin": 562160,
    "Stcd": "29"
  },
  "DispDtls": {
    "Nm": "ABC company pvt ltd",
    "Addr1": "7th block, kuvempu layout",
    "Addr2": "kuvempu layout",
    "Loc": "Banagalore",
    "Pin": 562160,
    "Stcd": "29"
  }

}


                 

Sample Response JSON
 {
   "EwbNo":111008683051,
   "EwbDt":"2020-04-24 11:28:00",
   "EwbValidTill":"2020-04-26 23:59:00",
	"Remarks":"Pin-Pin calc distance: 997KM"
}

JSON(in case of error)


"status": "0",
"Data": null,
"ErrorDetails":"<Errors JSON >",
"InfoDtls": "<alert message >"
}

JSON Schema

 {
	"$schema": "http://json-schema.org/draft-07/schema#",
	"Irn": {
		"type": "string",
		"minLength": 64,
		"maxLength": 64,
		"description": "Irn Number"
	},
	"TransId": {
		"type": "string",
		"minLength": 15,
		"maxLength": 15,
		"pattern": "([0-9]{2}[0-9A-Z]{13})",
		"description": "Transin/GSTIN"
	},
	"TransName": {
		"type": "string",
		"minLength": 3,
		"maxLength": 100,
		"pattern": "^([^\\\"])*$",
		"description": "Name of the transporter"
	},
	"TransMode": {
		"type": "string",
		"maxLength": 1,
		"minLength": 1,
		"enum": [
			"1",
			"2",
			"3",
			"4"
		],
		"pattern": "^([1-4]{1})?$",
		"description": "Mode of transport (Road-1, Rail-2, Air-3, Ship-4)"
	},
	"Distance": {
		"type": "number",
		"minimum": 0,
		"maximum": 4000,
		"description": "Distance between source and destination PIN codes"
	},
	"TransDocNo": {
		"type": "string",
		"minLength": 1,
		"maxLength": 15,
		"pattern": "^([a-zA-Z0-9\/-]{1,15})$",
		"description": "Transport Document Number"
	},
	"TransDocDt": {
		"type": "string",
		"minLength": 10,
		"maxLength": 10,
		"pattern": "^[a-zA-Z0-9]{1}[a-zA-Z0-9-/]*$",
		"description": "Transport Document Date"
	},
	"VehNo": {
		"type": "string",
		"minLength": 4,
		"maxLength": 20,
		"pattern": "^([A-Z|a-z|0-9]{4,20})$",
		"description": "Vehicle Number"
	},
	"VehType": {
		"type": "string",
		"minLength": 1,
		"maxLength": 1,
		"enum": [
			"O",
			"R"
		],
		"pattern": "^([O|R]{1})$",
		"description": "Whether O-ODC or R-Regular "
	},
	"ExpShipDtls": {
		"type": "object",
		"properties": {
			"Addr1": {
				"type": "string",
				"minLength": 3,
				"maxLength": 100,
				"pattern": "^([^\\\"])*$",
				"description": "Address1 of the entity to whom the supplies are shipped to. (Building/Flat no.,Road/Street etc.)"
			},
			"Addr2": {
				"type": "string",
				"minLength": 3,
				"maxLength": 100,
				"pattern": "^([^\\\"])*$",
				"description": "Address 2 of the entity to whom the supplies are shipped to. (Floor no., Name of the premises/building)."
			},
			"Loc": {
				"type": "string",
				"minLength": 3,
				"maxLength": 100,
				"pattern": "^([^\\\"])*$",
				"description": "Place (City,Town,Village) entity to whom the supplies are shipped to."
			},
			"Pin": {
				"type": "number",
				"minimum": 100000,
				"maximum": 999999,
				"description": "Pincode"
			},
			"Stcd": {
				"type": "string",
				"minLength": 1,
				"maxLength": 2,
				"pattern": "^(?!0+$)([0-9]{1,2})$",
				"description": "State Code to which supplies are shipped to. Refer the master"
			}
		},
		"required": [
			"Addr1",
			"Loc",
			"Pin",
			"Stcd"
		]
	},
   "DispDtls": {
		"type": "object",
		"properties": {
			"Nm": {
				"type": "string",
				"minLength": 3,
				"maxLength": 100,
				"pattern": "^([^\\\"])*$",
				"description": "Name of the company from which the goods are dispatched"
			},
			"Addr1": {
				"type": "string",
				"minLength": 1,
				"maxLength": 100,
				"pattern": "^([^\\\"])*$",
				"description": "Address 1 of the entity from which goods are dispatched. (Building/Flat no.Road/Street etc.)"
			},
			"Addr2": {
				"type": "string",
				"minLength": 3,
				"maxLength": 100,
				"pattern": "^([^\\\"])*$",
				"description": "Address 2 of the entity from which goods are dispatched. (Floor no., Name of the premises/building)"
			},
			"Loc": {
				"type": "string",
				"minLength": 3,
				"maxLength": 100,
				"pattern": "^([^\\\"])*$",
				"description": "Location"
			},
			"Pin": {
				"type": "number",
				"minimum": 100000,
				"maximum": 999999,
				"description": "Pincode"
			},
			"Stcd": {
				"type": "string",
				"minLength": 1,
				"maxLength": 2,
				"pattern": "^(?!0+$)([0-9]{1,2})$",
				"description": "State Code. Refer the master"
			}
		},
		"required": [
			"Nm",
			"Addr1",
			"Loc",
			"Pin",
			"Stcd"
		]
	},
	"required": [
		"Distance"
	]
}
                  

Validations

  1. E-waybill can be generated only if E-way Bill related details are passed where distance is mandatory.
  2. E-way Bill is not generated for document types of Debit Note and Credit Note and Services.
  3. E Way Bill can be generated provided at least HSN of one item belongs to goods.
  4. If only Transporter Id is provided, then only Part-A is generated. Transport Mode, Vehicle Type, Vehicle No, Transportation document number and date should be null or attributes should not have been passed.
  5. If mode of transportation is "Road", then the Vehicle number and vehicle type should be passed. If mode of transportation is Ship, Air, Rail, then the transport document number and date should be passed. Vehicle type and vehicle number should be null or attributes should not have been passed.
  6. The Vehicle no. should match with specified format and exist in Vahan database.
  7. E-Waybill will not be generated if the Supplier or Recipient GSTIN is blocked due to non-filing of Returns.
  8. Pincode of Recipient GSTIN is mandatory if Ship-To details are not entered.
  9. The distance of transportation is validated against the auto-calculated PIN-PIN distance stored in the system. The allowed distance for transportation should be between +/- 10 % of auto-calculated PIN-PIN distance. . If the auto-calculated distance is less than 100 KMs, then The allowed distance for transportation should be between 1 and +10 % of auto-calculated PIN-PIN distance.
  10. If the distance of transportation is passed as 0 (zero), then the system will consider it as request made by the tax payer, to consider the auto-calculated PIN-PIN distance for the generation of e-way bill and generate the e-way bill along with IRN. The actual distance is passed in “Info. Message” Column for reference.
  11. If the PIN-PIN distance is not available in the system, the passed value of distance will be taken for generation of e-way bill and distance value can not be more than 4000.
  12. The actual distance has to be passed in case the source and destination PIN codes are same and the allowed range of value is from 1 to 100.
  13. In case of export of goods, if e-way bill has to be generated, then the address of port should have been passed as shipping address during generation of IRN.
  14. If during generation of IRN for export, the shipping address of India is not passed, then the shipping address of the port may be sent now and get the e-way bill generated.
  15. If the dispatching address and/or shipping address have not been passed during generation of IRN, then the respective addresses can be passed here.