Payments
Function-calling namespace: payments
- 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.
create
Source: backend/endpoints/payments/create
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
patientId | string | No | - |
sourceType | string | Yes | - |
sourceId | string | Yes | - |
amount | number | Yes | - |
currency | string | Yes | - |
paymentMethod | string | Yes | - |
status | string | Yes | - |
gateway | string | No | - |
gatewayOrderId | string | No | - |
gatewayPaymentId | string | No | - |
gatewaySignature | string | No | - |
checkoutSessionId | string | No | - |
manualReferenceNumber | string | No | - |
notes | string | No | - |
createdByUserId | string | No | - |
createdAt | integer | No | unix-ms timestamp; nullable |
updatedAt | integer | No | unix-ms timestamp; nullable |
invoice | object | No | nullable |
Nested Field Structures
invoice
| Field | Type | Required | Constraints |
|---|---|---|---|
customerName | string | No | - |
customerEmail | string | No | - |
currency | string | No | - |
lineItems | array<object> | No | - |
totalAmountMinor | integer | No | - |
issueDate | string | No | format: YYYY-MM-DD |
dueDate | string | No | format: YYYY-MM-DD |
status | string | No | - |
notes | 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": "payments",
"apiName": "create",
"data": {
"organizationId": "org_123",
"sourceType": "general",
"sourceId": "source_123",
"amount": 1,
"currency": "INR",
"paymentMethod": "value",
"status": "scheduled"
}
}'Example Response
{ "status": "ok", "data": {} }delete
Source: backend/endpoints/payments/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": "payments",
"apiName": "delete",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }getById
Source: backend/endpoints/payments/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": "payments",
"apiName": "getById",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listAll
Source: backend/endpoints/payments/list-all
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": "payments",
"apiName": "listAll",
"data": {
"page": 1,
"pageSize": 1
}
}'Example Response
{ "status": "ok", "data": {} }listAllTransactions
Source: backend/endpoints/payments/list-all-transactions
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": "payments",
"apiName": "listAllTransactions",
"data": {
"page": 1,
"pageSize": 1
}
}'Example Response
{ "status": "ok", "data": {} }listByOrganization
Source: backend/endpoints/payments/list-by-organization
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
search | 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": "payments",
"apiName": "listByOrganization",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }update
Source: backend/endpoints/payments/update
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
id | string | Yes | - |
organizationId | string | Yes | - |
patientId | string | No | nullable |
sourceType | string | No | nullable |
sourceId | string | No | nullable |
amount | number | No | nullable |
currency | string | No | nullable |
paymentMethod | string | No | nullable |
status | string | No | nullable |
gateway | string | No | nullable |
gatewayOrderId | string | No | nullable |
gatewayPaymentId | string | No | nullable |
gatewaySignature | string | No | nullable |
checkoutSessionId | string | No | nullable |
manualReferenceNumber | string | No | nullable |
notes | string | No | nullable |
createdByUserId | string | No | nullable |
createdAt | integer | No | unix-ms timestamp; nullable |
updatedAt | integer | No | unix-ms timestamp; 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": "payments",
"apiName": "update",
"data": {
"id": "id_123",
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }