EndpointsProducts

Products

Function-calling namespace: products

  • 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.

create

Source: backend/endpoints/products/create

Input Fields

FieldTypeRequiredConstraints
namestringYes-
codestringNo-
descriptionstringNo-
imageUrlsarray<string>No-
mrpnumberYes-
sellingPricenumberNo-
onlinePricenumberNo-
offlinePricenumberNo-
strengthstringNo-
strengthUnitstringNo-
medicineTypestringNo-
drugClassificationstringNo-
currencystringNo-
genderstringNo-
brandIdstringNo-
manufacturerNamestringNo-
consumeTypeIdstringNo-
hsnCodestringNo-
batchNumberstringNo-
expiryDatestringNoformat: YYYY-MM-DD
dosagestringNo-
aboutstringNo-
directionOfUsestringNo-
faqarray<object>No-
sideEffectsarray<object>No-
safetyAdvicearray<object>No-
stockintegerNo-
reorderLevelintegerNo-
inventoryCategoryIdstringNo-
categoryIdsarray<string>No-
subcategoryIdsarray<string>No-
childSubcategoryIdsarray<string>No-
organizationIdstringYes-
displayOrderintegerNo-
typestringNo-
isActivebooleanNo-
variantsarray<object>No-

Nested Field Structures

sideEffects item

FieldTypeRequiredConstraints
titlestringNo-
descriptionstringNo-

safetyAdvice item

FieldTypeRequiredConstraints
typestringNo-
statusstringNo-
messagestringNo-

variants item

FieldTypeRequiredConstraints
idstringNo-
strengthstringNo-
strengthUnitstringNo-
medicineTypestringNo-
unitOfMeasurestringNo-
unitsPerPackageintegerNo-
mrpnumberNo-
onlinePricenumberNo-
offlinePricenumberNo-
isDefaultbooleanNo-
isActivebooleanNonullable
displayOrderintegerNo-

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

FieldTypeRequiredConstraints
productIdstringYes-

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

FieldTypeRequiredConstraints
productIdstringYes-

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

FieldTypeRequiredConstraints
slugstringYes-

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

FieldTypeRequiredConstraints
productIdstringYes-

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

FieldTypeRequiredConstraints
searchstringNo-
typestringNo-
organizationIdstringNo-
minPricenumberNonullable
maxPricenumberNonullable
maxProcenumberNonullable
categoryIdstringNo-
inventoryCategoryIdstringNo-
platformServiceCategoryIdstringNo-
sortBystringNo-
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": "products",
  "apiName": "listActiveCatalog",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

listAllActive

Source: backend/endpoints/products/list-all-active

Input Fields

FieldTypeRequiredConstraints
organizationIdsarray<string>No-
categoryIdsarray<string>No-
subcategoryIdsarray<string>No-
childSubcategoryIdsarray<string>No-
searchstringNo-
minPricenumberNonullable
maxPricenumberNonullable
gendersarray<string>No-
typestringNo-
brandIdstringNo-
sortBystringNo-
sortOrderstringNo-
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": "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

FieldTypeRequiredConstraints
organizationIdstringNo-
organizationIdsarray<string>No-
isActivebooleanNonullable
categoryIdstringNonullable
categoryIdsarray<string>No-
subcategoryIdstringNonullable
subcategoryIdsarray<string>No-
brandIdstringNonullable
searchstringNo-
minPricenumberNonullable
maxPricenumberNonullable
genderstringNonullable
typestringNonullable
stockStatusstringNo-
expiringSoonbooleanNo-
expirySoonbooleanNo-
expiredbooleanNo-
expiredInventorybooleanNo-
sortBystringNo-
sortOrderstringNo-
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": "products",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

{ "status": "ok", "data": {} }

listCategoriesWithCount

Source: backend/endpoints/products/list-categories-with-count

Input Fields

FieldTypeRequiredConstraints
searchstringNo-
typestringNo-
sortBystringNo-
sortOrderstringNo-
cursorstringNo-
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": "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

FieldTypeRequiredConstraints
productIdstringYes-
namestringNonullable
codestringNonullable
descriptionstringNonullable
imageUrlsarray<string>Nonullable
mrpnumberNonullable
sellingPricenumberNonullable
onlinePricenumberNonullable
offlinePricenumberNonullable
strengthstringNonullable
strengthUnitstringNonullable
medicineTypestringNonullable
drugClassificationstringNonullable
currencystringNonullable
genderstringNonullable
brandIdstringNonullable
manufacturerNamestringNonullable
consumeTypeIdstringNonullable
hsnCodestringNonullable
batchNumberstringNonullable
expiryDatestringNoformat: YYYY-MM-DD; nullable
dosagestringNonullable
aboutstringNonullable
directionOfUsestringNonullable
faqarray<object>No-
sideEffectsarray<object>Nonullable
safetyAdvicearray<object>Nonullable
stockintegerNonullable
reorderLevelintegerNonullable
inventoryCategoryIdstringNonullable
categoryIdsarray<string>Nonullable
subcategoryIdsarray<string>Nonullable
childSubcategoryIdsarray<string>Nonullable
organizationIdstringNonullable
displayOrderintegerNonullable
typestringNonullable
isActivebooleanNonullable
variantsarray<object>Nonullable

Nested Field Structures

sideEffects item

FieldTypeRequiredConstraints
titlestringNo-
descriptionstringNo-

safetyAdvice item

FieldTypeRequiredConstraints
typestringNo-
statusstringNo-
messagestringNo-

variants item

FieldTypeRequiredConstraints
idstringNo-
strengthstringNo-
strengthUnitstringNo-
medicineTypestringNo-
unitOfMeasurestringNo-
unitsPerPackageintegerNo-
mrpnumberNo-
onlinePricenumberNo-
offlinePricenumberNo-
isDefaultbooleanNo-
isActivebooleanNonullable
displayOrderintegerNo-

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": {} }