Upload EDC Disconnection Data (T164)
Upload Electronic Dispensing Controller (EDC) disconnection and abnormal transaction logs to the EFRIS system. This endpoint records device disconnection events, communication failures, and abnormal transactions for audit and compliance monitoring. Request is encrypted; response is unencrypted.
Endpoint Overview
| Property | Value |
|---|---|
| Interface Code | T164 |
| Request Encrypted | ✅ Yes |
| Response Encrypted | ❌ No |
| Request Body | [{ "deviceNumber": "...", "disconnectedType": "...", ... }] |
| Response Format | NULL (empty on success) |
Flow Description
- Client detects EDC disconnection event or abnormal transaction.
- Client collects disconnection details (device number, type, timestamp, remarks).
- Client submits disconnection log array via T164 with encrypted payload.
- Server validates device registration and logs the disconnection event.
- Server returns NULL response on successful logging.
💡 Tip: Upload disconnection logs periodically (e.g., every 15 minutes) or immediately upon detecting disconnection events. Maintain local log queue for offline scenarios and batch upload when connectivity is restored.
- PHP
- JavaScript / TypeScript
- Python
try {
// Call T164: Upload EDC Disconnection Data
$disconnectionLogs = [
[
'deviceNumber' => '208178192251887451',
'disconnectedType' => '101', // 101=TCS disconnected, 102=Abnormal Transaction
'disconnectedTime' => '2025-02-19 10:00:00',
'remarks' => 'Abnormal transaction detected'
],
[
'deviceNumber' => '208178192251887451',
'disconnectedType' => '102',
'disconnectedTime' => '2025-02-19 10:15:00',
'remarks' => 'Communication timeout with controller'
]
];
$response = $client->uploadEdcDisconnect($disconnectionLogs);
// Response is NULL on success
echo "✅ Disconnection logs uploaded successfully\n";
echo " Logs submitted: " . count($disconnectionLogs) . "\n";
} catch (\UraEfrisSdk\Exceptions\APIException $e) {
echo "❌ Upload failed: " . $e->getMessage() . "\n";
echo " Return Code: " . $e->getReturnCode() . "\n";
// Queue logs for retry on failure
// $retryQueue->add($disconnectionLogs);
}
try {
// Call T164: Upload EDC Disconnection Data
const disconnectionLogs = [
{
deviceNumber: '208178192251887451',
disconnectedType: '101', // 101=TCS disconnected, 102=Abnormal Transaction
disconnectedTime: '2025-02-19 10:00:00',
remarks: 'Abnormal transaction detected'
},
{
deviceNumber: '208178192251887451',
disconnectedType: '102',
disconnectedTime: '2025-02-19 10:15:00',
remarks: 'Communication timeout with controller'
}
];
const response = await client.uploadEdcDisconnect(disconnectionLogs);
// Response is NULL on success
console.log('✅ Disconnection logs uploaded successfully');
console.log(' Logs submitted:', disconnectionLogs.length);
} catch (error: any) {
console.error(`❌ Upload failed: ${error.message}`);
if (error.returnCode) {
console.error(` Return Code: ${error.returnCode}`);
}
// Queue logs for retry on failure
// retryQueue.add(disconnectionLogs);
throw error;
}
try:
# Call T164: Upload EDC Disconnection Data
disconnection_logs = [
{
"deviceNumber": "208178192251887451",
"disconnectedType": "101", # 101=TCS disconnected, 102=Abnormal Transaction
"disconnectedTime": "2025-02-19 10:00:00",
"remarks": "Abnormal transaction detected"
},
{
"deviceNumber": "208178192251887451",
"disconnectedType": "102",
"disconnectedTime": "2025-02-19 10:15:00",
"remarks": "Communication timeout with controller"
}
]
response = client.upload_edc_disconnect(disconnection_logs)
# Response is NULL on success
print("✅ Disconnection logs uploaded successfully")
print(f" Logs submitted: {len(disconnection_logs)}")
except Exception as e:
print(f"❌ Upload failed: {e}")
if hasattr(e, "return_code"):
print(f" Return Code: {e.return_code}")
# Queue logs for retry on failure
# retry_queue.add(disconnection_logs)
raise
Request Structure
{
"data": {
"content": "BASE64_ENCRYPTED_PAYLOAD",
"signature": "JKQWJK34K32JJEK2JQWJ5678",
"dataDescription": {
"codeType": "1",
"encryptCode": "2",
"zipCode": "0"
}
},
"globalInfo": {
"interfaceCode": "T164",
"appId": "AP04",
"version": "1.1.20191201",
"tin": "1000029771",
"deviceNo": "TCS9e0df01728335239",
"taxpayerID": "1"
}
}
Request Fields (Encrypted Payload)
| Field | Required | Type | Length | Description |
|---|---|---|---|---|
deviceNumber | ✅ Yes | String | ≤50 | EDC device serial number or identifier |
disconnectedType | ✅ Yes | String (3) | 3 | 101=TCS disconnected with Controller, 102=Abnormal Transaction |
disconnectedTime | ✅ Yes | String | 20 | Disconnection timestamp (yyyy-MM-dd HH:mm:ss) |
remarks | ❌ No | String | Variable | Additional notes about the disconnection event |
💡 Tip: Multiple disconnection logs can be submitted in a single request as an array. Batch upload reduces API calls and improves efficiency.
Response Structure
{
"globalInfo": {
"interfaceCode": "T164",
"returnStateInfo": {
"returnCode": "00",
"returnMessage": "SUCCESS"
}
}
}
📋 Note: On success, the
data.contentis NULL or empty. Validation results are returned viaglobalInfo.returnStateInfoonly.
Response Fields
Global Info
| Field | Required | Type | Description |
|---|---|---|---|
interfaceCode | ✅ Yes | String (5) | Echoes T164 |
returnStateInfo | ✅ Yes | Object | Contains returnCode and returnMessage |
Return State Info
| Field | Required | Type | Description |
|---|---|---|---|
returnCode | ✅ Yes | String | 00 = Success, otherwise error code |
returnMessage | ✅ Yes | String | Human-readable status message |
Return Codes
| Code | Message | Description |
|---|---|---|
00 | SUCCESS | Disconnection logs uploaded successfully |
99 | Unknown error | Generic server error |
400 | Device does not exist | deviceNumber not registered for this TIN |
402 | Device key expired | Device credentials expired; re-run T102 |
403 | Device status is abnormal | Device blocked or suspended |
2924 | disconnectedType: cannot be empty! | Missing disconnection type |
2925 | disconnectedType: Byte length cannot be greater than 3! | Disconnection type format error |
2926 | disconnectedType: Invalid field value! | Must be 101 or 102 |
2927 | disconnectedTime: cannot be empty! | Missing disconnection timestamp |
2928 | disconnectedTime: The time format must be yyyy-MM-dd HH:mm:ss | Invalid timestamp format |
2918 | deviceNumber: cannot be empty! | Missing device number |
2919 | deviceNumber: Byte length cannot be greater than 20! | Device number exceeds limit |
2920 | deviceNumber does not belong to you | Device not registered to authenticated TIN |
💡 Tip: Error
2920indicates the device number is registered to a different taxpayer. Verify device assignment via T168/T169 before uploading logs.
Common Use Cases
-
EDC Communication Monitoring
Log TCS-controller disconnection events for network reliability analysis and uptime reporting. -
Abnormal Transaction Detection
Record abnormal transaction events (e.g., incomplete dispensing, meter mismatches) for investigation. -
Compliance Audit Trail
Maintain historical records of all EDC disconnection events for URA compliance audits. -
Offline Operation Logging
Queue disconnection events during network outages and batch upload when connectivity is restored. -
Device Health Monitoring
Track disconnection frequency per device to identify hardware or network issues requiring maintenance. -
Incident Investigation
Correlate disconnection logs with invoice data to investigate transaction discrepancies or fuel leakage.
Integration Checklist
✅ Validate deviceNumber is registered to current TIN via T168/T169 before uploading
✅ Ensure disconnectedTime format is yyyy-MM-dd HH:mm:ss
✅ Use disconnectedType=101 for communication disconnections, 102 for abnormal transactions
✅ Implement local log queue for offline scenarios with retry logic
✅ Batch multiple disconnection logs in single request to reduce API calls
✅ Log upload attempts locally for audit trail and debugging
✅ Handle NULL response gracefully (success = no content, check returnCode only)
✅ Implement exponential backoff for failed uploads to avoid rate limiting
✅ Cross-reference disconnection times with invoice timestamps for discrepancy analysis
✅ Monitor disconnection frequency alerts for proactive device maintenance