Query Fuel Type (T162)
Retrieve all registered fuel types from the EFRIS system. This endpoint returns a hierarchical list of fuel products (e.g., Petrol, Diesel, Kerosene) with their classification codes, parent relationships, and leaf node status. Request is unencrypted; response is encrypted.
Endpoint Overviewβ
| Property | Value |
|---|---|
| Interface Code | T162 |
| Request Encrypted | β No |
| Response Encrypted | β Yes |
| Request Body | null (empty) |
| Response Format | JSON Array |
Flow Descriptionβ
- Client calls T162 with no request payload (authentication via
globalInfo). - Server validates the authenticated taxpayer credentials.
- Server queries all registered fuel types from the system dictionary.
- Server returns an array of fuel type objects with hierarchical information.
- Client uses response to populate fuel type selectors for EDC operations, shift uploads, and fuel invoicing.
π‘ Tip: Call T162 during system initialization to cache fuel types locally. Use
fuelTypeCodevalues in T163 (Upload Shift Info), T167 (EDC Invoice Query), and fuel-related invoice operations.
- PHP
- JavaScript / TypeScript
- Python
try {
// Call T162: Query Fuel Type
$response = $client->queryFuelType();
$content = $response['data']['content'] ?? $response;
if (is_array($content) && count($content) > 0) {
echo "β
Retrieved " . count($content) . " fuel type(s)\n";
foreach ($content as $fuel) {
$levelIndicator = str_repeat(" ", (int)$fuel['fuelTypeLevel'] - 1);
$nodeType = ($fuel['isLeafNode'] === '101') ? 'π' : 'π';
echo " {$nodeType} {$levelIndicator}{$fuel['fuelTypeName']}\n";
echo " Code: {$fuel['fuelTypeCode']}\n";
echo " Level: {$fuel['fuelTypeLevel']}\n";
echo " Parent: {$fuel['parentCode']}\n";
echo "\n";
}
// Store fuel types for later use
$fuelTypes = $content;
} else {
echo "β οΈ No fuel types found\n";
}
} catch (\UraEfrisSdk\Exceptions\APIException $e) {
echo "β Query failed: " . $e->getMessage() . "\n";
echo " Return Code: " . $e->getReturnCode() . "\n";
}
try {
// Call T162: Query Fuel Type
const response = await client.queryFuelType();
const content = response?.data?.content ?? response;
if (Array.isArray(content) && content.length > 0) {
console.log(`β
Retrieved ${content.length} fuel type(s)`);
for (const fuel of content) {
const levelIndicator = ' '.repeat(Number(fuel.fuelTypeLevel) - 1);
const nodeType = fuel.isLeafNode === '101' ? 'π' : 'π';
console.log(` ${nodeType} ${levelIndicator}${fuel.fuelTypeName}`);
console.log(` Code: ${fuel.fuelTypeCode}`);
console.log(` Level: ${fuel.fuelTypeLevel}`);
console.log(` Parent: ${fuel.parentCode}`);
console.log('');
}
// Store fuel types for later use
const fuelTypes = content;
return content;
} else {
console.warn('β οΈ No fuel types found');
return [];
}
} catch (error: any) {
console.error(`β Query failed: ${error.message}`);
if (error.returnCode) {
console.error(` Return Code: ${error.returnCode}`);
}
throw error;
}
try:
# Call T162: Query Fuel Type
response = client.query_fuel_type()
content = response.get("data", {}).get("content", response)
if isinstance(content, list) and len(content) > 0:
print(f"β
Retrieved {len(content)} fuel type(s)")
for fuel in content:
level_indicator = " " * (int(fuel["fuelTypeLevel"]) - 1)
node_type = "π" if fuel["isLeafNode"] == "101" else "π"
print(f" {node_type} {level_indicator}{fuel['fuelTypeName']}")
print(f" Code: {fuel['fuelTypeCode']}")
print(f" Level: {fuel['fuelTypeLevel']}")
print(f" Parent: {fuel['parentCode']}")
print()
# Store fuel types for later use
fuel_types = content
else:
print("β οΈ No fuel types found")
except Exception as e:
print(f"β Query failed: {e}")
if hasattr(e, "return_code"):
print(f" Return Code: {e.return_code}")
raise
Request Structureβ
{
"data": {
"content": "",
"signature": "",
"dataDescription": {
"codeType": "0",
"encryptCode": "0",
"zipCode": "0"
}
},
"globalInfo": {
"interfaceCode": "T162",
"appId": "AP04",
"version": "1.1.20191201",
"tin": "1000029771",
"deviceNo": "TCS9e0df01728335239",
"taxpayerID": "1",
"requestTime": "2025-02-19 10:00:00"
}
}
Request Fieldsβ
π Note: T162 requires no encrypted payload. All authentication is handled via
globalInfoheaders.
| Field (globalInfo) | Required | Type | Description |
|---|---|---|---|
tin | β Yes | String (β€20) | Taxpayer Identification Number (from sign-in) |
deviceNo | β Yes | String (β€20) | Registered device serial number |
interfaceCode | β Yes | String (5) | Must be "T162" |
requestTime | β Yes | String | Timestamp format: yyyy-MM-dd HH:mm:ss |
Response Structureβ
{
"data": {
"content": [
{
"fuelTypeCode": "15101502",
"parentCode": "15101500",
"fuelTypeName": "Kerosene",
"fuelTypeLevel": "3",
"isLeafNode": "101"
},
{
"fuelTypeCode": "15101503",
"parentCode": "15101500",
"fuelTypeName": "Petrol",
"fuelTypeLevel": "3",
"isLeafNode": "101"
},
{
"fuelTypeCode": "15101504",
"parentCode": "15101500",
"fuelTypeName": "Diesel",
"fuelTypeLevel": "3",
"isLeafNode": "101"
}
]
},
"globalInfo": {
"interfaceCode": "T162",
"returnStateInfo": {
"returnCode": "00",
"returnMessage": "SUCCESS"
}
}
}
Response Fieldsβ
Fuel Type Array Itemsβ
| Field | Required | Type | Length | Description |
|---|---|---|---|---|
fuelTypeCode | β Yes | String | β€18 | Unique fuel type identifier (use in T163, T167, T170) |
parentCode | β Yes | String | β€18 | Parent category code (for hierarchical grouping) |
fuelTypeName | β Yes | String | β€200 | Human-readable fuel type name (e.g., "Kerosene", "Petrol") |
fuelTypeLevel | β Yes | Number | 1 | Hierarchy level (1=root, 2=category, 3=leaf product) |
isLeafNode | β Yes | String (3) | 3 | 101=Yes (leaf/final product), 102=No (has children) |
π‘ Tip: Use
isLeafNode=101items for actual fuel product selection in invoices and shift uploads. Items withisLeafNode=102are category headers for organizational purposes.
Return Codesβ
| Code | Message | Description |
|---|---|---|
00 | SUCCESS | Fuel types retrieved successfully |
99 | Unknown error | Generic server error |
400 | Device does not exist | deviceNo not registered for this TIN |
402 | Device key expired | Device credentials expired; re-run T102 |
403 | Device status is abnormal | Device blocked or suspended |
100 | Taxpayer does not exist | TIN not found in system |
101 | Taxpayer status is abnormal | TIN suspended, deregistered, or inactive |
2916 | fuelType: cannot be empty! | Validation error in related operations |
2917 | fuelType: Byte length cannot be greater than 200! | Fuel type name exceeds limit |
π‘ Tip: An empty array (
[]) in the response content indicates no fuel types are configuredβthis may occur for non-EDC taxpayers.
Common Use Casesβ
-
EDC System Initialization
Load fuel types during system startup to populate dropdown selectors for shift uploads and fuel invoicing. -
Fuel Type Validation
Validate user-selected fuel types against the official URA fuel type list before submitting T163 shift data. -
Hierarchical Fuel Classification
Build tree-structured fuel type displays usingparentCodeandfuelTypeLevelfor organized navigation. -
Fuel-Specific Reporting
Filter EDC invoice queries (T167) by specificfuelTypeCodevalues for product-level sales analysis. -
Multi-Product Station Configuration
Support gas stations selling multiple fuel types by caching all leaf node fuel types locally. -
Compliance Verification
Ensure fuel types used in invoices match URA-registered fuel classifications for audit compliance.
Integration Checklistβ
β
Call T162 after T103 sign-in during system initialization
β
Cache fuel types locally with TTL to reduce API calls
β
Filter for isLeafNode=101 items when populating product selectors
β
Store fuelTypeCode values for use in T163, T167, T170 operations
β
Handle empty array response gracefully (non-EDC taxpayer)
β
Use fuelTypeName for display; always use fuelTypeCode for API requests
β
Validate fuel type selections against cached T162 response before submission
β
Re-fetch fuel types periodically if URA updates fuel classification
β
Log fuel type queries for audit trail in multi-station environments
β
Cross-reference fuelTypeCode with T130 goods registration for fuel products