Expenses

Track business expenses. Each expense links to a vendor and an uploaded file (receipt/invoice).

Use cases: Use the Expenses API to automate expense recording from receipt scanning apps or bank feeds.
GET/expenses

List all expenses.

Query Parameters

NameTypeDescription
search
stringFree-text search across relevant fields.
page
numberPage number (default 1).
limit
numberItems per page (default 50).

Request

curl -X GET "https://api.glance.co.il/expenses" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response

Response
{
  "data": [
    {
      "id": 1,
      "vendor": {
        "visibleId": 1,
        "name": "Supplier Co"
      },
      "title": "Office Supplies",
      "total": 450,
      "tax": 65.38,
      "deductableTax": 65.38,
      "date": "2024-03-15",
      "currency": "ILS",
      "isEquipment": false,
      "createdAt": "2024-03-15T11:00:00Z"
    }
  ],
  "pagination": {
    "total": 78,
    "limit": 50,
    "offset": 0,
    "hasMore": true
  }
}
GET/expenses/id/:id

Get a single expense by ID.

Path Parameters

NameTypeDescription
id
numberrequiredThe expense 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
{
  "data": {
    "id": 1,
    "vendor": {
      "visibleId": 1,
      "name": "Supplier Co"
    },
    "title": "Office Supplies",
    "total": 450,
    "tax": 65.38,
    "deductableTax": 65.38,
    "date": "2024-03-15",
    "documentNumber": "INV-2024-789",
    "currency": "ILS",
    "isEquipment": false,
    "notes": "Q1 office supply restock",
    "file": {
      "visibleId": 10,
      "url": "https://files.glance.app/10.pdf"
    },
    "createdAt": "2024-03-15T11:00:00Z"
  }
}
POST/expenses/create

Create a new expense.

Body Parameters

NameTypeDescription
vendorId
numberrequiredVisible ID of the vendor.
fileId
numberrequiredID of the uploaded receipt / invoice file.
date
stringrequiredExpense date (YYYY-MM-DD).
total
numberrequiredTotal expense amount (must be positive).
tax
numberrequiredTax amount (must be >= 0).
deductableTax
numberrequiredDeductible tax amount (must be >= 0).
title
stringExpense title / description.
notes
stringAdditional notes.
documentNumber
stringExternal document / invoice number.
currency
string3-letter currency code (default ILS).
isEquipment
booleanWhether this expense is for equipment / fixed asset (default 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",
  "notes": "example_notes",
  "documentNumber": "example_documentNumber",
  "currency": "example_currency",
  "isEquipment": true
}'

Response

Response
{
  "data": {
    "id": 15,
    "vendorId": 1,
    "title": "Software License",
    "total": 1200,
    "tax": 174.36,
    "deductableTax": 174.36,
    "date": "2024-03-20",
    "currency": "ILS",
    "isEquipment": false,
    "createdAt": "2024-03-20T14:30:00Z"
  }
}
PUT/expenses/edit/:id

Update an existing expense.

Path Parameters

NameTypeDescription
id
numberrequiredThe expense ID.

Body Parameters

NameTypeDescription
vendorId
numberVisible ID of the vendor.
fileId
numberReceipt / invoice file ID.
date
stringExpense date (YYYY-MM-DD).
total
numberTotal expense amount.
tax
numberTax amount.
deductableTax
numberDeductible tax amount.
title
stringExpense title.
notes
stringAdditional notes.
documentNumber
stringExternal document number.
currency
string3-letter currency code.
isEquipment
booleanEquipment flag.

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",
  "notes": "example_notes",
  "documentNumber": "example_documentNumber",
  "currency": "example_currency",
  "isEquipment": true
}'

Response

Response
{
  "data": {
    "id": 1,
    "title": "Office Supplies (Updated)",
    "total": 500
  }
}
DELETE/expenses/delete/:id

Delete an expense.

Path Parameters

NameTypeDescription
id
numberrequiredThe expense 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
{
  "data": {
    "success": true
  }
}