Expenses

Standalone business expenses not tied to a vendor bill.

GET/api/v1/expenses

List expenses

Scope: expenses.read

Parameters

NameInTypeRequiredDescription
pagequerynumberOptional1-based page number.
limitquerynumberOptionalPage size, max 200.

Example request

curl "https://pre-invoice.avscorp.in/api/v1/expenses" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "id": "clx5exp00000000000000001",
  "organizationId": "clx0org000000000000000001",
  "expenseNumber": "EXP-00042",
  "vendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
  "category": "Office Supplies",
  "expenseDate": "2026-09-01T00:00:00.000Z",
  "paidThroughAccount": "Petty Cash",
  "amount": 2500,
  "taxRatePercent": 18,
  "taxAmount": 450,
  "itcEligible": true,
  "notes": "Stationery purchase for Q3",
  "currencyCode": "INR",
  "exchangeRate": 1,
  "createdBy": "clxusr0000000000000000001",
  "updatedBy": null,
  "createdAt": "2026-09-01T10:00:00.000Z",
  "updatedAt": "2026-09-01T10:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden

POST/api/v1/expenses

Create an expense

Scope: expenses.create

expenseNumber is allocated automatically from the org's number series — do not send it.

Request body

FieldTypeRequiredConstraints
vendorIdanyOptional—
categorystringRequiredmin length 1; max length 100
expenseDatestringRequired—
paidThroughAccountanyOptional—
amountnumberRequired—
taxRatePercentnumberOptionalmin 0; max 100; default 0
taxAmountnumberOptionalmin 0; default 0
itcEligiblebooleanOptionaldefault false
currencyCodestringOptionalmin length 3; max length 3; default "INR"
exchangeRatenumberOptionaldefault 1
notesanyOptional—

Example request

curl -X POST "https://pre-invoice.avscorp.in/api/v1/expenses" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "category": "Office Supplies",
  "expenseDate": "2026-09-01",
  "amount": 2500
}'

Example response

JSON
{
  "id": "clx5exp00000000000000001",
  "organizationId": "clx0org000000000000000001",
  "expenseNumber": "EXP-00042",
  "vendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
  "category": "Office Supplies",
  "expenseDate": "2026-09-01T00:00:00.000Z",
  "paidThroughAccount": "Petty Cash",
  "amount": 2500,
  "taxRatePercent": 18,
  "taxAmount": 450,
  "itcEligible": true,
  "notes": "Stationery purchase for Q3",
  "currencyCode": "INR",
  "exchangeRate": 1,
  "createdBy": "clxusr0000000000000000001",
  "updatedBy": null,
  "createdAt": "2026-09-01T10:00:00.000Z",
  "updatedAt": "2026-09-01T10:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, validation_error

GET/api/v1/expenses/{id}

Get an expense

Scope: expenses.read

Parameters

NameInTypeRequiredDescription
idpathstringRequiredExpense ID.

Example request

curl "https://pre-invoice.avscorp.in/api/v1/expenses/clx5exp00000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "id": "clx5exp00000000000000001",
  "organizationId": "clx0org000000000000000001",
  "expenseNumber": "EXP-00042",
  "vendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
  "category": "Office Supplies",
  "expenseDate": "2026-09-01T00:00:00.000Z",
  "paidThroughAccount": "Petty Cash",
  "amount": 2500,
  "taxRatePercent": 18,
  "taxAmount": 450,
  "itcEligible": true,
  "notes": "Stationery purchase for Q3",
  "currencyCode": "INR",
  "exchangeRate": 1,
  "createdBy": "clxusr0000000000000000001",
  "updatedBy": null,
  "createdAt": "2026-09-01T10:00:00.000Z",
  "updatedAt": "2026-09-01T10:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found

PATCH/api/v1/expenses/{id}

Update an expense

Scope: expenses.update

PATCH validates against the full expense schema (same as create) — category, expenseDate, and amount are required in every update.

Parameters

NameInTypeRequiredDescription
idpathstringRequiredExpense ID.

Request body

FieldTypeRequiredConstraints
vendorIdanyOptional—
categorystringRequiredmin length 1; max length 100
expenseDatestringRequired—
paidThroughAccountanyOptional—
amountnumberRequired—
taxRatePercentnumberOptionalmin 0; max 100; default 0
taxAmountnumberOptionalmin 0; default 0
itcEligiblebooleanOptionaldefault false
currencyCodestringOptionalmin length 3; max length 3; default "INR"
exchangeRatenumberOptionaldefault 1
notesanyOptional—

Example request

curl -X PATCH "https://pre-invoice.avscorp.in/api/v1/expenses/clx5exp00000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "category": "Office Supplies",
  "expenseDate": "2026-09-01",
  "amount": 2750
}'

Example response

JSON
{
  "id": "clx5exp00000000000000001",
  "organizationId": "clx0org000000000000000001",
  "expenseNumber": "EXP-00042",
  "vendorId": "clx2v1e2n3d4o5r6a7b8c9d0",
  "category": "Office Supplies",
  "expenseDate": "2026-09-01T00:00:00.000Z",
  "paidThroughAccount": "Petty Cash",
  "amount": 2500,
  "taxRatePercent": 18,
  "taxAmount": 450,
  "itcEligible": true,
  "notes": "Stationery purchase for Q3",
  "currencyCode": "INR",
  "exchangeRate": 1,
  "createdBy": "clxusr0000000000000000001",
  "updatedBy": null,
  "createdAt": "2026-09-01T10:00:00.000Z",
  "updatedAt": "2026-09-01T10:00:00.000Z"
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found, validation_error

DELETE/api/v1/expenses/{id}

Delete an expense

Scope: expenses.delete

Parameters

NameInTypeRequiredDescription
idpathstringRequiredExpense ID.

Example request

curl -X DELETE "https://pre-invoice.avscorp.in/api/v1/expenses/clx5exp00000000000000001" \
  -H "Authorization: Bearer YOUR_API_KEY"

Example response

JSON
{
  "deleted": true
}

Possible errors: unauthorized, insufficient_scope, forbidden, not_found