Provider Orders
Function-calling namespace: providerOrders
- 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.
cancel
Source: backend/endpoints/provider-orders/cancel
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
orderId | string | Yes | - |
stackUserId | string | No | - |
reason | string | 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": "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
| Field | Type | Required | Constraints |
|---|---|---|---|
patientProfileId | string | Yes | - |
organizationId | string | Yes | - |
sourceType | string | Yes | - |
collectionType | string | No | - |
isHomeCollection | boolean | No | nullable |
prescriptionId | string | No | - |
labOrderId | string | No | - |
labPackageId | string | No | - |
productId | string | No | - |
appointmentId | string | No | - |
consultationId | string | No | - |
saloonLocationId | string | No | - |
saloonServiceId | string | No | - |
saloonStylistId | string | No | - |
scheduledDate | string | No | format: YYYY-MM-DD |
scheduledTime | string | No | format: HH:mm |
durationMinutes | integer | No | nullable |
items | array<object> | Yes | - |
subtotal | number | No | - |
status | string | No | - |
deliveryAddress | object | No | nullable |
confirmedAt | integer | No | unix-ms timestamp; nullable |
packingAt | integer | No | unix-ms timestamp; nullable |
dispatchedAt | integer | No | unix-ms timestamp; nullable |
outForDeliveryAt | integer | No | unix-ms timestamp; nullable |
deliveredAt | integer | No | unix-ms timestamp; nullable |
collectedAt | integer | No | unix-ms timestamp; nullable |
processingAt | integer | No | unix-ms timestamp; nullable |
completedAt | integer | No | unix-ms timestamp; nullable |
patientNotes | string | No | - |
providerNotes | string | No | - |
razorpayOrderId | string | No | - |
razorpayPaymentId | string | No | - |
razorpaySignature | string | No | - |
paymentStatus | string | No | - |
amountPaid | number | No | nullable |
paidAt | integer | No | unix-ms timestamp; nullable |
paymentMethod | string | No | - |
checkoutSessionId | string | No | - |
paymentRecord | object | No | nullable |
createdAt | integer | No | unix-ms timestamp; nullable |
updatedAt | integer | No | unix-ms timestamp; nullable |
Nested Field Structures
items item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
code | string | No | - |
serviceId | string | No | - |
itemType | string | No | - |
packageId | string | No | - |
productId | string | No | - |
providerCode | string | No | - |
providerItemId | string | No | - |
imageUrls | array<string> | No | - |
price | number | No | - |
quantity | integer | No | nullable |
slotDate | string | No | format: YYYY-MM-DD |
slotTime | string | No | format: HH:mm |
reviewStatus | string | No | - |
service | object | No | nullable |
deliveryAddress
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
street | string | No | - |
landmark | string | No | - |
city | string | No | - |
state | string | No | - |
postalCode | string | No | - |
phone | string | No | - |
latitude | number | No | nullable |
longitude | number | No | nullable |
instructions | string | No | - |
paymentRecord
| Field | Type | Required | Constraints |
|---|---|---|---|
gateway | string | No | - |
razorpayOrderId | string | No | - |
razorpayPaymentId | string | No | - |
razorpaySignature | string | No | - |
paymentStatus | string | No | - |
amountPaid | number | No | nullable |
paidAt | integer | No | unix-ms timestamp; nullable |
paymentMethod | string | No | - |
checkoutSessionId | string | 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": "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
| Field | Type | Required | Constraints |
|---|---|---|---|
serviceId | string | Yes | - |
patientProfileId | string | No | - |
patient_profile_id | string | No | - |
organizationId | string | No | - |
organization_id | string | No | - |
slot_date | string | Yes | format: YYYY-MM-DD |
slot_time | string | Yes | format: HH:mm |
collectionType | string | No | - |
collection_type | string | No | - |
isHomeCollection | boolean | No | nullable |
is_home_collection | boolean | No | 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": "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
| Field | Type | Required | Constraints |
|---|---|---|---|
patientProfileId | string | Yes | - |
organizationId | string | Yes | - |
sourceType | string | Yes | - |
collectionType | string | No | - |
isHomeCollection | boolean | No | nullable |
prescriptionId | string | No | - |
labOrderId | string | No | - |
appointmentId | string | No | - |
consultationId | string | No | - |
saloonLocationId | string | No | - |
saloonServiceId | string | No | - |
saloonStylistId | string | No | - |
scheduledDate | string | No | format: YYYY-MM-DD |
scheduledTime | string | No | format: HH:mm |
durationMinutes | integer | No | nullable |
items | array<object> | Yes | - |
subtotal | number | No | - |
status | string | No | - |
deliveryAddress | object | No | nullable |
patientNotes | string | No | - |
providerNotes | string | No | - |
razorpayOrderId | string | No | - |
paymentMethod | string | No | - |
checkoutSessionId | string | No | - |
paymentRecord | object | No | nullable |
Nested Field Structures
items item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
code | string | No | - |
serviceId | string | No | - |
itemType | string | No | - |
packageId | string | No | - |
productId | string | No | - |
providerCode | string | No | - |
providerItemId | string | No | - |
imageUrls | array<string> | No | - |
price | number | No | - |
quantity | integer | No | nullable |
slotDate | string | No | format: YYYY-MM-DD |
slotTime | string | No | format: HH:mm |
reviewStatus | string | No | - |
service | object | No | nullable |
deliveryAddress
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
street | string | No | - |
landmark | string | No | - |
city | string | No | - |
state | string | No | - |
postalCode | string | No | - |
phone | string | No | - |
latitude | number | No | nullable |
longitude | number | No | nullable |
instructions | string | No | - |
paymentRecord
| Field | Type | Required | Constraints |
|---|---|---|---|
gateway | string | No | - |
razorpayOrderId | string | No | - |
paymentStatus | string | No | - |
amountPaid | number | No | nullable |
paidAt | integer | No | unix-ms timestamp; nullable |
paymentMethod | string | No | - |
checkoutSessionId | string | 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": "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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | 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": "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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
status | string | No | - |
sourceType | string | No | - |
paymentStatus | string | No | - |
search | string | No | - |
startDate | string | No | format: YYYY-MM-DD |
endDate | string | No | format: YYYY-MM-DD |
limit | 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": "providerOrders",
"apiName": "getAdminOrders",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getAdminOrderStats
Source: backend/endpoints/provider-orders/get-admin-order-stats
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
sourceType | string | No | - |
startDate | string | No | format: YYYY-MM-DD |
endDate | string | No | format: 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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | 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": "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
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
stackUserId | string | 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": "providerOrders",
"apiName": "getMineById",
"data": {
"id": "id_123"
}
}'Example Response
{ "status": "ok", "data": {} }getPharmacyDashboardStats
Source: backend/endpoints/provider-orders/get-pharmacy-dashboard-stats
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
trendRange | string | No | - |
trendStartDate | string | No | format: YYYY-MM-DD |
trendEndDate | string | No | format: 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
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
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": "providerOrders",
"apiName": "getPharmacyReport",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByOrganization
Source: backend/endpoints/provider-orders/list-by-organization
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
sourceType | string | No | nullable |
status | string | No | nullable |
statuses | array<string> | No | - |
orderStatuses | array<string> | No | - |
paymentStatus | string | No | nullable |
paymentStatuses | array<string> | No | - |
search | string | No | - |
sortBy | string | No | - |
sortOrder | string | No | - |
startDate | string | No | format: YYYY-MM-DD |
endDate | string | No | format: YYYY-MM-DD |
minAmount | number | No | nullable |
maxAmount | number | No | nullable |
page | integer | No | - |
pageSize | integer | No | - |
Response Notes
- The response includes
statusOptionsfor 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 usePENDING,CONFIRMED,PACKING,READY_FOR_DISPATCH,OUT_FOR_DELIVERY,DELIVERED,CANCELLED. - For
sourceType: "prescription", status filters use the same uppercase provider-order lifecycle. - If
sourceTypeis 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
| Field | Type | Required | Constraints |
|---|---|---|---|
patientId | string | Yes | - |
search | string | No | nullable |
sourceType | array<string> | No | - |
status | string | No | nullable |
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": "providerOrders",
"apiName": "listByPatientId",
"data": {
"patientId": "patient_123"
}
}'Example Response
{ "status": "ok", "data": {} }listMine
Source: backend/endpoints/provider-orders/list-mine
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
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": "providerOrders",
"apiName": "listMine",
"data": {
"page": 1,
"pageSize": 1
}
}'Example Response
{ "status": "ok", "data": {} }markPaymentSuccess
Source: backend/endpoints/provider-orders/mark-payment-success
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
status | string | No | - |
amountPaid | number | No | nullable |
paidAt | integer | No | unix-ms timestamp; nullable |
paymentMethod | string | No | - |
razorpayOrderId | string | No | - |
razorpayPaymentId | string | No | - |
razorpaySignature | string | No | - |
checkoutSessionId | string | No | - |
skipInvoice | boolean | 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": "providerOrders",
"apiName": "markPaymentSuccess",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/provider-orders/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
patientProfileId | string | No | nullable |
sourceType | string | No | nullable |
collectionType | string | No | nullable |
isHomeCollection | boolean | No | nullable |
prescriptionId | string | No | nullable |
labOrderId | string | No | nullable |
labPackageId | string | No | nullable |
productId | string | No | nullable |
appointmentId | string | No | nullable |
consultationId | string | No | nullable |
items | array<object> | No | nullable |
subtotal | number | No | nullable |
status | string | No | nullable |
deliveryAddress | object | No | nullable |
collectedAt | integer | No | unix-ms timestamp; nullable |
processingAt | integer | No | unix-ms timestamp; nullable |
completedAt | integer | No | unix-ms timestamp; nullable |
cancelledReason | string | No | nullable |
patientNotes | string | No | nullable |
providerNotes | string | No | nullable |
razorpayOrderId | string | No | nullable |
razorpayPaymentId | string | No | nullable |
razorpaySignature | string | No | nullable |
paymentStatus | string | No | nullable |
amountPaid | number | No | nullable |
paidAt | integer | No | unix-ms timestamp; nullable |
paymentMethod | string | No | nullable |
checkoutSessionId | string | No | nullable |
labResultFiles | array<object> | No | nullable |
createdAt | integer | No | unix-ms timestamp; nullable |
updatedAt | integer | No | unix-ms timestamp; nullable |
Nested Field Structures
items item
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
code | string | No | - |
serviceId | string | No | - |
itemType | string | No | - |
packageId | string | No | - |
productId | string | No | - |
providerCode | string | No | - |
providerItemId | string | No | - |
imageUrls | array<string> | No | - |
price | number | No | - |
quantity | integer | No | nullable |
slotDate | string | No | format: YYYY-MM-DD |
slotTime | string | No | format: HH:mm |
reviewStatus | string | No | - |
service | object | No | nullable |
deliveryAddress
| Field | Type | Required | Constraints |
|---|---|---|---|
name | string | No | - |
street | string | No | - |
landmark | string | No | - |
city | string | No | - |
state | string | No | - |
postalCode | string | No | - |
phone | string | No | - |
latitude | number | No | nullable |
longitude | number | No | nullable |
instructions | string | No | - |
labResultFiles item
| Field | Type | Required | Constraints |
|---|---|---|---|
fileUrl | string | No | - |
fileId | string | No | - |
fileName | string | No | - |
fileSize | integer | No | nullable |
mimeType | string | No | - |
testName | string | No | - |
uploadedBy | string | No | - |
Status and Fulfillment Notes
statusaccepts 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. PACKINGupdates only the customer-facing provider order.READY_FOR_DISPATCHupdates the order and fulfillment status, then triggers Shadowfax dispatch-ready flow when applicable.DELIVEREDsetsdeliveredAton both provider order and fulfillment, creates a manual completion audit entry, and skips the provider call if the provider already marked the order delivered.CANCELLEDupdates 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": {} }