Skip to main content

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​

PropertyValue
Interface CodeT148
Request Encryptedβœ… Yes
Response Encryptedβœ… Yes
Request Body{ "id": "..." }
Response FormatJSON Object

Flow Description​

  1. Client submits a stock record id obtained from T145 or T147 query results.
  2. Server validates the record ID exists and belongs to the authenticated taxpayer.
  3. Server returns complete stock record details including:
    • Stock-in header information (goodsStockIn object)
    • All goods items in the record (goodsStockInGoods array)
  4. 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 id field from T145/T147 response is required for T148 requests.


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

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)​

FieldRequiredTypeLengthDescription
idβœ… YesString≀18Stock record identifier obtained from T145 or T147 query response

πŸ’‘ Tip: The id value 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)​

FieldRequiredTypeLengthDescription
stockInTypeβœ… YesString (3)3101=Import, 102=Local Purchase, 103=Manufacture/Assembling, 104=Opening Stock
remarks❌ NoString≀1024Stock-in remarks/notes
invoiceNo❌ NoString≀20Associated invoice number (if applicable)
branchId❌ NoString≀18Branch identifier where stock was received
branchName❌ NoString≀500Branch name
stockInDate❌ NoDate-Stock-in date (yyyy-MM-dd)
supplierTin❌ NoString≀50Supplier's Taxpayer Identification Number
supplierName❌ NoString≀100Supplier name/business name
productionBatchNo❌ NoString≀50Production batch number (populated if stockInType=103)
productionDate❌ NoDate-Production date (yyyy-MM-dd; populated if stockInType=103)
referenceNo❌ NoString≀50Seller's reference number
totalAmount❌ NoNumber-Total stock-in amount

goodsStockInGoods Array (Item Details)​

FieldRequiredTypeLengthDescription
commodityGoodsId❌ NoString≀18Goods identifier from T130; required if goodsCode is empty
goodsCode❌ NoString≀50Goods code from T130; required if commodityGoodsId is empty
goodsName❌ NoString≀600Goods/product name
measureUnit❌ NoString (3)3Unit of measure code from T115 rateUnit
currency❌ NoString (3)3Currency code from T115 currencyType
quantity❌ NoNumber-Stock-in quantity (integer ≀12 digits, decimal ≀8 digits)
unitPrice❌ NoNumber-Commodity purchase price per unit
amount❌ NoNumber-Total amount (quantity Γ— unitPrice)

πŸ’‘ Tip: Either commodityGoodsId OR goodsCode must be populated per itemβ€”never both empty. For manufactured goods (stockInType=103), productionBatchNo and productionDate will be populated.


Return Codes​

CodeMessageDescription
00SUCCESSStock record details 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
2881id:cannot be empty!Missing record ID in request
2882id:Byte length cannot be greater than 18!Record ID exceeds maximum length
2883Record does not exist!Stock record ID not found in system
2884Record does not belong to current taxpayer!Stock record belongs to different TIN

πŸ’‘ Tip: Error 2883 indicates the record ID is invalid or has been deleted. Error 2884 indicates the record belongs to a different taxpayerβ€”ensure you're querying records for the authenticated TIN.


Common Use Cases​

  1. Stock Audit Verification
    Retrieve complete details of a specific stock record for audit trail verification and compliance reporting.

  2. Invoice-to-Stock Reconciliation
    Match stock records to source invoices using invoiceNo for accounting reconciliation and verification.

  3. Supplier Transaction Review
    Review all goods received from a specific supplier by examining supplierTin and supplierName in record details.

  4. Production Batch Tracking
    Track manufactured goods by examining productionBatchNo and productionDate for quality control and recalls.

  5. Branch Stock Analysis
    Analyze stock movements for specific branches using branchId and branchName from record details.

  6. Per-Item Quantity Verification
    Verify exact quantities and unit prices for each goods item in a stock-in transaction.

  7. Stock-In Type Reporting
    Generate detailed reports by stockInType (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