KSA e-Invoice APIEnvironment:
API Reference
Overview
Compliance CSID (Certificate)
Compliance Invoice
Compliance Invoice RequestPOST
Production CSID Onboarding
Production CSID Renewal
Reporting API
Clearance API
KSA e-Invoice APICompliance InvoiceCompliance Invoice Request

Compliance Invoice Request

POSThttps://apisandbox.whitebooks.in/einvoice/compliance/invoices

It performs compliance checks on einvoice documents.

Parameters

header parameters
Auth-Keystringoptional
Auth-Key
Accept-Languagestringoptional
Accept-Language
Accept-Versionstringrequired
Accept-Version

Request Body

application/jsonrequired
Versionstringoptional
Version Type
Example: "1.1"
TranDtlsobjectoptional
TaxSchstringoptional
Tax type
Example: "GST"
SupTypstringoptional
Supply Type
Example: "B2B"
RegRevstringoptional
Reg Rev
Example: "Y"
EcmGstinstringoptionalnullable
Ecom GSTIN
Example: null
IgstOnIntrastringoptional
IGST On Intra
Example: "N"
DocDtlsobjectoptional
Typstringoptional
Type
Example: "INV"
Nostringoptional
Invoice Number
Example: "MAHI/10"
Dtstringoptional
Invoice Date
Example: "08/08/2020"
SellerDtlsobjectoptional
Gstinstringoptional
GST Number
Example: "29AABCT1332L000"
LglNmstringoptional
Legal Name
Example: "ABC company pvt ltd"
TrdNmstringoptional
Trade Name
Example: "NIC Industries"
Addr1stringoptional
Address1
Example: "5th block, kuvempu layout"
Addr2stringoptional
Address2
Example: "kuvempu layout"
Locstringoptional
Location Name
Example: "GANDHINAGAR"
Pinnumberoptional
Pincode Number
Example: 560001
Stcdstringoptional
State Code
Example: "29"
Phstringoptional
Phone Number
Example: "9000000000"
Emstringoptional
Email Id
Example: "abc@gmail.com"
BuyerDtlsobjectoptional
Gstinstringoptional
GST Number
Example: "29AWGPV7107B1Z1"
LglNmstringoptional
Legal Name
Example: "XYZ company pvt ltd"
TrdNmstringoptional
Trade Name
Example: "XYZ Industries"
Posstringoptional
Place of Supply
Example: "37"
Addr1stringoptional
Address1
Example: "7th block, kuvempu layout"
Addr2stringoptional
Address2
Example: "kuvempu layout"
Locstringoptional
Location Name
Example: "GANDHINAGAR"
Pinnumberoptional
Pincode Number
Example: 560004
Stcdstringoptional
State Code
Example: "29"
Phstringoptional
Phone Number
Example: "9000000000"
Emstringoptional
Email Id
Example: "abc@gmail.com"
DispDtlsobjectoptional
Nmstringoptional
Name
Example: "ABC company pvt ltd"
Addr1stringoptional
Address1
Example: "7th block, kuvempu layout"
Addr2stringoptional
Address2
Example: "kuvempu layout"
Locstringoptional
Location Name
Example: "Banagalore"
Pinnumberoptional
Pincode Number
Example: 518360
Stcdstringoptional
State Name
Example: "37"
ShipDtlsobjectoptional
Gstinstringoptional
GST Number
Example: "29AWGPV7107B1Z1"
LglNmstringoptional
Legal Name
Example: "CBE company pvt ltd"
TrdNmstringoptional
Trade Name
Example: "kuvempu layout"
Addr1stringoptional
Address1
Example: "7th block, kuvempu layout"
Addr2stringoptional
Address2
Example: "kuvempu layout"
Locstringoptional
Location Name
Example: "Banagalore"
Pinnumberoptional
Pincode Number
Example: 518360
Stcdstringoptional
State Name
Example: "37"
ItemListarray<einvoicetypeGENERATEversionV1_1_ItemList>optional
Array items:
SlNostringoptional
Serial Number
Example: "1"
IsServcstringoptional
Service
Example: "N"
PrdDescstringoptional
Product Description
Example: "Rice"
HsnCdstringoptional
HSN Code
Example: "1001"
Barcdestringoptional
Bar Code
Example: "123456"
BchDtlsobjectoptional
Nmstringoptional
Tax type
Example: "123456"
Expdtstringoptional
Tax type
Example: "01/08/2020"
wrDtstringoptional
Tax type
Example: "01/09/2020"
Qtynumberoptional
Quntity
Example: 100.345
FreeQtynumberoptional
Free Quntity
Example: 10
Unitstringoptional
Units Of Measurment
Example: "NOS"
UnitPricenumberoptional
Unit Price
Example: 99.545
TotAmtnumberoptional
Total Amount
Example: 9988.84
Discountnumberoptional
Discount
Example: 10
PreTaxValnumberoptional
Discount
Example: 1
AssAmtnumberoptional
Assesment Amount
Example: 9978.84
GstRtnumberoptionalnullable
gst Rate
Example: 12
SgstAmtnumberoptional
Sgst Rate
Example: 0
IgstAmtnumberoptional
Igst Rate
Example: 1197.46
CgstAmtnumberoptional
Cgst Rate
Example: 0
CesRtnumberoptional
Cess Rate
Example: 5
CesAmtnumberoptional
Cess Amount
Example: 498.94
CesNonAdvlAmtnumberoptional
CesNonAd value
Example: 10
StateCesRtnumberoptional
State Cess Rate
Example: 12
StateCesAmtnumberoptional
State Cess Amount
Example: 1197.46
StateCesNonAdvlAmtnumberoptional
State Cess none advance Amount
Example: 5
OthChrgnumberoptional
Other Charges
Example: 10
TotItemValnumberoptional
Total Item Value
Example: 12897.7
OrdLineRefstringoptional
Total Item Value
Example: "3256"
OrgCntrystringoptional
Total Item Value
Example: "AG"
PrdSlNostringoptional
Total Item Value
Example: "12345"
AttribDtlsarray<einvoicetypeGENERATEversionV1_1_AttribDtls>optional
Array items:
Nmstringoptional
Tax type
Example: "Rice"
Valstringoptional
Tax type
Example: "10000"
ValDtlsobjectoptional
AssValnumberoptional
Assestment Val
Example: 9978.84
CgstValnumberoptional
Cgst Value
Example: 0
SgstValnumberoptional
Sgst Value
Example: 0
IgstValnumberoptional
Igst Value
Example: 1197.46
CesValnumberoptional
Cess Value
Example: 508.94
StCesValnumberoptional
StCess Value
Example: 1202.46
Discountnumberoptional
StCess Value
Example: 10
OthChrgnumberoptional
StCess Value
Example: 20
RndOffAmtnumberoptional
Round off
Example: 0.3
TotInvValnumberoptional
Total Invoice Value
Example: 12908
TotInvValFcnumberoptional
StCess Value
Example: 12897.7
PayDtlsobjectoptional
Nmstringoptional
State Name
Example: "ABCDE"
Accdetstringoptional
State Name
Example: "5697389713210"
Modestringoptional
State Name
Example: "Cash"
Fininsbrstringoptional
State Name
Example: "SBIN11000"
Paytermstringoptional
State Name
Example: "100"
Payinstrstringoptional
State Name
Example: "Gift"
Crtrnstringoptional
State Name
Example: "test"
Dirdrstringoptional
State Name
Example: "test"
Crdaynumberoptional
State Name
Example: 100
Paidamtnumberoptional
State Name
Example: 10000
Paymtduenumberoptional
State Name
Example: 5000
RefDtlsobjectoptional
InvRmstringoptional
GST Number
Example: "TEST"
DocPerdDtlsobjectoptional
InvStDtstringoptional
State Name
Example: "01/08/2020"
InvEndDtstringoptional
State Name
Example: "01/09/2020"
PrecDocDtlsarray<einvoicetypeGENERATEversionV1_1_PrecDocDtls>optional
Array items:
InvNostringoptional
State Name
Example: "DOC/002"
InvDtstringoptional
State Name
Example: "01/08/2020"
OthRefNostringoptional
State Name
Example: "123456"
ContrDtlsarray<einvoicetypeGENERATEversionV1_1_ContrDtls>optional
Array items:
RecAdvRefrstringoptional
State Name
Example: "DOC/002"
RecAdvDtstringoptional
State Name
Example: "01/08/2020"
Tendrefrstringoptional
State Name
Example: "Abc001"
Contrrefrstringoptional
State Name
Example: "Co123"
Extrefrstringoptional
State Name
Example: "Yo456"
Projrefrstringoptional
State Name
Example: "Doc-456"
Porefrstringoptional
State Name
Example: "Doc-789"
PoRefDtstringoptional
State Name
Example: "01/08/2020"
AddlDocDtlsarray<einvoicetypeGENERATEversionV1_1_AddlDocDtls>optional
Array items:
Urlstringoptional
State Name
Example: "https://einv-apisandbox.nic.in"
Docsstringoptional
State Name
Example: "Test Doc"
Infostringoptional
State Name
Example: "Document Test"
ExpDtlsobjectoptional
ShipBNostringoptional
State Name
Example: "A-248"
ShipBDtstringoptional
State Name
Example: "01/08/2020"
Portstringoptional
State Name
Example: "INABG1"
RefClmstringoptional
State Name
Example: "N"
ForCurstringoptional
State Name
Example: "AED"
CntCodestringoptional
State Name
Example: "AE"
EwbDtlsobjectoptional
Transidstringoptional
State Name
Example: "12AWGPV7107B1Z1"
Transnamestringoptional
State Name
Example: "XYZ EXPORTS"
Distancenumberoptional
State Name
Example: 100
Transdocnostringoptional
State Name
Example: "DOC01"
TransdocDtstringoptional
State Name
Example: "01/08/2020"
Vehnostringoptional
State Name
Example: "ka123456"
Vehtypestringoptional
State Name
Example: "R"
TransModestringoptional
State Name
Example: "1"

