E-Invoice/E-WayBill APIs

API – Generate E-Waybill

This API is used to generate e-waybill for outward and inward supplies where IRN is not required.

URL

POST https://app.octagst.com/api/einvoice/generateewaybill?gstin={value}

Query Parameters

NameDescriptionTypeValue
gstinIt specifies GSTIN of requesterMandatory

Request

Structure

ParameterData TypeTypeDescription
supplyTypeString(1)MandatorySupply Type
O:Outwrad Supply
I: Inward Supply
subSupplyTypeString(2)MandatorySub Supply Type
1: Supply
2: Import
3: Export
4: Job Work
5: For Own Use
6: Job Work Returns
7: Sales Return
8: Others
9: SKD/CKD
10: Line Sales
11: Recipient Not Known
12: Exhibition or Fairs
subSypplyDescString(20)OptionalSub Supply Description if selected “Others” in subSupplyType
docTypeString(3)MandatoryDocument Type
INV: Invoice
BIL: Bill of Supply
BOE: Bill of Entry
CHL: Delivery Challan
OTH: Others
docNoString(16)MandatoryDocument No
A-Z, 0-9, /, -
docDateString(10)MandatoryDocument Date
DD/MM/YYYY
fromGstinString(15)MandatoryGSTIN of the supplier/consignor
fromTrdNameString(100)OptionalLegal/Trade Name of supplier/consignor
fromAddr1String(120)OptionalAddress of supplier/consignor - Line 1
fromAddr2String(120)OptionalAddress of supplier/consignor - Line 2
fromPlaceString(50)OptionalPlace of supplier/consignor (City/Town/Village)
fromPincodeNumber(6)MandatoryPincode of supplier/consignor
fromStateCodeNumber(2)MandatoryState code of supplier/consignor
actFromStateCodeNumber(2)MandatoryDispatch from State code of supply
toGstinString(15)MandatoryGSTIN of the recipient/consignee
toTrdNameString(100)OptionalLegal/Trade Name of recipient/consignee
toAddr1String(120)OptionalAddress of recipient/consignee - Line 1
toAddr2String(120)OptionalAddress of recipient/consignee - Line 2
toPlaceString(50)OptionalPlace of recipient/consignee (City/Town/Village)
toPincodeNumber(6)MandatoryPincode of recipient/consignee
toStateCodeNumber(2)MandatoryState code of recipient/consignee
actToStateCodeNumber(2)MandatoryShipTo state code of supply
transactionTypeNumber(1)MandatoryDocument Type
1: Regular
2: Bill To - Ship To
3: Bill From - Dispatch From
4: Combinationn of 2 and 3
totalValueNumber(18,2)OptionalTotal taxable value.
otherValueNumber(18,2)OptionalOther charges
totInvValueNumber(18,2)OptionalTotal document value
igstValueNumber(18,2)OptionalTotal IGST Amount
cgstValueNumber(18,2)OptionalTotal CGST Amount
sgstValueNumber(18,2)OptionalTotal SGST Amount
cessValueNumber(18, 2)OptionalTotal Cess Amount
cessNonAdvolValueNumber(18,2)OptionalTotal Cess Non Advol Amount
transporterIdString(15)OptionalTransporter Id
transporterNameString(100)OptionalTransport Name
transModeString(1)OptionalTransport Mode
1: Road
2: Rail
3: Air
4: Ship
transDistanceNumber(4)MandatoryDistance
transDocNoString(15)OptionalTransporter Doc No
transDocDateString(10)OptionalTransporter Doc Date
DD/MM/YYYY
vehicleNoString(15)OptionalVehicle No
vehicleTypeString(1)OptionalVehicle Type
R: Regular
O: Over-Dimensional Cargo (ODC)
itemListItem[]MandatoryThis object contains list of line items.
ItemObjectMandatoryThis object contains details of line item
productNameString(100)OptionalProduct name
productDescString(100)OptionalProduct/Item description
hsnCodeString(8)MandatoryHSN Code
quantityNumber(8,2)OptionalQuantity
qtyUnitString(3)OptionalUQC
taxableAmountNumber(18,2)MandatoryItem Taxable Value
igstRateNumber(6,3)OptionalIGST Rate
cgstRateNumber(6,3)OptionalCGST Rate
sgstRateNumber(6,3)OptionalSGST Rate
cessRateNumber(6,3)OptionalCess Rate
cessNonadvolNumber(6,3)OptionalCess Rate- Nonadvol

