Cart

Function-calling namespace: cart

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

add

Source: backend/endpoints/cart/add

Input Fields

FieldTypeRequiredConstraints
userIdstringYes-
serviceIdstringNo-
labPackageIdstringNo-
productIdstringNo-
providerCodestringNo-
providerItemIdstringNo-
itemTypestringNo-
quantityintegerNomin: 0
slotDatestringNoformat: YYYY-MM-DD
slotTimestringNoformat: 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

FieldTypeRequiredConstraints
userIdstringYes-
checkoutOrderRefstringNo-

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

FieldTypeRequiredConstraints
idstringYes-
userIdstringYes-

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

FieldTypeRequiredConstraints
userIdstringYes-
itemTypestringNo-
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": "cart",
  "apiName": "listByUser",
  "data": {
    "userId": "user_123"
  }
}'

Example Response

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

paymentSuccess

Source: backend/endpoints/cart/payment-success

Input Fields

FieldTypeRequiredConstraints
userIdstringYes-
orderIdstringYes-
paymentIdstringNo-
razorpayOrderIdstringYes-
razorpayPaymentIdstringYes-
razorpaySignaturestringYes-
paidAtintegerNounix-ms timestamp; nullable
paymentMethodstringNo-
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": "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

FieldTypeRequiredConstraints
idstringYes-
userIdstringYes-
quantityintegerYesmin: 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": {} }