EFRIS API Documentation
EFRIS API Documentation
EFRIS
kakasa@ura.go.ug
Document History
2019-04-03 V1.0 Create by URA
Introduction ................................................................................................................................................... 4
Field description............................................................................................................................................. 5
Introduction
The system interface uses json format to transfer data. The protocol is divided into three
parts: data, globalInfo, and returnStateInfo.
The data part contains the inner layer message and the encryption method of the message.
The globalInfo part is a global variable containing interface information and other necessary
attributes.
Field description
ReturnCode description
ReturnCode Description
99 Unknow error
00 SUCCESS
01 Interface coding error
02 White box encryption failed
03 White box decryption failed
04 Read white box error
05 AppID error
06 The outer message is empty
07 GlobalInfo content cannot be empty
08 Data content cannot be empty
09 ReturnStateInfo content cannot be empty
10 DataDescription content cannot be empty
11 InterfaceCode cannot be empty
12 UserName cannot be empty
13 TaxpayerID cannot be empty
14 DeviceMAC cannot be empty
15 Unpacking data error
16 AppID cannot be empty
17 Version cannot be empty
18 DataExchangeId cannot be empty
19 RequestCode cannot be empty
20 RequestTime cannot be empty
21 ResponseCode cannot be empty
22 Currency cannot be empty
23 Tax rate acquisition error
24 The version cannot be longer than 15 characters
25 DataExchangeId cannot be greater than 32
characters!
26 RequestCode error
27 ResponseCode error
28 The difference between RequestTime and the current
time is greater than ten minutes!
29 DeviceMAC cannot be greater than 25 characters
30 AppID error
31 RequestTime time format error
32 Version is too low, please upgrade version
33 Version error
34 Longitude cannot be empty
35 Longitude cannot be greater than 60 characters
36 Latitude cannot be empty
37 Longitude cannot be greater than 60 characters
38 Signature value is invalid!
39 Signature value can not be empty!
40 Insufficient permissions!
41 Item does not exist!
42 Illegal request registration type error!
43 Outer packet json format is invalid!
100 Taxpayer does not exist
101 Taxpayer status is abnormal
102 Taxpayer branch status abnormal
300 The original invoice number does not exist
301 The original invoice number has not been completed
303 Update failed
304 According to the original invoice number, the
result is null
305 Invoice approval failed
306 Creditnote has been issued, duplicate submission
is not allowed
307 Get process template is empty
308 Approval failed
309 Items cannot be empty
310 The date cannot be voided
311 BusinessKey does not exist
312 Cannot apply for credit note/ debit note, the
fiscal document has exceeded the allowable
application days.
313 The application has been voided!
314 The application cannot be voided for initiated sub
process, please contact URA.
315 Successfully Operated
316 Seller does not have taxpayer account
317 Debitnote has been issued, duplicate submission
is not allowed
318 The debit note has a cancellation request in
process, please don't apply repeatedly.
319 The credit note has been cancelled, please don't
apply repeatedly.
400 Device does not exist
401 Device key does not exist
402 Device key expired
403 Device status is abnormal
501 get captcha error!
502 Verification code is not correct!
503 Check ORCode error!
504 The invoice does not exist.
505 Report code does not exist!
1001 Device number cannot be empty
1002 Billing date cannot be empty ISSUEDDATE can't
NULL
1003 Operator cannot be empty OPERATOR can't NULL
1004 Currency cannot be empty
1005 Invoice type cannot be empty
1006 invoiceKind cannot be empty
1007 Data source cannot be empty
1008 TIN cannot be empty
1009 LEAGNAME cannot be empty
1010 BUYERBRN cannot be empty
1011 BUYERLEGALNAME cannot be empty
1012 BUYERTYPE cannot be empty
1013 product name cannot be empty
1014 QTY product name
1015 UNITOFMEASURE cannot be empty
1016 unitPrice cannot be empty
1017 TOTAL cannot be empty
1018 TAXRATE cannot be empty
1019 ORDERNUMBER cannot be empty
1020 DISCOUNTFLAG cannot be empty
1021 DEEMEDFLAG cannot be empty
1022 EXCISEFLAG cannot be empty
1023 TAXCATEGORY cannot be empty
1024 NETAMOUNT cannot be empty
Field description
2. Client initialization
2. The server verifies that tin matches deviceNo and the status is normal.
Flow 3. Get the private key clientPriKey of the device, call the white box encryption program,
Description encrypt the private key, the white box will return the encrypted clientPriKey and
keyTable, and the server will return these two values to the client.
Field description
3. Sign in
2. For the first login, the dictionaryVersion exists locally. The second comparison
Flow compares the local dictionaryVersion with the dictionaryVersion. If the
Description dictionaryVersion is greater than the local dictionaryVersion, the T115 interface is
called to update the dictionary information. If it is equal, it is not necessary to call
T115.
Field description
dictionaryVer Dictionary
Y
sion version
issueTaxTypeR issueTaxTypeRest 0:No 1:Yes
Y
estrictions rictions
taxpayerBranc taxpayerBranchVe
Y
hVersion rsion
commodityCate commodityCategor
Y
goryVersion yVersion
exciseDutyVer exciseDutyVersio
Y
sion n
sellersLogo Sellers Logo Y Base64 content
goodsStockLim goodsStockLimit 101: restricted, inventory
it cannot be negative
Y
102: unlimited, inventory can
be negative
exportCommodi exportCommodityT If the tax rate is 1%,
Y
tyTaxRate axRate deposit 0.01
exportInvoice exportInvoiceExc 0:No 1:Yes
Y
ExciseDuty iseDuty
maxGrossAmoun maxGrossAmount Max Gross Amount for
t Y Invoice(UGX)
Field description
Field description
}, {
"id": "159078217852531032",
"invoiceNo": "00000000001",
"oriInvoiceId": "00000000004",
"oriInvoiceNo": "00000000002",
"issuedDate": "15/06/2019 02:00:03",
"buyerTin": "7777777777",
"buyerLegalName": "test",
"buyerNinBrn": "00000000001",
"currency": "UGX",
"grossAmount ": "2000.00",
"taxAmount ": "2000.00",
"dataSource": "101",
"isInvalid": "1",
"isRefund": "1",
"invoiceType": "1",
"invoiceKind": "1",
"invoiceIndustryCode": "102"
}]
}
The data is arranged in reverse order according to the date of issue.Only query the seller
Flow Description Tin equal to (the outer packet gets Tin)
Field description
3. Only query the seller Tin equal to (the outer packet gets Tin)
Field description
8. Invoice details
}
Flow Description Invoice details are queried according to Invoice number.
Field description
SummaryInternal field:
Field Field Name Required Length Description
netAmount net amount Tax Receipt total net
Y
amount
taxAmount tax amount Y Tax Receipt total tax amount
grossAmount gross amount Tax Receipt total gross
Y
amount
oriGrossAmoun original invoice
N
t gross amount
itemCount Purchase item 10 Purchase item lines
Y
lines
mode mode Issuing receipt mode
Y (1:Online or 0:Offline) ,this
code is from dictionary table
remarks Remarks Y 220
qrCode qrCode Y
PayWay field:
Field Field Name Required Length Description
paymentMode paymentMode number payWay dictionary table
101 Credit
Y 102 Cash
103 Cheque
104 Demand draft
105 Mobile money
106 Visa/Master card
107 EFT
108 POS
109 RTGS
110 Swift transfer
paymentAmount paymentAmount number Tax Receipt total tax amount
Must be positive or 0
Y
The number of integer digits
does not exceed 16 digits
orderNumber orderNumber Y 1 a b c d
Custom field:
Field Field Name Required Length Description
sadNumber SAD Number Y 20 SAD Number(20 digital)
office office Y 35 office for example busia
cif cif Y 50 CIF
wareHouseNumb Ware housing 16
Y
er Number
wareHouseName Ware housing 256
Y
Name
destinationCo destinationCount 256
Y
untry ry
originCountry originCountry Y 256
importExportF importExportFlag 1 1 import 2.export
Y
lag
confirmStatus confirmStatus 0:Unconfirmed Taxpayers cannot
enter the warehouse
1:Confirmed Taxpayers can put
in stock and add inventory
3 : Cancelled Cancellation
status and the invoice is
invalid
valuationMeth Valuation Method 128 valuation method
Y
od
prn prn Y 80
9. Invoice Upload
Field description
SummaryInternal field:
Field Field Name Required Length Description
netAmount net amount number Tax Receipt total net
amount
Must be positive or 0
Y The number of integer digits
does not exceed 16 digits and
the number of decimal places
does not exceed 2 digits
taxAmount tax amount number Tax Receipt total tax amount
Must be positive or 0
The number of integer digits
Y does not exceed 16 digits
and the number of decimal
places does not exceed 2
digits
grossAmount gross amount number Tax Receipt total gross
amount
Y Must be positive
The number of integer digits
does not exceed 16 digits and
the number of decimal places
does not exceed 2 digits
itemCount Purchase item Number Must match the Number of all
lines Y (4) product lines in goodsDetail-
number of discount lines!
modeCode mode 1 Issuing receipt mode
Y (1:Online or 0:Offline) ,this
code is from dictionary table
remarks Remarks N 500
qrCode qrCode N 500 Required if mode is 0
PayWay field:
Field Field Name Required Length Description
paymentMode paymentMode number payWay dictionary table
101 Credit
102 Cash
103 Cheque
104 Demand draft
Y 105 Mobile money
106 Visa/Master card
107 EFT
108 POS
109 RTGS
110 Swift transfer
paymentAmount paymentAmount number Tax Receipt total tax amount
Must be positive or 0
Y
The number of integer digits
does not exceed 16 digits
orderNumber orderNumber Y 1 a b c d
ExtendInternal field:
Field Field Name Required Length Description
reason Cancel reason N 1024
reasonCode debitNoteReason 3 Corresponding dictionary
debitNoteReason
This field is required when
invoiceType4
When invoiceType is 4, use
N the following values:
101 Increase in the amount
payable/invoice value due to
extra products delivered or
products delivered charged at
an incorrect value.
102 Others (Please specify)
If it is 102, reason is
required
Field description
SummaryInternal field:
Field Field Name Required Length Description
netAmount net amount Tax Receipt total net
amount
Must be negative or 0
The number of integer digits
Y
does not exceed 16 digits
and the number of decimal
places does not exceed 2
digits
taxAmount tax amount Tax Receipt total tax amount
Must be negative or 0
The number of integer digits
Y does not exceed 16 digits
and the number of decimal
places does not exceed 2
digits
grossAmount gross amount Tax Receipt total gross
amount
Must be negative
Y The number of integer digits
does not exceed 16 digits and
the number of decimal places
does not exceed 2 digits
itemCount Purchase item 10 Purchase item lines
Y
lines
modeCode mode Issuing receipt mode
Y (1:Online or 0:Offline) ,this
code is from dictionary table
qrCode qrCode N 500
PayWay field:
Field Field Name Required Length Description
paymentMode paymentMode Y number payWay dictionary table
101 Credit
102 Cash
103 Cheque
104 Demand draft
105 Mobile money
106 Visa/Master card
107 EFT
108 POS
109 RTGS
110 Swift transfer
paymentAmount paymentAmount number Tax Receipt total tax amount
Must be positive or 0
Y
The number of integer digits
does not exceed 16 digits
orderNumber orderNumber Y 1 a b c d
Field description
Field description
Field description
Interface Name Cancel Credit Note 、initiate Cancel of Debit Note Application
Description Cancel Credit Note 、initiate Cancel of Debit Note Application
Interface Code T114
Request
Y
Encrypted
Response
N
Encrypted
{
"oriInvoiceId": "31000000000000000001",
"invoiceNo": "786059685752403327",
Request Message "reason": "reason",
"reasonCode": "102",
"invoiceApplyCategoryCode": "103"
}
103: cancel of debitNote initiates a workflow and submits a Debit Note request
Flow Description
104: cancel of credit note Do not take the workflow. Modify invoice status
Field description
}
At the time of initialization, the dictionary is updated, and later judged according to the
Flow Description version number version. If the version is always, there is no need to update the data. If it is
inconsistent, obtain the data!
Field description
Field description
Field description
18. Query Credit Note Application and Cancel of Debit Note Application Details
}
Flow Description Query credit application product information tax information
Field description
SummaryInternal field:
Field Field Name Required Length Description
netAmount net amount Y Apply credit node
taxAmount tax amount Y Apply credit node
grossAmount gross amount Y Apply credit node
previousNetAm previousNetAmoun original invoice
Y
ount t
previousTaxAm previousTaxAmoun original invoice
Y
ount t
previousGross previousGrossAmo original invoice
Y
Amount unt
PayWay field:
Field Field Name Required Length Description
paymentMode paymentMode number payWay dictionary table
101 Credit
102 Cash
Y
103 Cheque
104 Demand draft
105 Mobile money
106 Visa/Master card
107 EFT
108 POS
109 RTGS
110 Swift transfer
paymentAmount paymentAmount number Tax Receipt total tax amount
Must be positive or 0
Y
The number of integer digits
does not exceed 16 digits
orderNumber orderNumber Y 1 a b c d
BasicInformation field:
Field Field Name Required Length Description
invoiceKind invoiceKind Y 1 :invoice 2: receipt
invoiceType invoiceType Y 2:credit 4:debit
invoiceIndust invoiceIndustryC 101 general industry
ryCode ode Y 102 export
103 import
Field description
Field description
Field description
Field description
Field description
Field description
Field description
Field description
Field description
Field description
Field description
N havePieceUnit is 101
pieceMeasureUnit cannot be
empty
T115 rateUnit
havePieceUnit havePieceUnit 3 haveExciseTax is 102
havePieceUnit must be empty!
N
101:Yes 102:No
pieceUnitPric pieceUnitPrice Number havePieceUnit is 102
e pieceUnitPrice must be empty!
havePieceUnit is 101
pieceUnitPrice cannot be
N empty
N havePieceUnit is 101
packageScaledValue cannot be
empty
havePieceUnit is 101
N pieceScaledValue cannot be
empty
The number of integer digits
does not exceed 12 digits and
the number of decimal places
does not exceed 8 digits
exciseDutyCod exciseDutyCode haveExciseTax is 102
N
e exciseDutyCode must be empty!
returnCode returnCode N response
returnMessage returnMessage N response
Field description
If operationType = 102,
adjustType cannot be empty
}]
When the cash in machine logs in, upload the abnormal log information in
Flow Description the last login period.
Field description
Field description
Field description
{
Response Message "latesttcsversion": 5
}
Field description
},
"extend": {
}
}
{
"basicInformation": {
"invoiceId": "1000002",
"invoiceNo": "00000000001",
Response Message "antifakeCode": "201905081711",
"deviceNo": "201905081234",
"sadNumber": "201905081234",
"sadDate": "2019-05-08 17:13:12",
"wareHouseNumber": "11111",
"wareHouseName": "xxxxxxxx",
"office": "xxxxxxxx",
"cif": "xxxxxxxx",
"valuationMethod": "xxxxxxxx",
"operator": "URA",
"currency": "UGX"
},
"buyerDetails": {
"buyerTin": "201905081705",
"buyerNinBrn": "201905081705",
"buyerPassportNum": "201905081705",
"buyerLegalName": "zhangsan",
"buyerBusinessName": "lisi",
"buyerAddress": "beijin",
"buyerEmail": "123456@163.com",
"buyerMobilePhone": "15501234567",
"buyerLinePhone": "010-6689666",
"buyerPlaceOfBusi": "beijin"
},
"goodsDetails": [{
"item": "apple",
"itemCode": "101",
"qty": "2",
"unitOfMeasure": "kg",
"unitPrice": "150.00",
"total": "1",
"taxRate": "0.18",
"tax": "12.88"
"orderNumber": "1",
"hsCode": "5467",
"hsCodeDescription": "Test"
}],
"taxDetails": [{
"taxCategory": "'Standard",
"netAmount": "3813.55",
"taxRate": "0.18",
"taxAmount": "686.45",
"grossAmount": "4500.00"
"taxRateName": "123"
}, {
"taxCategory": "''Excise Duty",
"netAmount": "1818.18",
"taxRate": "0.1",
"taxAmount": "181.82",
"grossAmount ": "2000.00"
"taxRateName": "123"
}],
"summary": {
"netAmount": "8379",
"taxAmount": "868",
"grossAmount": "9247",
"itemCount": "5",
"remarks": "This is another remark test.",
"qrCode": "asdfghjkl",
"prn": "201905081234",
},
"extend": {
}
}
Flow Description
Field description
SummaryInternal field:
Field Field Name Required Length Description
netAmount net amount number Tax Receipt total net
amount
Y Must be positive or 0
The number of integer digits
does not exceed 16 digits
taxAmount tax amount number Tax Receipt total tax amount
Must be positive or 0
Y
The number of integer digits
does not exceed 16 digits
grossAmount gross amount number Tax Receipt total gross
amount
Y Must be positive
The number of integer digits
does not exceed 16 digits
itemCount Purchase item Number Must match the Number of all
lines Y (4) product lines in goodsDetail-
number of discount lines!
remarks Remarks N 500
qrCode qrCode N 500 Required if mode is 0
prn payment 80 payment registration number
registration Y
number
2. Upload Export SAD
Flow Description
Field description
Flow Description
Field description
Flow Description
Field description