Expenses
Business expenses recorded against a vendor and a receipt file. Expenses are the module's own rows; supplier invoices are expenses too but live in Purchase Documents, and only appear here when you ask for them.
Use cases: Use this to push expenses from a receipt-scanning app or a bank feed, and to pull a complete expense picture for a period.
GET
/expensesList expenses.
Each row nests the expense under `expense`, with the joined vendor, user and file. `totalInILS` is the total converted at the expense's own date — equal to `total` when the currency is already ILS, and `null` when no rate was available.
`sortBy` accepts "id", "date", "title", "total", "tax", "deductableTax" or "isEquipment"; anything else falls back to "date". With `include=all` only "date", "title" and "total" sort.
With `include=all`, rows coming from supplier invoices carry `source` and `documentVisibleId`, have no `user` or `file`, and cannot be edited or deleted through this API — they belong to the document that created them.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
search | string | Free-text search across title, notes and document number. | |
include | string | "all" also folds in supplier invoices from the purchase side. Without it you get only the rows this module owns — which is the smaller number, and the usual cause of an expense total that does not match the books. | |
startDate | string | Only expenses on or after this date (YYYY-MM-DD). | |
endDate | string | Only expenses on or before this date (YYYY-MM-DD). | |
vendorId | number | Only expenses for this vendor (numeric entity id). | |
sortBy | string | Column to sort by. | |
sortOrder | string | "asc" or "desc". | |
limit | number | Items per page. Default 50, clamped to 1-200. | |
offset | number | Row offset to start from (default 0). | |
page | number | 1-based page number (default 1). Converted to an offset; an explicit `offset` wins over it. | |
pageSize | number | Alias of `limit`. Wins over `limit` when both are sent. |
Request
curl -X GET "https://api.glance.co.il/expenses" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": [
{
"expense": {
"id": 5511,
"entityId": 8801,
"title": "ציוד משרדי",
"date": "2026-03-15",
"documentNumber": "INV-2026-789",
"currency": "ILS",
"total": 450,
"tax": 68.64,
"deductableTax": 68.64,
"isEquipment": false,
"notes": null,
"fileId": 90101,
"totalInILS": 450,
"createdAt": "2026-03-15T11:00:00.000Z"
},
"vendor": {
"id": 8801,
"name": "ספקי הצפון בע״מ"
},
"user": {
"id": 12,
"name": "מיכל"
},
"file": {
"id": 90101,
"remoteUrl": "https://files.glance.co.il/90101.pdf"
}
}
],
"pagination": {
"total": 78,
"limit": 50,
"offset": 0,
"hasMore": true,
"page": 1,
"pageSize": 50,
"totalPages": 2
}
}GET
/expenses/id/:idGet a single expense.
Same nested shape as one row of the list. An unknown id answers `200` with a body of `null`, not a 404. Only expenses this module owns are addressable here — a supplier invoice is read through `GET /purchase/id/:visibleId`.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The expense's numeric id. |
Request
curl -X GET "https://api.glance.co.il/expenses/id/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"expense": {
"id": 5511,
"entityId": 8801,
"title": "ציוד משרדי",
"date": "2026-03-15",
"documentNumber": "INV-2026-789",
"currency": "ILS",
"total": 450,
"tax": 68.64,
"deductableTax": 68.64,
"isEquipment": false,
"notes": "מילוי מלאי רבעוני",
"fileId": 90101,
"totalInILS": 450
},
"vendor": {
"id": 8801,
"name": "ספקי הצפון בע״מ"
},
"user": {
"id": 12,
"name": "מיכל"
},
"file": {
"id": 90101,
"remoteUrl": "https://files.glance.co.il/90101.pdf"
}
}POST
/expenses/createRecord an expense.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
vendorId | number | required | The vendor's numeric entity id. |
fileId | number | required | Id of the receipt or invoice file, from `POST /files/upload`. Required — an expense must have its document attached. |
date | string | required | Expense date, exactly YYYY-MM-DD. |
total | number | required | Total including tax. Must be greater than zero. |
tax | number | required | VAT on the expense. |
deductableTax | number | required | The part of that VAT you may reclaim — often two thirds of `tax`, or zero. This is the figure the VAT report uses. |
title | string | What it was for. | |
documentNumber | string | The vendor's document number. | |
currency | string | Three-letter currency code. Defaults to "ILS". | |
notes | string | Free-text note. | |
isEquipment | boolean | Mark as a fixed asset rather than a running cost. Defaults to false. |
Request
curl -X POST "https://api.glance.co.il/expenses/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"vendorId": 0,
"fileId": 0,
"date": "example_date",
"total": 0,
"tax": 0,
"deductableTax": 0,
"title": "example_title",
"documentNumber": "example_documentNumber",
"currency": "example_currency",
"notes": "example_notes",
"isEquipment": true
}'Response
Response
{
"success": true,
"expenseId": 5511
}PUT
/expenses/edit/:idUpdate an expense. All fields are optional.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The expense's numeric id. |
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
vendorId | number | The vendor's numeric entity id. `entityId` is accepted as a synonym. | |
fileId | number | Id of the receipt or invoice file. | |
date | string | Expense date (YYYY-MM-DD). | |
total | number | Total including tax. | |
tax | number | VAT on the expense. | |
deductableTax | number | Reclaimable part of the VAT. | |
title | string | What it was for. | |
documentNumber | string | The vendor's document number. | |
currency | string | Three-letter currency code. | |
notes | string | Free-text note. | |
isEquipment | boolean | Fixed asset rather than a running cost. |
Request
curl -X PUT "https://api.glance.co.il/expenses/edit/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"vendorId": 0,
"fileId": 0,
"date": "example_date",
"total": 0,
"tax": 0,
"deductableTax": 0,
"title": "example_title",
"documentNumber": "example_documentNumber",
"currency": "example_currency",
"notes": "example_notes",
"isEquipment": true
}'Response
Response
{
"success": true,
"expenseId": 5511
}DELETE
/expenses/delete/:idDelete an expense.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | number | required | The expense's numeric id. |
Request
curl -X DELETE "https://api.glance.co.il/expenses/delete/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true
}GET
/expenses/extract-from-file/:fileIdRead an uploaded receipt and return the expense fields found in it.
Reads only — nothing is created. Feed the result into `POST /expenses/create` after checking it.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
fileId | number | required | Id of a file already uploaded through `POST /files/upload`. |
Request
curl -X GET "https://api.glance.co.il/expenses/extract-from-file/:fileId" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true,
"expenseData": {
"vendorName": "ספקי הצפון בע״מ",
"vendorTaxId": "514789632",
"documentNumber": "INV-2026-789",
"date": "2026-03-15",
"currency": "ILS",
"total": 450,
"tax": 68.64
}
}GET
/expenses/extract-from-urlThe same extraction, on a document fetched from a URL.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
url | string | required | Where to fetch the document from. Missing, it answers 400 MISSING_URL. |
filename | string | Filename whose extension decides how the document is read. Defaults to "file.pdf"; an unsupported extension answers UNSUPPORTED_FILE_TYPE_FOR_EXTRACTION. |
Request
curl -X GET "https://api.glance.co.il/expenses/extract-from-url" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"success": true,
"expenseData": {
"vendorName": "ספקי הצפון בע״מ",
"date": "2026-03-15",
"total": 450,
"tax": 68.64
}
}