Please visit NIC eWayBill portal to know about field validations and get masters defined for State Codes, supply type, document types, UQC, HSN, etc.

Validations on NIC Portal →

State Codes on NIC Portal →

Master Codes on NIC Portal →

Supply-Doc Type Mapping on NIC Portal →

Sample

Request payload should contain the JSON encoded invoice data:

{
  "supplyType": "O",
  "subSupplyType": "1",
  "subSupplyDesc": null,
  "docType": "INV",
  "docNo": "7001-8",
  "docDate": "15/12/2020",
  "fromGstin": "29AKLPM8755F1Z2",
  "fromTrdName": "Galaxy Mobile World Limited",
  "fromAddr1": "2ND CROSS NO 59  19  A",
  "fromAddr2": "GROUND FLOOR OSBORNE ROAD",
  "fromPlace": "Bangalore",
  "fromPincode": 560090,
  "actFromStateCode": 29,
  "fromStateCode": 29,
  "toGstin": "27EHFPS5910D2Z0",
  "toTrdName": "ABC India Limited",
  "toAddr1": "Shree Nilaya",
  "toAddr2": "Dasarahosahalli",
  "toPlace": "Thane",
  "toPincode": 560090,
  "actToStateCode": 27,
  "toStateCode": 27,
  "transactionType": 0,
  "otherValue": 0,
  "totalValue": 5000,
  "igstValue": 900,
  "cgstValue": 0,
  "sgstValue": 0,
  "cessValue": 0,
  "cessNonAdvolValue": 0,
  "totInvValue": 5900,
  "transporterId": "29AASFB9647G1ZU",
  "transporterName": null,
  "transDocNo": null,
  "transMode": "1",
  "transDistance": 1300,
  "transDocDate": null,
  "vehicleNo": "KA271C4869",
  "vehicleType": "R",
  "itemList": [
    {
      "productName": "Delta G10B",
      "productDesc": "Delta 4G Phone with 2M Camera",
      "hsnCode": 851712,
      "quantity": 1,
      "qtyUnit": "NOS",
      "taxableAmount": 5000,
      "igstRate": 18,
      "cgstRate": 0,
      "sgstRate": 0,
      "cessRate": 0,
      "cessNonadvol": 0
    }
  ]
}

Response

Response payload will contain the success status along with eWayBill information.

Structure

ParameterData TypeDescription
SuccessBooleantrue in case of success
EwbStatusStringEWB Status
ACT: Active
CNL: Cancelled
EwbNoStringe-waybill Number(present only if e-waybill is generated along with e-invoice)
EwbTimeStringe-waybill generation Date & time
DD/MM/YYYY HH:MM:SS
EwbValidTillStringe-waybill validity Date & time
DD/MM/YYYY HH:MM:SS
ErrorsError[]List of errors, will be present only when Success is false

Error

ParameterData TypeDescription
CodeStringError Code
MessageStringError message

Sample – Success

{
  "Success": true,
  "EwbStatus": "ACT",
  "EwbNo": "191008688443",
  "EwbTime": "27/11/2020 17:23:45",
  "EwbValidTill": "29/11/2020 17:23:45"
}

Sample – Failure

If the API request fails for some reasons, the response payload will contain the failure status and a list of errors.

{
  "Success": false,
  "Errors": [
    {
      "Code": "ERR_CODE_1",
      "Message": "ERR MESSAGE 1"
    },
    {
      "Code": "ERR_CODE_n",
      "Message": "ERR MESSAGE n"
    }
  ]
}