Record Stock Movement
POST
/api/v1/stock/ioRecord a stock movement transaction. Must be called AFTER the linked sales or purchase invoice has been submitted and approved by Kenya Revenue Authority.
Requires x-api-key
http://localhost:8100/api/v1/stock/io
Stock Type Codes
Call Order Required
Headers
| Field | Type | Required | Description |
|---|---|---|---|
| x-api-key | string | Required | Your Ushuru API key |
| Content-Type | string | Required | Must be application/json |
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
| sarNo | number | Required | Stock activity record number, your internal sequential identifier. |
| orgSarNo | number | Optional | Original SAR number for returns or adjustments. |
| regTyCd | string | Required | Registration type: M=Manual, A=Automatic. |
| custTin | string | Optional | Customer or supplier Kenya Revenue Authority PIN. |
| custNm | string | Optional | Customer or supplier name. |
| ocrnDt | string | Required | Occurrence date in YYYYMMDD format. |
| totItemCnt | number | Required | Total number of line items. |
| totTaxblAmt | number | Required | Total taxable amount. |
| totTax | number | Required | Total VAT amount. |
| totAmt | number | Required | Total amount inclusive of VAT. |
| remark | string | Optional | Optional remark. |
| itemList | array | Required | Array of stock movement items. |
| itemList[].itemCd | string | Required | Registered item code. |
| itemList[].itemNm | string | Required | Item name. |
| itemList[].stockTyCd | string | Required | Stock movement type code (01-03, 11-13). |
| itemList[].qty | number | Required | Quantity moved. |
| itemList[].unitPrice | number | Required | Unit price. |
| itemList[].totAmt | number | Required | Total amount for this line. |
Request
{
"sarNo": 1,
"regTyCd": "M",
"ocrnDt": "20240115",
"totItemCnt": 1,
"totTaxblAmt": 4310.34,
"totTax": 689.66,
"totAmt": 5000,
"itemList": [
{
"itemCd": "SV0000000Z001",
"itemNm": "Monthly SaaS Subscription",
"stockTyCd": "11",
"qty": 1,
"unitPrice": 5000,
"totAmt": 5000
}
]
}Response
{
"resultCd": "000",
"resultMsg": "Stock movement recorded",
"data": {
"sarNo": 1,
"ocrnDt": "20240115"
}
}curl -X POST http://localhost:8100/api/v1/stock/io \\
-H "x-api-key: YOUR_API_KEY" \\
-H "Content-Type: application/json" \\
-d '{
"sarNo": 1,
"regTyCd": "M",
"ocrnDt": "20240115",
"totItemCnt": 1,
"totTaxblAmt": 4310.34,
"totTax": 689.66,
"totAmt": 5000,
"itemList": [
{
"itemCd": "SV0000000Z001",
"itemNm": "Monthly SaaS Subscription",
"stockTyCd": "11",
"qty": 1,
"unitPrice": 5000,
"totAmt": 5000
}
]
}'