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

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’
Irn SHA256 hash of Gstin, DocDtls.No, DocDtls.Typ, financial year of DocDtls.Dt
EwbNo e-waybill Number
EwbDt e-waybill date
EwbValidTill e-waybill validity
Error Details If Status is ‘0’
ErrorCode Unique error code
ErrorMessage Error Description
InfoDtls Any additional message to be conveyed would be passed.

Sample JSON

Sample Request JSON
{
 "Irn": "825a63fc30ab5e948c47d460f0bc3ca615b8389d98bf38f56ff49df6160de06e",
"TransId": "29DPZPS4403C1ZF",
"TransMode": "1",
"TransDocNo": "12/22",
"TransDocDt": "06/02/2020",
"VehNo": "KA01AB1234",
"Distance": "120",
"VehType": "R",
"TransName": "ree"
}
                 

Sample Response JSON
 {
   "EwbNo":111008683051,
   "EwbDt":"2020-04-24 11:28:00",
   "EwbValidTill":"2020-04-26 23:59:00"
}

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,
		"description": "Transin/GSTIN"
	},
	"TransName": {
		"type": "string",
		"minLength": 3,
		"maxLength": 100,
		"description": "Name of the transporter"
	},
	"TransMode": {
		"type": "string",
		"maxLength": 1,
		"minLength": 1,
		"enum": ["1", "2", "3", "4"],
		"description": "Mode of transport (Road-1, Rail-2, Air-3, Ship-4)"
	},
	"Distance": {
		"type": "string",
		"maxLength": 1,
		"minLength": 4,
		"description": "Distance between source and destination PIN codes"
	},
	"TransDocNo": {
		"type": "string",
		"minLength": 1,
		"maxLength": 15,
		"pattern": "^([0-9A-Z/-]){1,15}$",
		"description": "Tranport Document Number"
	},
	"TransDocDt": {
		"type": "string",
		"minLength": 10,
		"maxLength": 10,
		"pattern": "[0-3][0-9]/[0-1][0-9]/[2][0][1-2][0-9]",
		"description": "Transport Document Date"
	},
	"VehNo": {
		"type": "string",
		"minLength": 4,
		"maxLength": 20,
		"description": "Vehicle Number"
	},
	"VehType": {
		"type": "string",
		"minLength": 1,
		"maxLength": 1,
		"enum": ["O", "R"],
		"description": "Whether O-ODC or R-Regular "
	},
	"required": [
		"Distance",
		"TransMode"
	]
}
                 

Validations

  1. E-Waybill will not be generated if the seller or buyer GSTIN is blocked due to non-filing of Returns.
  2. E-way Bill is not generated for document types of Debit Note and Credit Note and Services.
  3. E-way Bill cannot be generated for cancelled IRN.
  4. E Way Bill can be generated provided at least HSN of one item belongs to goods.
  5. If only Transporter –Id is provided, then only Part-A is generated.
  6. If mode of transportation in ‘Road’, then the Vehicle number and vehicle type should be passed.
  7. If mode of transportation in Ship. Air, Rail, then the transport document number and date should be passed.
  8. The Vehicle no. should match with specified format and exist in Vahan database.
  9. PIN-PIN distance is validated.