Skip to main content

Commodity Category Incremental Update (T134)

Retrieve only the commodity category changes since your local version up to the current server version. This endpoint enables efficient synchronization of tax commodity categories without downloading the entire dictionary. Requires encrypted request and response.


Endpoint Overview

PropertyValue
Interface CodeT134
Request Encrypted✅ Yes
Response Encrypted✅ Yes
Request Body{ "commodityCategoryVersion": "..." }
Response FormatJSON Array

Flow Description

  1. Check T103: Sign In response for commodityCategoryVersion.
  2. If server version is higher than local version, call T134 with your local version.
  3. Loop through the results:
    • If category code exists locally → delete and insert the returned version
    • If category code does not exist → insert into local repository
  4. Update your local repository version to match server version.

🔄 Tip: Call this endpoint periodically (e.g., daily) or when T103 indicates a version mismatch to keep your commodity categories up-to-date.


try {
// Get local version from your database/config
$localVersion = '1.0';

// Call T134: Commodity Category Incremental Update
$response = $client->syncCommodityCategories(
localVersion: $localVersion
);

$categories = $response['data']['content'] ?? $response;

if (is_array($categories) && count($categories) > 0) {
echo "✅ Retrieved " . count($categories) . " category updates\n";

foreach ($categories as $category) {
$code = $category['commodityCategoryCode'] ?? null;
$name = $category['commodityCategoryName'] ?? null;
$rate = $category['rate'] ?? null;

// Upsert into local database
// If exists: DELETE then INSERT
// If not exists: INSERT
echo " - {$code}: {$name} (Rate: {$rate})\n";
}

// Update local version after successful sync
// updateLocalVersion($newVersion);
} else {
echo "ℹ️ No category updates available\n";
}

} catch (\UraEfrisSdk\Exceptions\APIException $e) {
echo "❌ Sync failed: " . $e->getMessage() . "\n";
echo " Return Code: " . $e->getReturnCode() . "\n";
}

Request Structure

{
"data": {
"content": "BASE64_ENCRYPTED_PAYLOAD",
"signature": "JKQWJK34K32JJEK2JQWJ5678",
"dataDescription": {
"codeType": "1",
"encryptCode": "2",
"zipCode": "0"
}
},
"globalInfo": {
"interfaceCode": "T134",
"appId": "AP04",
"version": "1.1.20191201",
"tin": "1000029771",
"deviceNo": "TCS9e0df01728335239",
"taxpayerID": "1"
}
}

Request Fields (Encrypted Payload)

FieldRequiredTypeDescription
commodityCategoryVersion✅ YesStringYour local commodity category version (e.g., "1.0")

Response Structure

{
"data": {
"content": [
{
"commodityCategoryCode": "100000000",
"parentCode": "0",
"commodityCategoryName": "Standard",
"commodityCategoryLevel": "1",
"rate": "0.18",
"isLeafNode": "101",
"serviceMark": "101",
"isZeroRate": "101",
"zeroRateStartDate": "19/02/2025",
"zeroRateEndDate": "28/02/2025",
"isExempt": "101",
"exemptRateStartDate": "19/02/2025",
"exemptRateEndDate": "28/02/2025",
"enableStatusCode": "1",
"exclusion": "1",
"excisable": "101",
"vatOutScopeCode": "102"
}
]
},
"globalInfo": {
"interfaceCode": "T134",
"returnStateInfo": {
"returnCode": "00",
"returnMessage": "SUCCESS"
}
}
}

Response Fields

FieldRequiredTypeDescription
commodityCategoryCode✅ YesString (18)Unique commodity category identifier
parentCode✅ YesString (18)Parent category code (0 for root level)
commodityCategoryName✅ YesString (200)Category name (e.g., "Standard", "Exempt")
commodityCategoryLevel✅ YesString (1)Hierarchy level (1=root, 2=child, etc.)
rate✅ YesString (4)Tax rate (e.g., "0.18" for 18%)
isLeafNode✅ YesString (3)101=Yes (no children), 102=No (has children)
serviceMark✅ YesString (3)101=Service, 102=Goods
isZeroRate✅ YesString (3)101=Zero-rated, 102=Not zero-rated
zeroRateStartDate❌ NoDateZero-rate effective start date (dd/MM/yyyy)
zeroRateEndDate❌ NoDateZero-rate effective end date (dd/MM/yyyy)
isExempt✅ YesString (3)101=Exempt, 102=Not exempt
exemptRateStartDate❌ NoDateExemption effective start date (dd/MM/yyyy)
exemptRateEndDate❌ NoDateExemption effective end date (dd/MM/yyyy)
enableStatusCode✅ YesString (1)1=Enabled, 0=Disabled
exclusion✅ YesString (1)0=Zero, 1=Exempt, 2=No exclusion, 3=Both
excisable✅ YesString (3)101=Excisable, 102=Not excisable
vatOutScopeCode✅ YesString (3)101=VAT Out of Scope, 102=Not out of scope

Return Codes

CodeMessageDescription
00SUCCESSIncremental update retrieved successfully
99Unknown errorGeneric server error
400Device does not existdeviceNo not registered
402Device key expiredDevice credentials expired; re-run T102
403Device status is abnormalDevice blocked or suspended
2059commodityCategoryVersion cannot be emptyMissing version parameter

💡 Tip: An empty array response ([]) with return code 00 means your local version is already up-to-date—no changes since your specified version.


Common Use Cases

  1. Daily Synchronization
    Schedule T134 calls during off-peak hours to keep commodity categories current without full dictionary downloads.

  2. Version Mismatch Handling
    When T103 returns a higher commodityCategoryVersion, immediately call T134 to fetch only the changes.

  3. Multi-Branch Consistency
    Ensure all branches use the same commodity category versions by syncing from a central server.

  4. Audit Trail Maintenance
    Log category changes (additions, modifications, deletions) for compliance and troubleshooting.

  5. Offline Mode Preparation
    Cache the latest categories before going offline to ensure accurate tax calculations without server access.


Integration Checklist

✅ Store local commodityCategoryVersion in your database
✅ Compare with T103 response before calling T134
✅ Handle empty array response as "no changes" (success)
✅ Upsert categories: DELETE existing + INSERT new for updates
✅ Update local version only after successful sync
✅ Log category changes for audit purposes