Record Stock Movement

POST/api/v1/stock/io

Record 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

FieldTypeRequiredDescription
x-api-keystringRequiredYour Ushuru API key
Content-TypestringRequiredMust be application/json

Request Body

FieldTypeRequiredDescription
sarNonumberRequiredStock activity record number, your internal sequential identifier.
orgSarNonumberOptionalOriginal SAR number for returns or adjustments.
regTyCdstringRequiredRegistration type: M=Manual, A=Automatic.
custTinstringOptionalCustomer or supplier Kenya Revenue Authority PIN.
custNmstringOptionalCustomer or supplier name.
ocrnDtstringRequiredOccurrence date in YYYYMMDD format.
totItemCntnumberRequiredTotal number of line items.
totTaxblAmtnumberRequiredTotal taxable amount.
totTaxnumberRequiredTotal VAT amount.
totAmtnumberRequiredTotal amount inclusive of VAT.
remarkstringOptionalOptional remark.
itemListarrayRequiredArray of stock movement items.
itemList[].itemCdstringRequiredRegistered item code.
itemList[].itemNmstringRequiredItem name.
itemList[].stockTyCdstringRequiredStock movement type code (01-03, 11-13).
itemList[].qtynumberRequiredQuantity moved.
itemList[].unitPricenumberRequiredUnit price.
itemList[].totAmtnumberRequiredTotal 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
      }
    ]
  }'