EndpointsInvoices

Invoices

Function-calling namespace: invoices

  • 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/invoices/create

Input Fields

FieldTypeRequiredConstraints
orgIdstringYes-
userIdstringYes-
customerNamestringYes-
customerEmailstringYesemail
currencystringNo-
lineItemsarray<object>No-
totalAmountMinorintegerNomin: 0
issueDatestringYesformat: YYYY-MM-DD
dueDatestringYesformat: YYYY-MM-DD
statusstringNo-
notesstringNo-
paymentIdstringNo-

Nested Field Structures

lineItems item

FieldTypeRequiredConstraints
itemstringNo-
descriptionstringNo-
quantityintegerNo-
amountMinorintegerNo-

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": "invoices",
  "apiName": "create",
  "data": {
    "orgId": "org_123",
    "userId": "user_123",
    "customerName": "value",
    "customerEmail": "user@example.com",
    "issueDate": "2026-03-12",
    "dueDate": "2026-03-12"
  }
}'

Example Response

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

delete

Source: backend/endpoints/invoices/delete

Input Fields

FieldTypeRequiredConstraints
idstringYes-
orgIdstringYes-
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": "invoices",
  "apiName": "delete",
  "data": {
    "id": "id_123",
    "orgId": "org_123",
    "userId": "user_123"
  }
}'

Example Response

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

get

Source: backend/endpoints/invoices/get

Input Fields

FieldTypeRequiredConstraints
idstringYes-
orgIdstringYes-
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": "invoices",
  "apiName": "get",
  "data": {
    "id": "id_123",
    "orgId": "org_123",
    "userId": "user_123"
  }
}'

Example Response

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

read

Source: backend/endpoints/invoices/read

Input Fields

FieldTypeRequiredConstraints
orgIdstringYes-
userIdstringYes-
pageintegerNo-
page_sizeintegerNo-

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": "invoices",
  "apiName": "read",
  "data": {
    "orgId": "org_123",
    "userId": "user_123"
  }
}'

Example Response

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

send-email

Source: backend/endpoints/invoices/send-email

Input Fields

FieldTypeRequiredConstraints
idstringYes-
orgIdstringYes-
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": "invoices",
  "apiName": "send-email",
  "data": {
    "id": "id_123",
    "orgId": "org_123",
    "userId": "user_123"
  }
}'

Example Response

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

update

Source: backend/endpoints/invoices/update

Input Fields

FieldTypeRequiredConstraints
idstringYes-
orgIdstringYes-
userIdstringYes-
customerNamestringNonullable
customerEmailstringNonullable
currencystringNonullable
lineItemsarray<object>Nonullable
totalAmountMinorintegerNonullable
issueDatestringNoformat: YYYY-MM-DD; nullable
dueDatestringNoformat: YYYY-MM-DD; nullable
statusstringNonullable
notesstringNonullable

Nested Field Structures

lineItems item

FieldTypeRequiredConstraints
itemstringNo-
descriptionstringNo-
quantityintegerNo-
amountMinorintegerNo-

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": "invoices",
  "apiName": "update",
  "data": {
    "id": "id_123",
    "orgId": "org_123",
    "userId": "user_123"
  }
}'

Example Response

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