Products
Function-calling namespace: products
- 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.
create
Source: backend/endpoints/products/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | Yes | - |
code | string | No | - |
description | string | No | - |
imageUrls | array<string> | No | - |
mrp | number | Yes | - |
sellingPrice | number | No | - |
onlinePrice | number | No | - |
offlinePrice | number | No | - |
strength | string | No | - |
strengthUnit | string | No | - |
medicineType | string | No | - |
drugClassification | string | No | - |
currency | string | No | - |
gender | string | No | - |
brandId | string | No | - |
manufacturerName | string | No | - |
consumeTypeId | string | No | - |
hsnCode | string | No | - |
batchNumber | string | No | - |
expiryDate | string | No | format: YYYY-MM-DD |
dosage | string | No | - |
about | string | No | - |
directionOfUse | string | No | - |
faq | array<object> | No | - |
sideEffects | array<object> | No | - |
safetyAdvice | array<object> | No | - |
stock | integer | No | - |
reorderLevel | integer | No | - |
inventoryCategoryId | string | No | - |
categoryIds | array<string> | No | - |
subcategoryIds | array<string> | No | - |
childSubcategoryIds | array<string> | No | - |
organizationId | string | Yes | - |
displayOrder | integer | No | - |
type | string | No | - |
isActive | boolean | No | - |
variants | array<object> | No | - |
Nested Field Structures
sideEffects item
| Field | Type | Required | Constraints |
|---|---|---|---|
title | string | No | - |
description | string | No | - |
safetyAdvice item
| Field | Type | Required | Constraints |
|---|---|---|---|
type | string | No | - |
status | string | No | - |
message | string | No | - |
variants item
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | No | - |
strength | string | No | - |
strengthUnit | string | No | - |
medicineType | string | No | - |
unitOfMeasure | string | No | - |
unitsPerPackage | integer | No | - |
mrp | number | No | - |
onlinePrice | number | No | - |
offlinePrice | number | No | - |
isDefault | boolean | No | - |
isActive | boolean | No | nullable |
displayOrder | 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": "products",
"apiName": "create",
"data": {
"name": "value",
"mrp": 1,
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/products/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
productId | 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": "products",
"apiName": "delete",
"data": {
"productId": "product_123"
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/products/get-by-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
productId | 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": "products",
"apiName": "getById",
"data": {
"productId": "product_123"
}
}'Example Response
{ "status": "ok", "data": {} }getBySlug
Source: backend/endpoints/products/get-by-slug
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
slug | 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": "products",
"apiName": "getBySlug",
"data": {
"slug": "value"
}
}'Example Response
{ "status": "ok", "data": {} }getPatientById
Source: backend/endpoints/products/get-patient-by-id
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
productId | 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": "products",
"apiName": "getPatientById",
"data": {
"productId": "product_123"
}
}'Example Response
{ "status": "ok", "data": {} }listActiveCatalog
Source: backend/endpoints/products/list-active-catalog
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
search | string | No | - |
type | string | No | - |
organizationId | string | No | - |
minPrice | number | No | nullable |
maxPrice | number | No | nullable |
maxProce | number | No | nullable |
categoryId | string | No | - |
inventoryCategoryId | string | No | - |
platformServiceCategoryId | string | No | - |
sortBy | string | 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": "products",
"apiName": "listActiveCatalog",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listAllActive
Source: backend/endpoints/products/list-all-active
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationIds | array<string> | No | - |
categoryIds | array<string> | No | - |
subcategoryIds | array<string> | No | - |
childSubcategoryIds | array<string> | No | - |
search | string | No | - |
minPrice | number | No | nullable |
maxPrice | number | No | nullable |
genders | array<string> | No | - |
type | string | No | - |
brandId | string | No | - |
sortBy | string | No | - |
sortOrder | string | 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": "products",
"apiName": "listAllActive",
"data": {
"organizationIds": [
"value"
],
"categoryIds": [
"value"
],
"subcategoryIds": [
"value"
],
"childSubcategoryIds": [
"value"
],
"search": "value",
"minPrice": 1
}
}'Example Response
{ "status": "ok", "data": {} }listByOrganization
Source: backend/endpoints/products/list-by-organization
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | No | - |
organizationIds | array<string> | No | - |
isActive | boolean | No | nullable |
categoryId | string | No | nullable |
categoryIds | array<string> | No | - |
subcategoryId | string | No | nullable |
subcategoryIds | array<string> | No | - |
brandId | string | No | nullable |
search | string | No | - |
minPrice | number | No | nullable |
maxPrice | number | No | nullable |
gender | string | No | nullable |
type | string | No | nullable |
stockStatus | string | No | - |
expiringSoon | boolean | No | - |
expirySoon | boolean | No | - |
expired | boolean | No | - |
expiredInventory | boolean | No | - |
sortBy | string | No | - |
sortOrder | string | 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": "products",
"apiName": "listByOrganization",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listCategoriesWithCount
Source: backend/endpoints/products/list-categories-with-count
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
search | string | No | - |
type | string | No | - |
sortBy | string | No | - |
sortOrder | string | No | - |
cursor | string | 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": "products",
"apiName": "listCategoriesWithCount",
"data": {
"search": "value",
"type": "general",
"sortBy": "value",
"sortOrder": "value",
"cursor": "value",
"page": 1
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/products/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
productId | string | Yes | - |
name | string | No | nullable |
code | string | No | nullable |
description | string | No | nullable |
imageUrls | array<string> | No | nullable |
mrp | number | No | nullable |
sellingPrice | number | No | nullable |
onlinePrice | number | No | nullable |
offlinePrice | number | No | nullable |
strength | string | No | nullable |
strengthUnit | string | No | nullable |
medicineType | string | No | nullable |
drugClassification | string | No | nullable |
currency | string | No | nullable |
gender | string | No | nullable |
brandId | string | No | nullable |
manufacturerName | string | No | nullable |
consumeTypeId | string | No | nullable |
hsnCode | string | No | nullable |
batchNumber | string | No | nullable |
expiryDate | string | No | format: YYYY-MM-DD; nullable |
dosage | string | No | nullable |
about | string | No | nullable |
directionOfUse | string | No | nullable |
faq | array<object> | No | - |
sideEffects | array<object> | No | nullable |
safetyAdvice | array<object> | No | nullable |
stock | integer | No | nullable |
reorderLevel | integer | No | nullable |
inventoryCategoryId | string | No | nullable |
categoryIds | array<string> | No | nullable |
subcategoryIds | array<string> | No | nullable |
childSubcategoryIds | array<string> | No | nullable |
organizationId | string | No | nullable |
displayOrder | integer | No | nullable |
type | string | No | nullable |
isActive | boolean | No | nullable |
variants | array<object> | No | nullable |
Nested Field Structures
sideEffects item
| Field | Type | Required | Constraints |
|---|---|---|---|
title | string | No | - |
description | string | No | - |
safetyAdvice item
| Field | Type | Required | Constraints |
|---|---|---|---|
type | string | No | - |
status | string | No | - |
message | string | No | - |
variants item
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | No | - |
strength | string | No | - |
strengthUnit | string | No | - |
medicineType | string | No | - |
unitOfMeasure | string | No | - |
unitsPerPackage | integer | No | - |
mrp | number | No | - |
onlinePrice | number | No | - |
offlinePrice | number | No | - |
isDefault | boolean | No | - |
isActive | boolean | No | nullable |
displayOrder | 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": "products",
"apiName": "update",
"data": {
"productId": "product_123"
}
}'Example Response
{ "status": "ok", "data": {} }