EndpointsInventory Items

Inventory Items

Function-calling namespace: inventoryItems

  • Base URL: https://api.aivida.in
  • Engine endpoint: POST /api
  • Auth: Stack token middleware enabled in optional mode.
  • Send token in header: x-stack-access-token: <access_token> (or Authorization: Bearer <access_token>).
  • In optional mode: no token is allowed; invalid token is rejected with 401.

adjustStock

Source: backend/endpoints/inventory-items/adjust-stock

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
modulestringNo-
productIdstringNo-
variantIdstringNo-
inventoryItemIdstringNo-
quantityintegerYes-
reasonstringYes-
notesstringNo-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
modulestringNo-
itemNamestringYes-
categorystringNo-
genericNamestringNo-
brandNamestringNo-
unitOfMeasurestringNo-
hsnCodestringNo-
gstPercentagenumberNo-
mrpnumberNo-
onlinePricenumberNo-
offlinePricenumberNo-
supplierIdstringNo-
supplierNamestringNo-
quantityintegerNo-
unitPricenumberNo-
minStockintegerNo-
maxStockintegerNo-
locationIdstringNo-
locationNamestringNo-
batchNumberstringNo-
lotNumberstringNo-
expiryDatestringNoformat: 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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-

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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
locationIdstringNo-
batchIdstringNo-
searchstringNo-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
modulestringNo-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
productIdstringNo-
variantIdstringNo-
inventoryItemIdstringNo-
typestringYesoneof: ISSUE
quantityintegerYesgt: 0
issuedToIdstringNo-
issuedToNamestringNo-
issuedToTypestringNooneof: STAFF
departmentIdstringNo-
originalTransactionIdstringNo-
wastageReasonstringNo-
notesstringNo-
transactionAtintegerNounix-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

FieldTypeRequiredConstraints
organizationIdstringYes-
modulestringNo-
searchstringNo-
lowStockbooleanNo-
expiringSoonbooleanNo-
pageintegerNo-
pageSizeintegerNo-

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

FieldTypeRequiredConstraints
organizationIdstringYes-
productIdstringNo-
variantIdstringNo-
inventoryItemIdstringNo-
supplierIdstringNo-
quantityintegerNo-
quantityReceivedintegerNo-
purchasePricenumberNo-
unitPricenumberNo-
batchNumberstringNo-
lotNumberstringNo-
expiryDatestringNoformat: YYYY-MM-DD
notesstringNo-
receivedAtintegerNounix-ms timestamp
locationIdstringNo-

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

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
itemNamestringNonullable
categorystringNonullable
genericNamestringNonullable
brandNamestringNonullable
unitOfMeasurestringNonullable
hsnCodestringNonullable
gstPercentagenumberNonullable
mrpnumberNonullable
onlinePricenumberNonullable
offlinePricenumberNonullable
supplierIdstringNonullable
supplierNamestringNonullable
quantityintegerNonullable
unitPricenumberNonullable
minStockintegerNonullable
maxStockintegerNonullable
locationIdstringNonullable
locationNamestringNonullable
batchNumberstringNonullable
lotNumberstringNonullable
expiryDatestringNoformat: 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": {} }