Response

HTTP OK. Returned on successful validation of simplified invoice.
POST/einvoice/compliance/invoices
1const response = await fetch('https://apisandbox.whitebooks.in/einvoice/compliance/invoices', {
2 method: 'POST',
3 headers: {
4 Auth-Key: "value",
5 Accept-Language: "value",
6 Accept-Version: "value",
7 Content-Type: "application/json"
8},
9 body: JSON.stringify({
10 "Version": "1.1",
11 "TranDtls": {
12 "TaxSch": "GST",
13 "SupTyp": "B2B",
14 "RegRev": "Y",
15 "EcmGstin": null,
16 "IgstOnIntra": "N"
17 },
18 "DocDtls": {
19 "Typ": "INV",
20 "No": "MAHI/10",
21 "Dt": "08/08/2020"
22 },
23 "SellerDtls": {
24 "Gstin": "29AABCT1332L000",
25 "LglNm": "ABC company pvt ltd",
26 "TrdNm": "NIC Industries",
27 "Addr1": "5th block, kuvempu layout",
28 "Addr2": "kuvempu layout",
29 "Loc": "GANDHINAGAR",
30 "Pin": 560001,
31 "Stcd": "29",
32 "Ph": "9000000000",
33 "Em": "abc@gmail.com"
34 },
35 "BuyerDtls": {
36 "Gstin": "29AWGPV7107B1Z1",
37 "LglNm": "XYZ company pvt ltd",
38 "TrdNm": "XYZ Industries",
39 "Pos": "37",
40 "Addr1": "7th block, kuvempu layout",
41 "Addr2": "kuvempu layout",
42 "Loc": "GANDHINAGAR",
43 "Pin": 560004,
44 "Stcd": "29",
45 "Ph": "9000000000",
46 "Em": "abc@gmail.com"
47 },
48 "DispDtls": {
49 "Nm": "ABC company pvt ltd",
50 "Addr1": "7th block, kuvempu layout",
51 "Addr2": "kuvempu layout",
52 "Loc": "Banagalore",
53 "Pin": 518360,
54 "Stcd": "37"
55 },
56 "ShipDtls": {
57 "Gstin": "29AWGPV7107B1Z1",
58 "LglNm": "CBE company pvt ltd",
59 "TrdNm": "kuvempu layout",
60 "Addr1": "7th block, kuvempu layout",
61 "Addr2": "kuvempu layout",
62 "Loc": "Banagalore",
63 "Pin": 518360,
64 "Stcd": "37"
65 },
66 "ItemList": [
67 {
68 "SlNo": "1",
69 "IsServc": "N",
70 "PrdDesc": "Rice",
71 "HsnCd": "1001",
72 "Barcde": "123456",
73 "BchDtls": {
74 "Nm": "123456",
75 "Expdt": "01/08/2020",
76 "wrDt": "01/09/2020"
77 },
78 "Qty": 100.345,
79 "FreeQty": 10,
80 "Unit": "NOS",
81 "UnitPrice": 99.545,
82 "TotAmt": 9988.84,
83 "Discount": 10,
84 "PreTaxVal": 1,
85 "AssAmt": 9978.84,
86 "GstRt": 12,
87 "SgstAmt": 0,
88 "IgstAmt": 1197.46,
89 "CgstAmt": 0,
90 "CesRt": 5,
91 "CesAmt": 498.94,
92 "CesNonAdvlAmt": 10,
93 "StateCesRt": 12,
94 "StateCesAmt": 1197.46,
95 "StateCesNonAdvlAmt": 5,
96 "OthChrg": 10,
97 "TotItemVal": 12897.7,
98 "OrdLineRef": "3256",
99 "OrgCntry": "AG",
100 "PrdSlNo": "12345",
101 "AttribDtls": [
102 {
103 "Nm": "Rice",
104 "Val": "10000"
105 }
106 ]
107 }
108 ],
109 "ValDtls": {
110 "AssVal": 9978.84,
111 "CgstVal": 0,
112 "SgstVal": 0,
113 "IgstVal": 1197.46,
114 "CesVal": 508.94,
115 "StCesVal": 1202.46,
116 "Discount": 10,
117 "OthChrg": 20,
118 "RndOffAmt": 0.3,
119 "TotInvVal": 12908,
120 "TotInvValFc": 12897.7
121 },
122 "PayDtls": {
123 "Nm": "ABCDE",
124 "Accdet": "5697389713210",
125 "Mode": "Cash",
126 "Fininsbr": "SBIN11000",
127 "Payterm": "100",
128 "Payinstr": "Gift",
129 "Crtrn": "test",
130 "Dirdr": "test",
131 "Crday": 100,
132 "Paidamt": 10000,
133 "Paymtdue": 5000
134 },
135 "RefDtls": {
136 "InvRm": "TEST",
137 "DocPerdDtls": {
138 "InvStDt": "01/08/2020",
139 "InvEndDt": "01/09/2020"
140 },
141 "PrecDocDtls": [
142 {
143 "InvNo": "DOC/002",
144 "InvDt": "01/08/2020",
145 "OthRefNo": "123456"
146 }
147 ],
148 "ContrDtls": [
149 {
150 "RecAdvRefr": "DOC/002",
151 "RecAdvDt": "01/08/2020",
152 "Tendrefr": "Abc001",
153 "Contrrefr": "Co123",
154 "Extrefr": "Yo456",
155 "Projrefr": "Doc-456",
156 "Porefr": "Doc-789",
157 "PoRefDt": "01/08/2020"
158 }
159 ]
160 },
161 "AddlDocDtls": [
162 {
163 "Url": "https://einv-apisandbox.nic.in",
164 "Docs": "Test Doc",
165 "Info": "Document Test"
166 }
167 ],
168 "ExpDtls": {
169 "ShipBNo": "A-248",
170 "ShipBDt": "01/08/2020",
171 "Port": "INABG1",
172 "RefClm": "N",
173 "ForCur": "AED",
174 "CntCode": "AE"
175 },
176 "EwbDtls": {
177 "Transid": "12AWGPV7107B1Z1",
178 "Transname": "XYZ EXPORTS",
179 "Distance": 100,
180 "Transdocno": "DOC01",
181 "TransdocDt": "01/08/2020",
182 "Vehno": "ka123456",
183 "Vehtype": "R",
184 "TransMode": "1"
185 }
186}),
187});
188
189const data = await response.json();
190console.log(data);
No example available.