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/expenses

List 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

NameTypeDescription
search
stringFree-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
stringOnly expenses on or after this date (YYYY-MM-DD).
endDate
stringOnly expenses on or before this date (YYYY-MM-DD).
vendorId
numberOnly expenses for this vendor (numeric entity id).
sortBy
stringColumn to sort by.
sortOrder
string"asc" or "desc".
limit
numberItems per page. Default 50, clamped to 1-200.
offset
numberRow offset to start from (default 0).
page
number1-based page number (default 1). Converted to an offset; an explicit `offset` wins over it.
pageSize
numberAlias 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/:id

Get 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

NameTypeDescription
id
numberrequiredThe 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/create

Record an expense.

Body Parameters

NameTypeDescription
vendorId
numberrequiredThe vendor's numeric entity id.
fileId
numberrequiredId of the receipt or invoice file, from `POST /files/upload`. Required — an expense must have its document attached.
date
stringrequiredExpense date, exactly YYYY-MM-DD.
total
numberrequiredTotal including tax. Must be greater than zero.
tax
numberrequiredVAT on the expense.
deductableTax
numberrequiredThe part of that VAT you may reclaim — often two thirds of `tax`, or zero. This is the figure the VAT report uses.
title
stringWhat it was for.
documentNumber
stringThe vendor's document number.
currency
stringThree-letter currency code. Defaults to "ILS".
notes
stringFree-text note.
isEquipment
booleanMark 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/:id

Update an expense. All fields are optional.

Path Parameters

NameTypeDescription
id
numberrequiredThe expense's numeric id.

Body Parameters

NameTypeDescription
vendorId
numberThe vendor's numeric entity id. `entityId` is accepted as a synonym.
fileId
numberId of the receipt or invoice file.
date
stringExpense date (YYYY-MM-DD).
total
numberTotal including tax.
tax
numberVAT on the expense.
deductableTax
numberReclaimable part of the VAT.
title
stringWhat it was for.
documentNumber
stringThe vendor's document number.
currency
stringThree-letter currency code.
notes
stringFree-text note.
isEquipment
booleanFixed 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/:id

Delete an expense.

Path Parameters

NameTypeDescription
id
numberrequiredThe 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/:fileId

Read 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

NameTypeDescription
fileId
numberrequiredId 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-url

The same extraction, on a document fetched from a URL.

Query Parameters

NameTypeDescription
url
stringrequiredWhere to fetch the document from. Missing, it answers 400 MISSING_URL.
filename
stringFilename 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
  }
}

Last updated