EndpointsProvider Orders

Provider Orders

Function-calling namespace: providerOrders

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

cancel

Source: backend/endpoints/provider-orders/cancel

Input Fields

FieldTypeRequiredConstraints
orderIdstringYes-
stackUserIdstringNo-
reasonstringNo-

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": "providerOrders",
  "apiName": "cancel",
  "data": {
    "orderId": "order_123"
  }
}'

Example Response

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

checkOrganizationDeliverySetup

Source: backend/endpoints/provider-orders/check-organization-delivery-setup

Input schema type: services.OrganizationDeliverySetupRequest

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

Example Response

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

checkServiceability

Source: backend/endpoints/provider-orders/check-serviceability

Input schema type: services.CheckServiceabilityRequest

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

Example Response

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

create

Source: backend/endpoints/provider-orders/create

Input Fields

FieldTypeRequiredConstraints
patientProfileIdstringYes-
organizationIdstringYes-
sourceTypestringYes-
collectionTypestringNo-
isHomeCollectionbooleanNonullable
prescriptionIdstringNo-
labOrderIdstringNo-
labPackageIdstringNo-
productIdstringNo-
appointmentIdstringNo-
consultationIdstringNo-
saloonLocationIdstringNo-
saloonServiceIdstringNo-
saloonStylistIdstringNo-
scheduledDatestringNoformat: YYYY-MM-DD
scheduledTimestringNoformat: HH:mm
durationMinutesintegerNonullable
itemsarray<object>Yes-
subtotalnumberNo-
statusstringNo-
deliveryAddressobjectNonullable
confirmedAtintegerNounix-ms timestamp; nullable
packingAtintegerNounix-ms timestamp; nullable
dispatchedAtintegerNounix-ms timestamp; nullable
outForDeliveryAtintegerNounix-ms timestamp; nullable
deliveredAtintegerNounix-ms timestamp; nullable
collectedAtintegerNounix-ms timestamp; nullable
processingAtintegerNounix-ms timestamp; nullable
completedAtintegerNounix-ms timestamp; nullable
patientNotesstringNo-
providerNotesstringNo-
razorpayOrderIdstringNo-
razorpayPaymentIdstringNo-
razorpaySignaturestringNo-
paymentStatusstringNo-
amountPaidnumberNonullable
paidAtintegerNounix-ms timestamp; nullable
paymentMethodstringNo-
checkoutSessionIdstringNo-
paymentRecordobjectNonullable
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-ms timestamp; nullable

Nested Field Structures

items item

FieldTypeRequiredConstraints
namestringNo-
codestringNo-
serviceIdstringNo-
itemTypestringNo-
packageIdstringNo-
productIdstringNo-
providerCodestringNo-
providerItemIdstringNo-
imageUrlsarray<string>No-
pricenumberNo-
quantityintegerNonullable
slotDatestringNoformat: YYYY-MM-DD
slotTimestringNoformat: HH:mm
reviewStatusstringNo-
serviceobjectNonullable

deliveryAddress

FieldTypeRequiredConstraints
namestringNo-
streetstringNo-
landmarkstringNo-
citystringNo-
statestringNo-
postalCodestringNo-
phonestringNo-
latitudenumberNonullable
longitudenumberNonullable
instructionsstringNo-

paymentRecord

