Expenses
Standalone business expenses not tied to a vendor bill.
GET
/api/v1/expensesList expenses
Scope:
expenses.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
page | query | number | Optional | 1-based page number. |
limit | query | number | Optional | Page 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/expensesCreate an expense
Scope:
expenses.createexpenseNumber is allocated automatically from the org's number series — do not send it.
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
vendorId | any | Optional | — |
category | string | Required | min length 1; max length 100 |
expenseDate | string | Required | — |
paidThroughAccount | any | Optional | — |
amount | number | Required | — |
taxRatePercent | number | Optional | min 0; max 100; default 0 |
taxAmount | number | Optional | min 0; default 0 |
itcEligible | boolean | Optional | default false |
currencyCode | string | Optional | min length 3; max length 3; default "INR" |
exchangeRate | number | Optional | default 1 |
notes | any | Optional | — |
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.readParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Expense 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.updatePATCH validates against the full expense schema (same as create) — category, expenseDate, and amount are required in every update.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Expense ID. |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
vendorId | any | Optional | — |
category | string | Required | min length 1; max length 100 |
expenseDate | string | Required | — |
paidThroughAccount | any | Optional | — |
amount | number | Required | — |
taxRatePercent | number | Optional | min 0; max 100; default 0 |
taxAmount | number | Optional | min 0; default 0 |
itcEligible | boolean | Optional | default false |
currencyCode | string | Optional | min length 3; max length 3; default "INR" |
exchangeRate | number | Optional | default 1 |
notes | any | Optional | — |
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.deleteParameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
id | path | string | Required | Expense 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