Inventory Items
Function-calling namespace: inventoryItems
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
adjustStock
Source: backend/endpoints/inventory-items/adjust-stock
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
module | string | No | - |
productId | string | No | - |
variantId | string | No | - |
inventoryItemId | string | No | - |
quantity | integer | Yes | - |
reason | string | Yes | - |
notes | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "adjustStock",
"data": {
"organizationId": "org_123",
"quantity": 1,
"reason": "value"
}
}'Example Response
{ "status": "ok", "data": {} }create
Source: backend/endpoints/inventory-items/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
module | string | No | - |
itemName | string | Yes | - |
category | string | No | - |
genericName | string | No | - |
brandName | string | No | - |
unitOfMeasure | string | No | - |
hsnCode | string | No | - |
gstPercentage | number | No | - |
mrp | number | No | - |
onlinePrice | number | No | - |
offlinePrice | number | No | - |
supplierId | string | No | - |
supplierName | string | No | - |
quantity | integer | No | - |
unitPrice | number | No | - |
minStock | integer | No | - |
maxStock | integer | No | - |
locationId | string | No | - |
locationName | string | No | - |
batchNumber | string | No | - |
lotNumber | string | No | - |
expiryDate | string | No | format: YYYY-MM-DD |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "create",
"data": {
"organizationId": "org_123",
"itemName": "value"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/inventory-items/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "delete",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/inventory-items/get-by-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
locationId | string | No | - |
batchId | string | No | - |
search | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "getById",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getStats
Source: backend/endpoints/inventory-items/get-stats
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
module | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "getStats",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }issueStock
Source: backend/endpoints/inventory-items/issue-stock
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
productId | string | No | - |
variantId | string | No | - |
inventoryItemId | string | No | - |
type | string | Yes | oneof: ISSUE |
quantity | integer | Yes | gt: 0 |
issuedToId | string | No | - |
issuedToName | string | No | - |
issuedToType | string | No | oneof: STAFF |
departmentId | string | No | - |
originalTransactionId | string | No | - |
wastageReason | string | No | - |
notes | string | No | - |
transactionAt | integer | No | unix-ms timestamp |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "issueStock",
"data": {
"organizationId": "org_123",
"type": "ISSUE",
"quantity": 1
}
}'Example Response
{ "status": "ok", "data": {} }list
Source: backend/endpoints/inventory-items/list
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
module | string | No | - |
search | string | No | - |
lowStock | boolean | No | - |
expiringSoon | boolean | No | - |
page | integer | No | - |
pageSize | integer | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "list",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }receiveStock
Source: backend/endpoints/inventory-items/receive-stock
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
productId | string | No | - |
variantId | string | No | - |
inventoryItemId | string | No | - |
supplierId | string | No | - |
quantity | integer | No | - |
quantityReceived | integer | No | - |
purchasePrice | number | No | - |
unitPrice | number | No | - |
batchNumber | string | No | - |
lotNumber | string | No | - |
expiryDate | string | No | format: YYYY-MM-DD |
notes | string | No | - |
receivedAt | integer | No | unix-ms timestamp |
locationId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "receiveStock",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/inventory-items/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
itemName | string | No | nullable |
category | string | No | nullable |
genericName | string | No | nullable |
brandName | string | No | nullable |
unitOfMeasure | string | No | nullable |
hsnCode | string | No | nullable |
gstPercentage | number | No | nullable |
mrp | number | No | nullable |
onlinePrice | number | No | nullable |
offlinePrice | number | No | nullable |
supplierId | string | No | nullable |
supplierName | string | No | nullable |
quantity | integer | No | nullable |
unitPrice | number | No | nullable |
minStock | integer | No | nullable |
maxStock | integer | No | nullable |
locationId | string | No | nullable |
locationName | string | No | nullable |
batchNumber | string | No | nullable |
lotNumber | string | No | nullable |
expiryDate | string | No | format: YYYY-MM-DD; nullable |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "inventoryItems",
"apiName": "update",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }