EndpointsPayments

Payments

Function-calling namespace: payments

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

create

Source: backend/endpoints/payments/create

Input Fields

FieldTypeRequiredConstraints
organizationIdstringYes-
patientIdstringNo-
sourceTypestringYes-
sourceIdstringYes-
amountnumberYes-
currencystringYes-
paymentMethodstringYes-
statusstringYes-
gatewaystringNo-
gatewayOrderIdstringNo-
gatewayPaymentIdstringNo-
gatewaySignaturestringNo-
checkoutSessionIdstringNo-
manualReferenceNumberstringNo-
notesstringNo-
createdByUserIdstringNo-
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-ms timestamp; nullable
invoiceobjectNonullable

Nested Field Structures

invoice

FieldTypeRequiredConstraints
customerNamestringNo-
customerEmailstringNo-
currencystringNo-
lineItemsarray<object>No-
totalAmountMinorintegerNo-
issueDatestringNoformat: YYYY-MM-DD
dueDatestringNoformat: YYYY-MM-DD
statusstringNo-
notesstringNo-

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

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": "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

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

Example Response

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

listAll

Source: backend/endpoints/payments/list-all

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": "payments",
  "apiName": "listAll",
  "data": {
    "page": 1,
    "pageSize": 1
  }
}'

Example Response

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

listAllTransactions

Source: backend/endpoints/payments/list-all-transactions

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": "payments",
  "apiName": "listAllTransactions",
  "data": {
    "page": 1,
    "pageSize": 1
  }
}'

Example Response

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

listByOrganization

Source: backend/endpoints/payments/list-by-organization

Input Fields

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

Example Response

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

update

Source: backend/endpoints/payments/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
organizationIdstringYes-
patientIdstringNonullable
sourceTypestringNonullable
sourceIdstringNonullable
amountnumberNonullable
currencystringNonullable
paymentMethodstringNonullable
statusstringNonullable
gatewaystringNonullable
gatewayOrderIdstringNonullable
gatewayPaymentIdstringNonullable
gatewaySignaturestringNonullable
checkoutSessionIdstringNonullable
manualReferenceNumberstringNonullable
notesstringNonullable
createdByUserIdstringNonullable
createdAtintegerNounix-ms timestamp; nullable
updatedAtintegerNounix-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": {} }