Cart
Function-calling namespace: cart
- 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.
add
Source: backend/endpoints/cart/add
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
userId | string | Yes | - |
serviceId | string | No | - |
labPackageId | string | No | - |
productId | string | No | - |
providerCode | string | No | - |
providerItemId | string | No | - |
itemType | string | No | - |
quantity | integer | No | min: 0 |
slotDate | string | No | format: YYYY-MM-DD |
slotTime | string | No | format: HH:mm |
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": "cart",
"apiName": "add",
"data": {
"userId": "user_123"
}
}'Example Response
{ "status": "ok", "data": {} }checkout
Source: backend/endpoints/cart/checkout
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
userId | string | Yes | - |
checkoutOrderRef | 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": "cart",
"apiName": "checkout",
"data": {
"userId": "user_123"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/cart/delete
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
userId | 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": "cart",
"apiName": "delete",
"data": {
"id": "id_123",
"userId": "user_123"
}
}'Example Response
{ "status": "ok", "data": {} }listByUser
Source: backend/endpoints/cart/list-by-user
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
userId | string | Yes | - |
itemType | 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": "cart",
"apiName": "listByUser",
"data": {
"userId": "user_123"
}
}'Example Response
{ "status": "ok", "data": {} }paymentSuccess
Source: backend/endpoints/cart/payment-success
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
userId | string | Yes | - |
orderId | string | Yes | - |
paymentId | string | No | - |
razorpayOrderId | string | Yes | - |
razorpayPaymentId | string | Yes | - |
razorpaySignature | string | Yes | - |
paidAt | integer | No | unix-ms timestamp; nullable |
paymentMethod | 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": "cart",
"apiName": "paymentSuccess",
"data": {
"userId": "user_123",
"orderId": "order_123",
"razorpayOrderId": "razorpayorder_123",
"razorpayPaymentId": "razorpaypayment_123",
"razorpaySignature": "value"
}
}'Example Response
{ "status": "ok", "data": {} }updateQuantity
Source: backend/endpoints/cart/update-quantity
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
userId | string | Yes | - |
quantity | integer | Yes | min: 0; 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": "cart",
"apiName": "updateQuantity",
"data": {
"id": "id_123",
"userId": "user_123",
"quantity": 1
}
}'Example Response
{ "status": "ok", "data": {} }