TCS Upgrade Download (T133)
Retrieve system upgrade files, commands, and SQL scripts required to update the Tax Control System (TCS) software. This endpoint provides the necessary artifacts (binaries, configurations, database scripts) based on the current version and operating system. Requires encrypted request and response.
Endpoint Overview
| Property | Value |
|---|---|
| Interface Code | T133 |
| Request Encrypted | ✅ Yes |
| Response Encrypted | ✅ Yes |
| Request Body | { "tcsVersion": "...", "osType": "..." } |
| Response Format | JSON (with file URLs and scripts) |
Flow Description
- Client checks current TCS version (via T135 or local config).
- Client requests upgrade files for target version and OS (Linux/Windows).
- Server returns:
- Pre-command scripts (Base64 encoded).
- Main command scripts (Base64 encoded).
- List of files to update/download (URLs).
- List of SQL scripts to execute (Base64 encoded).
- Client downloads files from provided URLs and executes scripts in specified order.
⚠️ Critical: Execute commands and SQL scripts in the
ordernumbersequence provided to ensure system integrity.
- PHP
- JavaScript / TypeScript
- Python
try {
// Call T133: TCS Upgrade Download
$response = $client->tcsUpgradeDownload(
tcsVersion: '2', // Target version number
osType: '1' // 0=Linux, 1=Windows
);
$content = $response['data']['content'] ?? $response;
if (isset($content['fileList'], $content['sqlList'])) {
echo "✅ Upgrade package retrieved\n";
echo " Version: {$content['tcsversion']}\n";
echo " Files to update: " . count($content['fileList']) . "\n";
echo " SQL scripts: " . count($content['sqlList']) . "\n";
// Process files in order
foreach ($content['fileList'] as $file) {
echo " - Download: {$file['updateurl']}\n";
echo " Order: {$file['ordernumber']}\n";
}
} else {
echo "⚠️ No upgrade files found\n";
}
} catch (\UraEfrisSdk\Exceptions\APIException $e) {
echo "❌ Upgrade download failed: " . $e->getMessage() . "\n";
echo " Return Code: " . $e->getReturnCode() . "\n";
}
try {
// Call T133: TCS Upgrade Download
const response = await client.tcsUpgradeDownload(
'2', // Target version number
'1' // 0=Linux, 1=Windows
);
const content = response?.data?.content ?? response;
if (content?.fileList && content?.sqlList) {
console.log('✅ Upgrade package retrieved');
console.log(` Version: ${content.tcsversion}`);
console.log(` Files to update: ${content.fileList.length}`);
console.log(` SQL scripts: ${content.sqlList.length}`);
// Process files in order
content.fileList.forEach((file: any) => {
console.log(` - Download: ${file.updateurl}`);
console.log(` Order: ${file.ordernumber}`);
});
return content;
} else {
console.warn('⚠️ No upgrade files found');
return null;
}
} catch (error: any) {
console.error(`❌ Upgrade download failed: ${error.message}`);
if (error.returnCode) {
console.error(` Return Code: ${error.returnCode}`);
}
throw error;
}
try:
# Call T133: TCS Upgrade Download
response = client.tcs_upgrade_download(
tcs_version='2', # Target version number
os_type='1' # 0=Linux, 1=Windows
)
content = response.get("data", {}).get("content", response)
if content.get("fileList") and content.get("sqlList"):
print("✅ Upgrade package retrieved")
print(f" Version: {content['tcsversion']}")
print(f" Files to update: {len(content['fileList'])}")
print(f" SQL scripts: {len(content['sqlList'])}")
# Process files in order
for file in content['fileList']:
print(f" - Download: {file['updateurl']}")
print(f" Order: {file['ordernumber']}")
else:
print("⚠️ No upgrade files found")
except Exception as e:
print(f"❌ Upgrade download failed: {e}")
if hasattr(e, "return_code"):
print(f" Return Code: {e.return_code}")
raise
Request Structure
{
"data": {
"content": "BASE64_ENCRYPTED_PAYLOAD",
"signature": "JKQWJK34K32JJEK2JQWJ5678",
"dataDescription": {
"codeType": "1",
"encryptCode": "2",
"zipCode": "0"
}
},
"globalInfo": {
"interfaceCode": "T133",
"appId": "AP04",
"version": "1.1.20191201",
"tin": "1000029771",
"deviceNo": "TCS9e0df01728335239",
"taxpayerID": "1"
}
}
Request Fields (Encrypted Payload)
| Field | Required | Type | Description |
|---|---|---|---|
tcsVersion | ✅ Yes | Number | Target TCS version number (starts from 1) |
osType | ✅ Yes | String (1) | Operating system: 0=Linux, 1=Windows |
Response Structure
{
"data": {
"content": {
"precommand": "BASE64_SCRIPT_CONTENT",
"precommandurl": "./jmeter/bin",
"precommandfilename": "abc.txt",
"command": "BASE64_SCRIPT_CONTENT",
"commandurl": "./home/tomcat",
"commandfilename": "a.docx",
"tcsversion": "2",
"fileList": [
{
"updatefile": "BASE64_FILE_CONTENT",
"iszip": "1",
"updateurl": "https://efris.ura.go.ug/uploads/file.zip",
"deleteurl": "/ad/fsads",
"ordernumber": "1"
}
],
"sqlList": [
{
"updatesql": "BASE64_SQL_CONTENT",
"ordernumer": "3"
}
]
}
},
"globalInfo": {
"interfaceCode": "T133",
"returnStateInfo": {
"returnCode": "00",
"returnMessage": "SUCCESS"
}
}
}
Response Fields
| Field | Required | Type | Description |
|---|---|---|---|
precommand | ✅ Yes | String (Base64) | Pre-command script content (Base64 encoded) |
precommandurl | ✅ Yes | String (256) | Path/URL for pre-command execution |
precommandfilename | ❌ No | String (500) | Filename for pre-command script |
command | ✅ Yes | String (Base64) | Main command script content (Base64 encoded) |
commandurl | ✅ Yes | String (256) | Path/URL for command execution |
commandfilename | ❌ No | String (500) | Filename for main command script |
tcsversion | ✅ Yes | String | Target TCS version number |
fileList | ✅ Yes | Array | List of files to update/download |
sqlList | ✅ Yes | Array | List of SQL scripts to execute |
fileList Array Fields
| Field | Required | Type | Description |
|---|---|---|---|
updatefile | ✅ Yes | String (Base64) | File content (Base64 encoded) or placeholder |
iszip | ❌ No | String | 1=Zipped, 0=Unzipped |
updateurl | ✅ Yes | String (256) | URL to download the update file |
deleteurl | ✅ Yes | String (256) | URL/path for cleanup/deletion |
ordernumber | ✅ Yes | String (10) | Execution sequence number |
sqlList Array Fields
| Field | Required | Type | Description |
|---|---|---|---|
updatesql | ✅ Yes | String (Base64) | SQL script content (Base64 encoded) |
ordernumer | ✅ Yes | String (10) | Execution sequence number (note: API spec uses ordernumer) |
Return Codes
| Code | Message | Description |
|---|---|---|
00 | SUCCESS | Upgrade package retrieved successfully |
99 | Unknown error | Generic server error |
47 | The current version does not support incremental upgrade | Current version cannot be upgraded incrementally; full install required |
400 | Device does not exist | deviceNo not registered |
402 | Device key expired | Device credentials expired |
403 | Device status is abnormal | Device blocked or suspended |
💡 Tip: If you receive code
47, contact URA support for a full installation package instead of an incremental upgrade.
Common Use Cases
-
Automated System Updates
Integrate into your application's update checker to automatically download and apply TCS patches. -
Version Compliance
Ensure your TCS software matches the latest version required by URA for continued operation. -
Database Schema Migration
Execute provided SQL scripts (sqlList) to update local database schemas to match new version requirements. -
Multi-OS Deployment
Request appropriate files for Linux (osType=0) or Windows (osType=1) environments.
Integration Checklist
✅ Check current version before calling (use T135)
✅ Verify osType matches your server environment
✅ Execute precommand before main command
✅ Process fileList and sqlList in ordernumber sequence
✅ Validate Base64 decoding for scripts and files
✅ Log upgrade actions for audit trails