Goods Stock Records Detail Query (T148)
Retrieve detailed information for a specific stock record, including header information and all associated goods items. This endpoint provides complete visibility into stock-in transactions including supplier details, branch information, and per-item quantities and amounts. Request and response are encrypted.
Endpoint Overviewβ
| Property | Value |
|---|---|
| Interface Code | T148 |
| Request Encrypted | β Yes |
| Response Encrypted | β Yes |
| Request Body | { "id": "..." } |
| Response Format | JSON Object |
Flow Descriptionβ
- Client submits a stock record
idobtained from T145 or T147 query results. - Server validates the record ID exists and belongs to the authenticated taxpayer.
- Server returns complete stock record details including:
- Stock-in header information (
goodsStockInobject) - All goods items in the record (
goodsStockInGoodsarray)
- Stock-in header information (
- Client uses response for detailed audit, reconciliation, or display purposes.
π‘ Tip: Use T148 after T145/T147 to get full details of a specific stock record. The
idfield from T145/T147 response is required for T148 requests.
- PHP
- JavaScript / TypeScript
- Python
try {
// Call T148: Goods Stock Records Detail Query
$recordId = '425502528294126235'; // From T145/T147 response
$response = $client->queryStockRecordDetail($recordId);
$content = $response['data']['content'] ?? $response;
if (isset($content['goodsStockIn'])) {
$header = $content['goodsStockIn'];
echo "β
Stock Record Details\n";
echo " Stock-In Type: {$header['stockInType']}\n";
echo " Date: {$header['stockInDate']}\n";
echo " Supplier: {$header['supplierName']} (TIN: {$header['supplierTin']})\n";
echo " Branch: {$header['branchName']}\n";
echo " Invoice: {$header['invoiceNo']}\n";
echo " Remarks: {$header['remarks']}\n";
if (!empty($content['goodsStockInGoods'])) {
echo "\n Goods Items (" . count($content['goodsStockInGoods']) . "):\n";
foreach ($content['goodsStockInGoods'] as $item) {
echo " β’ {$item['goodsName']} ({$item['goodsCode']})\n";
echo " Qty: {$item['quantity']} {$item['measureUnit']}\n";
echo " Unit Price: {$item['unitPrice']}\n";
echo " Amount: {$item['amount']}\n";
}
}
} else {
echo "β οΈ Stock record not found\n";
}
} catch (\UraEfrisSdk\Exceptions\APIException $e) {
echo "β Query failed: " . $e->getMessage() . "\n";
echo " Return Code: " . $e->getReturnCode() . "\n";
}
try {
// Call T148: Goods Stock Records Detail Query
const recordId = '425502528294126235'; // From T145/T147 response
const response = await client.queryStockRecordDetail(recordId);
const content = response?.data?.content ?? response;
if (content?.goodsStockIn) {
const header = content.goodsStockIn;
console.log('β
Stock Record Details');
console.log(' Stock-In Type:', header.stockInType);
console.log(' Date:', header.stockInDate);
console.log(' Supplier:', header.supplierName, `(TIN: ${header.supplierTin})`);
console.log(' Branch:', header.branchName);
console.log(' Invoice:', header.invoiceNo);
console.log(' Remarks:', header.remarks);
if (content.goodsStockInGoods?.length) {
console.log(`\n Goods Items (${content.goodsStockInGoods.length}):`);
for (const item of content.goodsStockInGoods) {
console.log(` β’ ${item.goodsName} (${item.goodsCode})`);
console.log(` Qty: ${item.quantity} ${item.measureUnit}`);
console.log(` Unit Price: ${item.unitPrice}`);
console.log(` Amount: ${item.amount}`);
}
}
return content;
} else {
console.warn('β οΈ Stock record not found');
return null;
}
} catch (error: any) {
console.error(`β Query failed: ${error.message}`);
if (error.returnCode) {
console.error(` Return Code: ${error.returnCode}`);
}
throw error;
}
try:
# Call T148: Goods Stock Records Detail Query
record_id = '425502528294126235' # From T145/T147 response
response = client.query_stock_record_detail(record_id)
content = response.get("data", {}).get("content", response)
if content.get("goodsStockIn"):
header = content["goodsStockIn"]
print("β
Stock Record Details")
print(f" Stock-In Type: {header['stockInType']}")
print(f" Date: {header['stockInDate']}")
print(f" Supplier: {header['supplierName']} (TIN: {header['supplierTin']})")
print(f" Branch: {header['branchName']}")
print(f" Invoice: {header['invoiceNo']}")
print(f" Remarks: {header['remarks']}")
if content.get("goodsStockInGoods"):
print(f"\n Goods Items ({len(content['goodsStockInGoods'])}):")
for item in content["goodsStockInGoods"]:
print(f" β’ {item['goodsName']} ({item['goodsCode']})")
print(f" Qty: {item['quantity']} {item['measureUnit']}")
print(f" Unit Price: {item['unitPrice']}")
print(f" Amount: {item['amount']}")
else:
print("β οΈ Stock record not 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": "BASE64_ENCRYPTED_PAYLOAD",
"signature": "JKQWJK34K32JJEK2JQWJ5678",
"dataDescription": {
"codeType": "1",
"encryptCode": "2",
"zipCode": "0"
}
},
"globalInfo": {
"interfaceCode": "T148",
"appId": "AP04",
"version": "1.1.20191201",
"tin": "1000029771",
"deviceNo": "TCS9e0df01728335239",
"taxpayerID": "1"
}
}
Request Fields (Encrypted Payload)β
| Field | Required | Type | Length | Description |
|---|---|---|---|---|
id | β Yes | String | β€18 | Stock record identifier obtained from T145 or T147 query response |
π‘ Tip: The
idvalue must be obtained from a prior T145 or T147 query. This ID uniquely identifies the stock record in the system.
Response Structureβ
{
"data": {
"content": {
"goodsStockIn": {
"stockInType": "101",
"remarks": "Increase inventory",
"invoiceNo": "320001127399",
"branchId": "2020090132456",
"branchName": "PARAMOUR COSMETICS LIMITED",
"stockInDate": "2025-02-19",
"supplierTin": "1000029771",
"supplierName": "UGANDA REVENUE AUTHORITY",
"productionBatchNo": "1200983",
"productionDate": "2025-02-19",
"referenceNo": "425502528294126235",
"totalAmount": "69990.00"
},
"goodsStockInGoods": [
{
"commodityGoodsId": "287700992426868373",
"goodsCode": "287700992426",
"goodsName": "test",
"measureUnit": "101",
"currency": "101",
"quantity": "100",
"unitPrice": "6999",
"amount": "69990.00"
}
]
}
},
"globalInfo": {
"interfaceCode": "T148",
"returnStateInfo": {
"returnCode": "00",
"returnMessage": "SUCCESS"
}
}
}
Response Fieldsβ
goodsStockIn Object (Header Information)β
| Field | Required | Type | Length | Description |
|---|---|---|---|---|
stockInType | β Yes | String (3) | 3 | 101=Import, 102=Local Purchase, 103=Manufacture/Assembling, 104=Opening Stock |
remarks | β No | String | β€1024 | Stock-in remarks/notes |
invoiceNo | β No | String | β€20 | Associated invoice number (if applicable) |
branchId | β No | String | β€18 | Branch identifier where stock was received |
branchName | β No | String | β€500 | Branch name |
stockInDate | β No | Date | - | Stock-in date (yyyy-MM-dd) |
supplierTin | β No | String | β€50 | Supplier's Taxpayer Identification Number |
supplierName | β No | String | β€100 | Supplier name/business name |
productionBatchNo | β No | String | β€50 | Production batch number (populated if stockInType=103) |
productionDate | β No | Date | - | Production date (yyyy-MM-dd; populated if stockInType=103) |
referenceNo | β No | String | β€50 | Seller's reference number |
totalAmount | β No | Number | - | Total stock-in amount |
goodsStockInGoods Array (Item Details)β
| Field | Required | Type | Length | Description |
|---|---|---|---|---|
commodityGoodsId | β No | String | β€18 | Goods identifier from T130; required if goodsCode is empty |
goodsCode | β No | String | β€50 | Goods code from T130; required if commodityGoodsId is empty |
goodsName | β No | String | β€600 | Goods/product name |
measureUnit | β No | String (3) | 3 | Unit of measure code from T115 rateUnit |
currency | β No | String (3) | 3 | Currency code from T115 currencyType |
quantity | β No | Number | - | Stock-in quantity (integer β€12 digits, decimal β€8 digits) |
unitPrice | β No | Number | - | Commodity purchase price per unit |
amount | β No | Number | - | Total amount (quantity Γ unitPrice) |
π‘ Tip: Either
commodityGoodsIdORgoodsCodemust be populated per itemβnever both empty. For manufactured goods (stockInType=103),productionBatchNoandproductionDatewill be populated.
Return Codesβ
| Code | Message | Description |
|---|---|---|
00 | SUCCESS | Stock record details 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 |
2881 | id:cannot be empty! | Missing record ID in request |
2882 | id:Byte length cannot be greater than 18! | Record ID exceeds maximum length |
2883 | Record does not exist! | Stock record ID not found in system |
2884 | Record does not belong to current taxpayer! | Stock record belongs to different TIN |
π‘ Tip: Error
2883indicates the record ID is invalid or has been deleted. Error2884indicates the record belongs to a different taxpayerβensure you're querying records for the authenticated TIN.
Common Use Casesβ
-
Stock Audit Verification
Retrieve complete details of a specific stock record for audit trail verification and compliance reporting. -
Invoice-to-Stock Reconciliation
Match stock records to source invoices usinginvoiceNofor accounting reconciliation and verification. -
Supplier Transaction Review
Review all goods received from a specific supplier by examiningsupplierTinandsupplierNamein record details. -
Production Batch Tracking
Track manufactured goods by examiningproductionBatchNoandproductionDatefor quality control and recalls. -
Branch Stock Analysis
Analyze stock movements for specific branches usingbranchIdandbranchNamefrom record details. -
Per-Item Quantity Verification
Verify exact quantities and unit prices for each goods item in a stock-in transaction. -
Stock-In Type Reporting
Generate detailed reports bystockInType(import, local purchase, manufacture, opening stock).
Integration Checklistβ
β
Obtain valid record id from T145 or T147 query before calling T148
β
Validate record ID format (β€18 characters, numeric) before submitting
β
Handle empty goodsStockInGoods array gracefully (record exists but no items)
β
Verify stockInType matches expected value for the transaction type
β
Cross-reference invoiceNo with T106/T108 invoice queries for validation
β
Validate commodityGoodsId or goodsCode exists in local goods database
β
Check productionBatchNo/productionDate populated only for stockInType=103
β
Cache record details to reduce repeated API calls for same record
β
Log record detail queries for audit trail compliance
β
Verify totalAmount matches sum of all item amount values