FieldTypeRequiredConstraints
gatewaystringNo-
razorpayOrderIdstringNo-
razorpayPaymentIdstringNo-
razorpaySignaturestringNo-
paymentStatusstringNo-
amountPaidnumberNonullable
paidAtintegerNounix-ms timestamp; nullable
paymentMethodstringNo-
checkoutSessionIdstringNo-

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": "providerOrders",
  "apiName": "create",
  "data": {
    "patientProfileId": "patientprofile_123",
    "organizationId": "org_123",
    "sourceType": "general",
    "items": [
      {
        "name": "value",
        "code": "value",
        "serviceId": "service_123",
        "itemType": "general",
        "packageId": "package_123",
        "productId": "product_123",
        "providerCode": "value",
        "providerItemId": "provideritem_123",
        "imageUrls": [
          "value"
        ],
        "price": 1,
        "quantity": 1,
        "slotDate": "2026-03-12",
        "slotTime": "10:30",
        "reviewStatus": "scheduled",
        "service": {
          "_id": "__123",
          "organizationId": "org_123",
          "organization": {
            "_id": "__123",
            "stackTeamId": "org_123",
            "name": "value",
            "slug": "value",
            "verificationStatus": "scheduled",
            "type": "general",
            "organizationTypeId": "organizationtype_123",
            "organizationTypeName": "value",
            "facilities": {},
            "logoId": "logo_123",
            "logoUrl": "value",
            "settings": {},
            "address": "221B Baker Street",
            "coordinates": {},
            "addressStreet": "221B Baker Street",
            "addressCity": "221B Baker Street",
            "addressState": "221B Baker Street",
            "addressPostalCode": "221B Baker Street",
            "addressCountry": "221B Baker Street",
            "contactEmail": "user@example.com",
            "contactPhone": "+911234567890",
            "contactCustomerCarePhone": "+911234567890",
            "contactCustomerCareEmail": "user@example.com",
            "bankDetails": {},
            "openingHours": {},
            "serviceAudiences": [
              "value"
            ],
            "serviceOccasions": [
              "value"
            ],
            "commissionPercent": 1,
            "totalReviews": 1,
            "averageRatings": 1,
            "isActive": true,
            "isDeleted": false,
            "deletedAt": 1710201600000,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "categoryId": "category_123",
          "categoryIds": [
            "value"
          ],
          "category": {
            "_id": "__123",
            "organizationId": "org_123",
            "platformCategoryId": "platformcategory_123",
            "name": "value",
            "code": "value",
            "type": "general",
            "description": "value",
            "icon": "value",
            "sortOrder": 1,
            "isActive": true,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "platformCategoryId": "platformcategory_123",
          "platformCategoryIds": [
            "value"
          ],
          "platformCategory": {
            "_id": "__123",
            "name": "value",
            "code": "value",
            "slug": "value",
            "type": "general",
            "description": "value",
            "imageUrl": "value",
            "videoUrl": "value",
            "isActive": true,
            "sortOrder": 1,
            "parentIds": [
              "value"
            ],
            "organizationTypeIds": [
              "value"
            ],
            "organizationTypeNames": [
              "value"
            ],
            "dependentServicesCount": 1,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "departmentId": "department_123",
          "platformDepartmentId": "org_123",
          "department": {
            "_id": "__123",
            "organizationId": "org_123",
            "platformDepartmentId": "org_123",
            "name": "value",
            "code": "value",
            "description": "value",
            "hodUserId": "hoduser_123",
            "operatingHours": {},
            "isActive": true,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "platformDepartment": {
            "_id": "__123",
            "name": "value",
            "code": "value",
            "description": "value",
            "category": "value",
            "imageUrl": "value",
            "role": "value",
            "roles": [
              "value"
            ],
            "serviceCount": 1,
            "isActive": true,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "name": "value",
          "code": "value",
          "description": "value",
          "imageId": "image_123",
          "imageUrl": [
            "value"
          ],
          "type": "general",
          "serviceCategory": "value",
          "chargeType": "general",
          "unit": "value",
          "basePrice": 1,
          "mrp": 1,
          "minAge": 1,
          "maxAge": 1,
          "consumeTypeId": "consumetype_123",
          "hsnCode": "value",
          "batchNumber": "value",
          "expiryDate": "2026-03-12",
          "dosage": "value",
          "prescriptionType": "general",
          "sideEffects": [
            {
              "title": "value",
              "description": "value"
            }
          ],
          "safetyAdvice": [
            {
              "type": "general",
              "status": "scheduled",
              "message": "value"
            }
          ],
          "discount": 1,
          "currency": "INR",
          "gender": [
            "value"
          ],
          "doctorId": "doctor_123",
          "doctorProfile": {
            "_id": "__123",
            "userId": "user_123",
            "displayName": "value",
            "user": {},
            "organizationId": "org_123",
            "departmentId": "department_123",
            "department": {},
            "platformDepartment": {},
            "experience": 1,
            "experiences": [],
            "bio": "value",
            "languages": [
              "value"
            ],
            "conditions": [
              "diabetes",
              "fever"
            ],
            "gender": "value",
            "registrationNumber": "value",
            "doctorSignature": "value",
            "isAvailableForOnline": true,
            "weeklySchedule": [],
            "slotDuration": 1,
            "profileImageId": "profileimage_123",
            "profileImageUrl": "value",
            "education": [],
            "awards": [
              "value"
            ],
            "phone": "+911234567890",
            "address": "221B Baker Street",
            "isVerified": true,
            "verifiedAt": 1710201600000,
            "documents": [],
            "totalReviews": 1,
            "averageRating": 1,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "user": {
            "_id": "__123",
            "stackUserId": "stackuser_123",
            "organizationId": "org_123",
            "organizationBranchIds": [
              "value"
            ],
            "organizationBranches": [],
            "email": "user@example.com",
            "title": "value",
            "displayName": "value",
            "avatarUrl": "value",
            "role": "value",
            "roles": [
              "value"
            ],
            "isActive": true,
            "isBlocked": true,
            "blockedAt": 1710201600000,
            "blockedBy": "value",
            "lastLoginAt": 1710201600000,
            "isVerified": true,
            "verifiedAt": 1710201600000,
            "verifiedBy": "value",
            "gender": "value",
            "yoe": 1,
            "totalReviews": 1,
            "averageRatings": 1,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "isAvailableToday": true,
          "consultationTypes": [
            "value"
          ],
          "consultationType": "general",
          "isHomeCollectionAvailable": true,
          "sampleType": "general",
          "videoUrl": [
            "value"
          ],
          "faq": [],
          "metadata": {
            "sampleType": "general",
            "turnaroundTime": "10:30",
            "manufacturer": "value",
            "dosageForm": "value",
            "strength": "value",
            "composition": "value",
            "packSize": "value",
            "modality": "value",
            "bodyPart": "value",
            "locationId": "location_123",
            "category": "value",
            "durationMinutes": 1,
            "modelNumber": "value",
            "specifications": "value",
            "stockQuantity": 1,
            "reorderLevel": 1,
            "lastStockUpdate": "2026-03-12"
          },
          "usage": {},
          "totalReviews": 1,
          "averageRatings": 1,
          "isBestSeller": true,
          "feedbacks": [
            {
              "id": "id_123",
              "providerOrderId": "providerorder_123",
              "serviceId": "service_123",
              "patientId": "patient_123",
              "rating": 1,
              "review": "value",
              "images": [
                "value"
              ],
              "createdAt": 1710201600000,
              "updatedAt": 1710201600000,
              "patientDetails": {}
            }
          ],
          "isActive": true,
          "isPublic": true,
          "isDeleted": false,
          "deletedAt": 1710201600000,
          "createdAt": 1710201600000,
          "updatedAt": 1710201600000,
          "status": "scheduled"
        }
      }
    ]
  }
}'

Example Response

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

createByLabTechnician

Source: backend/endpoints/provider-orders/create-by-lab-technician

Input Fields

FieldTypeRequiredConstraints
serviceIdstringYes-
patientProfileIdstringNo-
patient_profile_idstringNo-
organizationIdstringNo-
organization_idstringNo-
slot_datestringYesformat: YYYY-MM-DD
slot_timestringYesformat: HH:mm
collectionTypestringNo-
collection_typestringNo-
isHomeCollectionbooleanNonullable
is_home_collectionbooleanNonullable

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": "providerOrders",
  "apiName": "createByLabTechnician",
  "data": {
    "serviceId": "service_123",
    "slot_date": "2026-03-12",
    "slot_time": "10:30"
  }
}'

Example Response

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

createPending

Source: backend/endpoints/provider-orders/create-pending

Input Fields

FieldTypeRequiredConstraints
patientProfileIdstringYes-
organizationIdstringYes-
sourceTypestringYes-
collectionTypestringNo-
isHomeCollectionbooleanNonullable
prescriptionIdstringNo-
labOrderIdstringNo-
appointmentIdstringNo-
consultationIdstringNo-
saloonLocationIdstringNo-
saloonServiceIdstringNo-
saloonStylistIdstringNo-
scheduledDatestringNoformat: YYYY-MM-DD
scheduledTimestringNoformat: HH:mm
durationMinutesintegerNonullable
itemsarray<object>Yes-
subtotalnumberNo-
statusstringNo-
deliveryAddressobjectNonullable
patientNotesstringNo-
providerNotesstringNo-
razorpayOrderIdstringNo-
paymentMethodstringNo-
checkoutSessionIdstringNo-
paymentRecordobjectNonullable

Nested Field Structures

items item

FieldTypeRequiredConstraints
namestringNo-
codestringNo-
serviceIdstringNo-
itemTypestringNo-
packageIdstringNo-
productIdstringNo-
providerCodestringNo-
providerItemIdstringNo-
imageUrlsarray<string>No-
pricenumberNo-
quantityintegerNonullable
slotDatestringNoformat: YYYY-MM-DD
slotTimestringNoformat: HH:mm
reviewStatusstringNo-
serviceobjectNonullable

deliveryAddress

FieldTypeRequiredConstraints
namestringNo-
streetstringNo-
landmarkstringNo-
citystringNo-
statestringNo-
postalCodestringNo-
phonestringNo-
latitudenumberNonullable
longitudenumberNonullable
instructionsstringNo-

paymentRecord

FieldTypeRequiredConstraints
gatewaystringNo-
razorpayOrderIdstringNo-
paymentStatusstringNo-
amountPaidnumberNonullable
paidAtintegerNounix-ms timestamp; nullable
paymentMethodstringNo-
checkoutSessionIdstringNo-

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": "providerOrders",
  "apiName": "createPending",
  "data": {
    "patientProfileId": "patientprofile_123",
    "organizationId": "org_123",
    "sourceType": "general",
    "items": [
      {
        "name": "value",
        "code": "value",
        "serviceId": "service_123",
        "itemType": "general",
        "packageId": "package_123",
        "productId": "product_123",
        "providerCode": "value",
        "providerItemId": "provideritem_123",
        "imageUrls": [
          "value"
        ],
        "price": 1,
        "quantity": 1,
        "slotDate": "2026-03-12",
        "slotTime": "10:30",
        "reviewStatus": "scheduled",
        "service": {
          "_id": "__123",
          "organizationId": "org_123",
          "organization": {
            "_id": "__123",
            "stackTeamId": "org_123",
            "name": "value",
            "slug": "value",
            "verificationStatus": "scheduled",
            "type": "general",
            "organizationTypeId": "organizationtype_123",
            "organizationTypeName": "value",
            "facilities": {},
            "logoId": "logo_123",
            "logoUrl": "value",
            "settings": {},
            "address": "221B Baker Street",
            "coordinates": {},
            "addressStreet": "221B Baker Street",
            "addressCity": "221B Baker Street",
            "addressState": "221B Baker Street",
            "addressPostalCode": "221B Baker Street",
            "addressCountry": "221B Baker Street",
            "contactEmail": "user@example.com",
            "contactPhone": "+911234567890",
            "contactCustomerCarePhone": "+911234567890",
            "contactCustomerCareEmail": "user@example.com",
            "bankDetails": {},
            "openingHours": {},
            "serviceAudiences": [
              "value"
            ],
            "serviceOccasions": [
              "value"
            ],
            "commissionPercent": 1,
            "totalReviews": 1,
            "averageRatings": 1,
            "isActive": true,
            "isDeleted": false,
            "deletedAt": 1710201600000,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "categoryId": "category_123",
          "categoryIds": [
            "value"
          ],
          "category": {
            "_id": "__123",
            "organizationId": "org_123",
            "platformCategoryId": "platformcategory_123",
            "name": "value",
            "code": "value",
            "type": "general",
            "description": "value",
            "icon": "value",
            "sortOrder": 1,
            "isActive": true,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "platformCategoryId": "platformcategory_123",
          "platformCategoryIds": [
            "value"
          ],
          "platformCategory": {
            "_id": "__123",
            "name": "value",
            "code": "value",
            "slug": "value",
            "type": "general",
            "description": "value",
            "imageUrl": "value",
            "videoUrl": "value",
            "isActive": true,
            "sortOrder": 1,
            "parentIds": [
              "value"
            ],
            "organizationTypeIds": [
              "value"
            ],
            "organizationTypeNames": [
              "value"
            ],
            "dependentServicesCount": 1,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "departmentId": "department_123",
          "platformDepartmentId": "org_123",
          "department": {
            "_id": "__123",
            "organizationId": "org_123",
            "platformDepartmentId": "org_123",
            "name": "value",
            "code": "value",
            "description": "value",
            "hodUserId": "hoduser_123",
            "operatingHours": {},
            "isActive": true,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "platformDepartment": {
            "_id": "__123",
            "name": "value",
            "code": "value",
            "description": "value",
            "category": "value",
            "imageUrl": "value",
            "role": "value",
            "roles": [
              "value"
            ],
            "serviceCount": 1,
            "isActive": true,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "name": "value",
          "code": "value",
          "description": "value",
          "imageId": "image_123",
          "imageUrl": [
            "value"
          ],
          "type": "general",
          "serviceCategory": "value",
          "chargeType": "general",
          "unit": "value",
          "basePrice": 1,
          "mrp": 1,
          "minAge": 1,
          "maxAge": 1,
          "consumeTypeId": "consumetype_123",
          "hsnCode": "value",
          "batchNumber": "value",
          "expiryDate": "2026-03-12",
          "dosage": "value",
          "prescriptionType": "general",
          "sideEffects": [
            {
              "title": "value",
              "description": "value"
            }
          ],
          "safetyAdvice": [
            {
              "type": "general",
              "status": "scheduled",
              "message": "value"
            }
          ],
          "discount": 1,
          "currency": "INR",
          "gender": [
            "value"
          ],
          "doctorId": "doctor_123",
          "doctorProfile": {
            "_id": "__123",
            "userId": "user_123",
            "displayName": "value",
            "user": {},
            "organizationId": "org_123",
            "departmentId": "department_123",
            "department": {},
            "platformDepartment": {},
            "experience": 1,
            "experiences": [],
            "bio": "value",
            "languages": [
              "value"
            ],
            "conditions": [
              "diabetes",
              "fever"
            ],
            "gender": "value",
            "registrationNumber": "value",
            "doctorSignature": "value",
            "isAvailableForOnline": true,
            "weeklySchedule": [],
            "slotDuration": 1,
            "profileImageId": "profileimage_123",
            "profileImageUrl": "value",
            "education": [],
            "awards": [
              "value"
            ],
            "phone": "+911234567890",
            "address": "221B Baker Street",
            "isVerified": true,
            "verifiedAt": 1710201600000,
            "documents": [],
            "totalReviews": 1,
            "averageRating": 1,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "user": {
            "_id": "__123",
            "stackUserId": "stackuser_123",
            "organizationId": "org_123",
            "organizationBranchIds": [
              "value"
            ],
            "organizationBranches": [],
            "email": "user@example.com",
            "title": "value",
            "displayName": "value",
            "avatarUrl": "value",
            "role": "value",
            "roles": [
              "value"
            ],
            "isActive": true,
            "isBlocked": true,
            "blockedAt": 1710201600000,
            "blockedBy": "value",
            "lastLoginAt": 1710201600000,
            "isVerified": true,
            "verifiedAt": 1710201600000,
            "verifiedBy": "value",
            "gender": "value",
            "yoe": 1,
            "totalReviews": 1,
            "averageRatings": 1,
            "createdAt": 1710201600000,
            "updatedAt": 1710201600000
          },
          "isAvailableToday": true,
          "consultationTypes": [
            "value"
          ],
          "consultationType": "general",
          "isHomeCollectionAvailable": true,
          "sampleType": "general",
          "videoUrl": [
            "value"
          ],
          "faq": [],
          "metadata": {
            "sampleType": "general",
            "turnaroundTime": "10:30",
            "manufacturer": "value",
            "dosageForm": "value",
            "strength": "value",
            "composition": "value",
            "packSize": "value",
            "modality": "value",
            "bodyPart": "value",
            "locationId": "location_123",
            "category": "value",
            "durationMinutes": 1,
            "modelNumber": "value",
            "specifications": "value",
            "stockQuantity": 1,
            "reorderLevel": 1,
            "lastStockUpdate": "2026-03-12"
          },
          "usage": {},
          "totalReviews": 1,
          "averageRatings": 1,
          "isBestSeller": true,
          "feedbacks": [
            {
              "id": "id_123",
              "providerOrderId": "providerorder_123",
              "serviceId": "service_123",
              "patientId": "patient_123",
              "rating": 1,
              "review": "value",
              "images": [
                "value"
              ],
              "createdAt": 1710201600000,
              "updatedAt": 1710201600000,
              "patientDetails": {}
            }
          ],
          "isActive": true,
          "isPublic": true,
          "isDeleted": false,
          "deletedAt": 1710201600000,
          "createdAt": 1710201600000,
          "updatedAt": 1710201600000,
          "status": "scheduled"
        }
      }
    ]
  }
}'

Example Response

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

delete

Source: backend/endpoints/provider-orders/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": "providerOrders",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

getAdminOrders

Source: backend/endpoints/provider-orders/get-admin-orders

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
statusstringNo-
sourceTypestringNo-
paymentStatusstringNo-
searchstringNo-
startDatestringNoformat: YYYY-MM-DD
endDatestringNoformat: YYYY-MM-DD
limitintegerNo-

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": "providerOrders",
  "apiName": "getAdminOrders",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

getAdminOrderStats

Source: backend/endpoints/provider-orders/get-admin-order-stats

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
sourceTypestringNo-
startDatestringNoformat: YYYY-MM-DD
endDatestringNoformat: 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": "providerOrders",
  "apiName": "getAdminOrderStats",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

getById

Source: backend/endpoints/provider-orders/get-by-id

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": "providerOrders",
  "apiName": "getById",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

getMineById

Source: backend/endpoints/provider-orders/get-mine-by-id

Input Fields

FieldTypeRequiredConstraints
idstringYes-
stackUserIdstringNo-

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": "providerOrders",
  "apiName": "getMineById",
  "data": {
    "id": "id_123"
  }
}'

Example Response

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

getPharmacyDashboardStats

Source: backend/endpoints/provider-orders/get-pharmacy-dashboard-stats

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
trendRangestringNo-
trendStartDatestringNoformat: YYYY-MM-DD
trendEndDatestringNoformat: 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": "providerOrders",
  "apiName": "getPharmacyDashboardStats",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

getPharmacyReport

Source: backend/endpoints/provider-orders/get-pharmacy-report

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
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": "providerOrders",
  "apiName": "getPharmacyReport",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

listByOrganization

Source: backend/endpoints/provider-orders/list-by-organization

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
sourceTypestringNonullable
statusstringNonullable
statusesarray<string>No-
orderStatusesarray<string>No-
paymentStatusstringNonullable
paymentStatusesarray<string>No-
searchstringNo-
sortBystringNo-
sortOrderstringNo-
startDatestringNoformat: YYYY-MM-DD
endDatestringNoformat: YYYY-MM-DD
minAmountnumberNonullable
maxAmountnumberNonullable
pageintegerNo-
pageSizeintegerNo-

Response Notes

  • The response includes statusOptions for building the status filter UI.
  • Provider order statuses are returned as enum-style uppercase values: PENDING, CONFIRMED, PACKING, READY_FOR_DISPATCH, OUT_FOR_DELIVERY, DELIVERED, CANCELLED.
  • Lowercase or hyphenated status filters are accepted by the backend and normalized before querying.
  • For sourceType: "lab_order", status filters can use PENDING, CONFIRMED, PACKING, READY_FOR_DISPATCH, OUT_FOR_DELIVERY, DELIVERED, CANCELLED.
  • For sourceType: "prescription", status filters use the same uppercase provider-order lifecycle.
  • If sourceType is omitted or unknown, the response returns the combined provider-order status list.

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": "providerOrders",
  "apiName": "listByOrganization",
  "data": {
    "organizationId": "org_123"
  }
}'

Example Response

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

listByPatientId

Source: backend/endpoints/provider-orders/list-by-patient-id

Input Fields

FieldTypeRequiredConstraints
patientIdstringYes-
searchstringNonullable
sourceTypearray<string>No-
statusstringNonullable
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": "providerOrders",
  "apiName": "listByPatientId",
  "data": {
    "patientId": "patient_123"
  }
}'

Example Response

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

listMine

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

Input Fields

FieldTypeRequiredConstraints
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": "providerOrders",
  "apiName": "listMine",
  "data": {
    "page": 1,
    "pageSize": 1
  }
}'

Example Response

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

markPaymentSuccess

Source: backend/endpoints/provider-orders/mark-payment-success

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
statusstringNo-
amountPaidnumberNonullable
paidAtintegerNounix-ms timestamp; nullable
paymentMethodstringNo-
razorpayOrderIdstringNo-
razorpayPaymentIdstringNo-
razorpaySignaturestringNo-
checkoutSessionIdstringNo-
skipInvoicebooleanNo-

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": "providerOrders",
  "apiName": "markPaymentSuccess",
  "data": {
    "id": "id_123",
    "organizationId": "org_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/provider-orders/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
patientProfileIdstringNonullable
sourceTypestringNonullable
collectionTypestringNonullable
isHomeCollectionbooleanNonullable
prescriptionIdstringNonullable
labOrderIdstringNonullable
labPackageIdstringNonullable
productIdstringNonullable
appointmentIdstringNonullable
consultationIdstringNonullable
itemsarray<object>Nonullable
subtotalnumberNonullable
statusstringNonullable
deliveryAddressobjectNonullable
collectedAtintegerNounix-ms timestamp; nullable
processingAtintegerNounix-ms timestamp; nullable
completedAtintegerNounix-ms timestamp; nullable
cancelledReasonstringNonullable
patientNotesstringNonullable
providerNotesstringNonullable
razorpayOrderIdstringNonullable
razorpayPaymentIdstringNonullable
razorpaySignaturestringNonullable
paymentStatusstringNonullable
amountPaidnumberNonullable
paidAtintegerNounix-ms timestamp; nullable
paymentMethodstringNonullable
checkoutSessionIdstringNonullable
labResultFilesarray<object>Nonullable
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-ms timestamp; nullable

Nested Field Structures

items item

FieldTypeRequiredConstraints
namestringNo-
codestringNo-
serviceIdstringNo-
itemTypestringNo-
packageIdstringNo-
productIdstringNo-
providerCodestringNo-
providerItemIdstringNo-
imageUrlsarray<string>No-
pricenumberNo-
quantityintegerNonullable
slotDatestringNoformat: YYYY-MM-DD
slotTimestringNoformat: HH:mm
reviewStatusstringNo-
serviceobjectNonullable

deliveryAddress

FieldTypeRequiredConstraints
namestringNo-
streetstringNo-
landmarkstringNo-
citystringNo-
statestringNo-
postalCodestringNo-
phonestringNo-
latitudenumberNonullable
longitudenumberNonullable
instructionsstringNo-

labResultFiles item

FieldTypeRequiredConstraints
fileUrlstringNo-
fileIdstringNo-
fileNamestringNo-
fileSizeintegerNonullable
mimeTypestringNo-
testNamestringNo-
uploadedBystringNo-

Status and Fulfillment Notes

  • status accepts lowercase, uppercase, hyphenated, or spaced values and stores the normalized uppercase value.
  • Allowed order statuses: PENDING, CONFIRMED, PACKING, READY_FOR_DISPATCH, OUT_FOR_DELIVERY, DELIVERED, CANCELLED.
  • PACKING updates only the customer-facing provider order.
  • READY_FOR_DISPATCH updates the order and fulfillment status, then triggers Shadowfax dispatch-ready flow when applicable.
  • DELIVERED sets deliveredAt on both provider order and fulfillment, creates a manual completion audit entry, and skips the provider call if the provider already marked the order delivered.
  • CANCELLED updates both order and fulfillment and calls provider cancellation when supported.

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": "providerOrders",
  "apiName": "update",
  "data": {
    "id": "provider_order_123",
    "organizationId": "org_123",
    "status": "READY_FOR_DISPATCH"
  }
}'

Example Response

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