Skip to main content

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​

PropertyValue
Interface CodeT162
Request Encrypted❌ No
Response Encryptedβœ… Yes
Request Bodynull (empty)
Response FormatJSON Array

Flow Description​

  1. Client calls T162 with no request payload (authentication via globalInfo).
  2. Server validates the authenticated taxpayer credentials.
  3. Server queries all registered fuel types from the system dictionary.
  4. Server returns an array of fuel type objects with hierarchical information.
  5. 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 fuelTypeCode values in T163 (Upload Shift Info), T167 (EDC Invoice Query), and fuel-related invoice operations.


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";
}

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 globalInfo headers.

Field (globalInfo)RequiredTypeDescription
tinβœ… YesString (≀20)Taxpayer Identification Number (from sign-in)
deviceNoβœ… YesString (≀20)Registered device serial number
interfaceCodeβœ… YesString (5)Must be "T162"
requestTimeβœ… YesStringTimestamp 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​

FieldRequiredTypeLengthDescription
fuelTypeCodeβœ… YesString≀18Unique fuel type identifier (use in T163, T167, T170)
parentCodeβœ… YesString≀18Parent category code (for hierarchical grouping)
fuelTypeNameβœ… YesString≀200Human-readable fuel type name (e.g., "Kerosene", "Petrol")
fuelTypeLevelβœ… YesNumber1Hierarchy level (1=root, 2=category, 3=leaf product)
isLeafNodeβœ… YesString (3)3101=Yes (leaf/final product), 102=No (has children)

πŸ’‘ Tip: Use isLeafNode=101 items for actual fuel product selection in invoices and shift uploads. Items with isLeafNode=102 are category headers for organizational purposes.


Return Codes​

CodeMessageDescription
00SUCCESSFuel types retrieved successfully
99Unknown errorGeneric server error
400Device does not existdeviceNo not registered for this TIN
402Device key expiredDevice credentials expired; re-run T102
403Device status is abnormalDevice blocked or suspended
100Taxpayer does not existTIN not found in system
101Taxpayer status is abnormalTIN suspended, deregistered, or inactive
2916fuelType: cannot be empty!Validation error in related operations
2917fuelType: 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​

  1. EDC System Initialization
    Load fuel types during system startup to populate dropdown selectors for shift uploads and fuel invoicing.

  2. Fuel Type Validation
    Validate user-selected fuel types against the official URA fuel type list before submitting T163 shift data.

  3. Hierarchical Fuel Classification
    Build tree-structured fuel type displays using parentCode and fuelTypeLevel for organized navigation.

  4. Fuel-Specific Reporting
    Filter EDC invoice queries (T167) by specific fuelTypeCode values for product-level sales analysis.

  5. Multi-Product Station Configuration
    Support gas stations selling multiple fuel types by caching all leaf node fuel types locally.

  6. 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