EndpointsLab Provider

Lab Provider

Function-calling namespace: labProvider

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

cancelOrder

Source: backend/endpoints/lab-provider/cancel-order

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
externalOrderIdstringYes-
reasonKeystringNo-
reasonTextstringNo-
organizationIdstringNo-
labOrderIdstringNo-
providerOrderIdstringNo-

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": "labProvider",
  "apiName": "cancelOrder",
  "data": {
    "providerCode": "value",
    "externalOrderId": "externalorder_123"
  }
}'

Example Response

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

catalog

Source: backend/endpoints/lab-provider/catalog

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
minPricenumberNonullable
maxPricenumberNonullable
genderstringNo-
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": "labProvider",
  "apiName": "catalog",
  "data": {
    "providerCode": "value"
  }
}'

Example Response

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

getProvider

Source: backend/endpoints/lab-provider/get-provider

Input Fields

FieldTypeRequiredConstraints
providerCodestringYesExample: thyrocare

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": "labProvider",
  "apiName": "getProvider",
  "data": {
    "providerCode": "thyrocare"
  }
}'

Example Response

{
  "status": "ok",
  "data": {
    "providerCode": "thyrocare",
    "name": "Thyrocare",
    "slug": "thyrocare",
    "type": "diagnostic_center",
    "description": "Book pathology tests and home collection slots through Thyrocare.",
    "organizationId": "1773319982470739148-8f7eclP8",
    "supportsHomeCollection": true,
    "supportsPincodeCheck": true,
    "supportsSlotBooking": true,
    "metadata": {
      "providerKind": "external_lab"
    }
  }
}

createOrder

Source: backend/endpoints/lab-provider/create-order

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
organizationIdstringYes-
patientIdstringYes-
paymentIdstringYes-
doctorIdstringNo-
consultationIdstringNo-
prioritystringNo-
notesstringNo-
assignedTostringNo-
payloadobjectYes-

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": "labProvider",
  "apiName": "createOrder",
  "data": {
    "providerCode": "value",
    "organizationId": "org_123",
    "patientId": "patient_123",
    "paymentId": "payment_123",
    "payload": {}
  }
}'

Example Response

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

getOrder

Source: backend/endpoints/lab-provider/get-order

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
externalOrderIdstringYes-
includestringNo-

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": "labProvider",
  "apiName": "getOrder",
  "data": {
    "providerCode": "value",
    "externalOrderId": "externalorder_123"
  }
}'

Example Response

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

getPincodes

Source: backend/endpoints/lab-provider/get-pincodes

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-

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": "labProvider",
  "apiName": "getPincodes",
  "data": {
    "providerCode": "value"
  }
}'

Example Response

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

getReport

Source: backend/endpoints/lab-provider/get-report

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
organizationIdstringYes-
labOrderIdstringYes-
externalOrderIdstringYes-
leadIdstringYes-
typestringNo-
testNamestringNo-

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": "labProvider",
  "apiName": "getReport",
  "data": {
    "providerCode": "value",
    "organizationId": "org_123",
    "labOrderId": "laborder_123",
    "externalOrderId": "externalorder_123",
    "leadId": "lead_123"
  }
}'

Example Response

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

listOrders

Source: backend/endpoints/lab-provider/list-orders

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
startDatestringNoformat: YYYY-MM-DD
endDatestringNoformat: YYYY-MM-DD
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": "labProvider",
  "apiName": "listOrders",
  "data": {
    "providerCode": "value"
  }
}'

Example Response

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

listProviders

Source: backend/endpoints/lab-provider/list-providers

Input Fields

No input fields.

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": "labProvider",
  "apiName": "listProviders",
  "data": {}
}'

Example Response

{
  "status": "ok",
  "data": {
    "providers": [
      {
        "providerCode": "thyrocare",
        "name": "Thyrocare",
        "slug": "thyrocare",
        "type": "diagnostic_center",
        "description": "Book pathology tests and home collection slots through Thyrocare.",
        "organizationId": "1773319982470739148-8f7eclP8",
        "supportsHomeCollection": true,
        "supportsPincodeCheck": true,
        "supportsSlotBooking": true,
        "metadata": {
          "providerKind": "external_lab"
        }
      }
    ]
  }
}

priceBreakup

Source: backend/endpoints/lab-provider/price-breakup

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
payloadobjectYes-

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": "labProvider",
  "apiName": "priceBreakup",
  "data": {
    "providerCode": "value",
    "payload": {}
  }
}'

Example Response

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

rescheduleOrder

Source: backend/endpoints/lab-provider/reschedule-order

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
externalOrderIdstringYes-
appointmentDatestringNoformat: YYYY-MM-DD
reasonKeystringNo-
reasonTextstringNo-

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": "labProvider",
  "apiName": "rescheduleOrder",
  "data": {
    "providerCode": "value",
    "externalOrderId": "externalorder_123"
  }
}'

Example Response

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

searchSlots

Source: backend/endpoints/lab-provider/search-slots

Input Fields

FieldTypeRequiredConstraints
providerCodestringYes-
payloadobjectYes-

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": "labProvider",
  "apiName": "searchSlots",
  "data": {
    "providerCode": "value",
    "payload": {}
  }
}'

Example Response

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