Ledger Changes

How the books changed since a moment: every journal entry whose lines were written to the ledger after since, from any source (an invoice, a bill, a payment, a bank line, a manual entry), oldest first, each with all of its lines. Requires ledger_changes:read (or the broad reports scope).

The ledger only grows. Editing a posted document reverses its old entry and posts a new one, and voiding it posts a reversal, so these entries are every change to the books; a reversal names the entry it undoes in reversal_of_id. A backdated entry appears when it was recorded (recorded_at) and carries the date it is dated (date), so an entry dated in March and recorded today tells you March changed. Changes that write no entry, such as a draft invoice or a new contact, are not changes to the books and don't appear here.

Polling

Start with since, then pass each page's next_cursor as cursor until has_more is false. The cursor is a position in the ledger, so a page never skips an entry. An entry whose lines straddle two pages comes on both: keep entries by their id, replacing a stored copy.

For your next poll, start again with since a few minutes before the latest recorded_at you saw. An entry is stamped just before it is saved, so a long write, such as an import, can become visible slightly after the time it carries; leaving room picks it up.

Currencies

A line's debit_cents and credit_cents are always in the company's home_currency: they are what the books add up. original_currency and original_amount_cents are the line as it was written, so a euro invoice's receivable line reads EUR there. One entry can hold both: a home-currency bank account paying a euro bill writes a EUR payables line and a home-currency bank line.

What a re-read picks up

Amounts only ever change by new entries, so the feed has every change to what the books add up. A few details change on lines already written, without a new entry: tracking categories or a contact filled in later, two contacts merged (the lines keep the old contact's id), a corrected memo, and an older entry becoming reversed (its reversal does appear, naming it). Re-read in full now and then; nightly is plenty.

Entries are deleted only when a company's books are rebuilt: it starts over from QuickBooks or Xero, or wipes or abandons a migration. Re-sync in full after that.

The Ledger Change Object

FieldTypeDescription
iduuidJournal entry UUID
objectjournal_entryAlways 'journal_entry'
entry_numberstring | nullJournal number (e.g., JE-0042); null on an entry a document posted
datedateThe date the entry is dated (the books day it lands on)
recorded_atdate-timeWhen its lines were written to the ledger, the time `since` compares
entry_typeprimary | supplemental | cogs | closingprimary: a document's or a person's entry, and a reversal of one (reversal_of_id names what it reverses: an edit or a void). supplemental: a further entry on the same document, dated on its own (recognition, revaluation). cogs: an inventory sale's cost of goods. closing: the fiscal year's closing entry, which reports leave out
source_typeInvoice | Bill | Expense | SalesReceipt | CustomerCharge | Payment | BillPayment | Check | CreditMemo | VendorCredit | RefundReceipt | Deposit | AccountTransfer | PayrollRun | BankTransaction | other | nullThe record it came from. BankTransaction: a bank line categorized straight to an account. other: one of Imprest's own sources (an import, a connection, a depreciation run). Null on a manual or imported journal entry
source_iduuid | nullThat record's id; null for other
memostring | nullMemo
adjustingbooleanWhether the entry is marked as an adjusting entry
statusstringposted, or reversed: posted, then reversed by reversed_by_id (as it stands now; an entry reversed later does not reappear, its reversal does)
currencystringThe currency a manual entry was written in; a document's entry is in the home currency here and each line's original_currency says what it holds
home_currencystringThe company's home currency; debit_cents and credit_cents are in it
exchange_ratestring | nullHome currency per unit of currency, as a decimal string (foreign-currency entries)
total_centsintegerSum of the debits, in the home currency's cents
reversal_of_iduuid | nullThe entry this one reverses
reversed_by_iduuid | nullThe entry that reversed this one
linesobject[]Every line the entry wrote
created_atdate-timeWhen the journal entry was created
updated_atdate-timeWhen the journal entry was last updated

Endpoints

GET/api/v1/ledger_changes

List changes to the books

Every journal entry whose lines were written to the ledger after `since`, from any source, in the order they were written, each with all of its lines. Amounts only ever change by new entries: an edit to a posted document reverses its old entry and posts a new one, and a void is a reversal. A backdated entry appears when it was recorded, with the date it is dated. Walk the pages with `cursor` until has_more is false. For your next poll, start again with `since` a few minutes before the latest recorded_at you saw, and keep entries by id, replacing a stored copy: an entry is stamped just before it commits, so a long write can become visible slightly after the time it carries. Re-read in full now and then (nightly is plenty) to pick up what changes in place without a new entry: dimension tags or a contact filled in later, contacts merged (lines keep the old contact id), a corrected memo, an older entry becoming reversed. Also re-sync in full after entries are deleted: a company that starts over from QuickBooks or Xero, or wipes or abandons a migration, has those books rebuilt.

Scopes: ledger_changes:read or reports·operationId: listLedgerChanges

Path & Query Parameters

ParameterTypeDescription
sincedate-timeISO 8601 timestamp with a zone; entries recorded after it (e.g. 2026-11-22T20:30:00Z; URL-encode a + offset). Required unless cursor is sent
untildate-timeISO 8601 timestamp with a zone; entries recorded at or before it
cursorstringnext_cursor from the previous page; it carries the window, so send it alone
page_sizeintegerEntries per page (default 50, max 200)
Example
curl https://imprest.ai/api/v1/ledger_changes \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Response · 200
{
  "ledger_changes": [
    {
      "id": "00bd2a8d-78b3-40f2-a28f-47fc33f13a6f",
      "object": "journal_entry",
      "entry_number": null,
      "date": "2020-03-01",
      "memo": "ledger feed test",
      "adjusting": false,
      "status": "posted",
      "currency": "USD",
      "home_currency": "USD",
      "exchange_rate": null,
      "total_cents": 450,
      "reversal_of_id": null,
      "reversed_by_id": null,
      "lines": [
        {
          "account_id": "def75944-088d-5417-88b3-d3d68486b302",
          "debit_cents": 0,
          "credit_cents": 450,
          "original_currency": "USD",
          "original_amount_cents": -450,
          "description": null,
          "contact_id": null,
          "customer_id": null,
          "entity_id": "de1bcf26-486e-5a7f-ab1b-97d51478637b",
          "dimension_values": {}
        },
        {
          "account_id": "d178ce30-efb5-5ce1-9a87-f27b3423ab30",
          "debit_cents": 450,
          "credit_cents": 0,
          "original_currency": "USD",
          "original_amount_cents": 450,
          "description": null,
          "contact_id": null,
          "customer_id": null,
          "entity_id": "de1bcf26-486e-5a7f-ab1b-97d51478637b",
          "dimension_values": {}
        }
      ],
      "created_at": "2020-03-01T12:01:00Z",
      "updated_at": "2020-03-01T12:01:00Z",
      "recorded_at": "2020-03-01T12:01:00Z",
      "entry_type": "primary",
      "source_type": "BankTransaction",
      "source_id": "4018637f-a5b8-5002-90bf-4ec780e9be5a"
    },
    {
      "id": "9b64c1f7-7862-46d9-9b55-3a822adc8905",
      "object": "journal_entry",
      "entry_number": null,
      "date": "2020-03-01",
      "memo": "ledger feed test",
      "adjusting": false,
      "status": "posted",
      "currency": "USD",
      "home_currency": "USD",
      "exchange_rate": null,
      "total_cents": 900,
      "reversal_of_id": null,
      "reversed_by_id": null,
      "lines": [
        {
          "account_id": "d178ce30-efb5-5ce1-9a87-f27b3423ab30",
          "debit_cents": 900,
          "credit_cents": 0,
          "original_currency": "USD",
          "original_amount_cents": 900,
          "description": null,
          "contact_id": null,
          "customer_id": null,
          "entity_id": "de1bcf26-486e-5a7f-ab1b-97d51478637b",
          "dimension_values": {}
        },
        {
          "account_id": "def75944-088d-5417-88b3-d3d68486b302",
          "debit_cents": 0,
          "credit_cents": 900,
          "original_currency": "USD",
          "original_amount_cents": -900,
          "description": null,
          "contact_id": null,
          "customer_id": null,
          "entity_id": "de1bcf26-486e-5a7f-ab1b-97d51478637b",
          "dimension_values": {}
        }
      ],
      "created_at": "2020-03-01T12:02:00Z",
      "updated_at": "2020-03-01T12:02:00Z",
      "recorded_at": "2020-03-01T12:02:00Z",
      "entry_type": "primary",
      "source_type": "other",
      "source_id": null
    }
  ],
  "next_cursor": null,
  "has_more": false
}
Response fields
ParameterTypeDescription
ledger_changesrequiredobject[]The entries, in the order their lines were written
idrequireduuidJournal entry UUID
objectrequiredjournal_entryAlways 'journal_entry'
entry_numberrequiredstring | nullJournal number (e.g., JE-0042); null on an entry a document posted
daterequireddateThe date the entry is dated (the books day it lands on)
recorded_atrequireddate-timeWhen its lines were written to the ledger, the time `since` compares
entry_typerequiredprimary | supplemental | cogs | closingprimary: a document's or a person's entry, and a reversal of one (reversal_of_id names what it reverses: an edit or a void). supplemental: a further entry on the same document, dated on its own (recognition, revaluation). cogs: an inventory sale's cost of goods. closing: the fiscal year's closing entry, which reports leave out
source_typerequiredInvoice | Bill | Expense | SalesReceipt | CustomerCharge | Payment | BillPayment | Check | CreditMemo | VendorCredit | RefundReceipt | Deposit | AccountTransfer | PayrollRun | BankTransaction | other | nullThe record it came from. BankTransaction: a bank line categorized straight to an account. other: one of Imprest's own sources (an import, a connection, a depreciation run). Null on a manual or imported journal entry
source_idrequireduuid | nullThat record's id; null for other
memorequiredstring | nullMemo
adjustingrequiredbooleanWhether the entry is marked as an adjusting entry
statusrequiredstringposted, or reversed: posted, then reversed by reversed_by_id (as it stands now; an entry reversed later does not reappear, its reversal does)
currencyrequiredstringThe currency a manual entry was written in; a document's entry is in the home currency here and each line's original_currency says what it holds
home_currencyrequiredstringThe company's home currency; debit_cents and credit_cents are in it
exchange_raterequiredstring | nullHome currency per unit of currency, as a decimal string (foreign-currency entries)
total_centsrequiredintegerSum of the debits, in the home currency's cents
reversal_of_idrequireduuid | nullThe entry this one reverses
reversed_by_idrequireduuid | nullThe entry that reversed this one
linesrequiredobject[]Every line the entry wrote
account_idrequireduuidChart account UUID (GET /accounts)
debit_centsrequiredintegerDebit in the home currency's cents (0 on a credit line)
credit_centsrequiredintegerCredit in the home currency's cents (0 on a debit line)
original_currencyrequiredstringISO currency the line was written in (debit_cents and credit_cents are always the home currency)
original_amount_centsrequiredinteger | nullThe line's amount in original_currency: positive for a debit, negative for a credit
descriptionrequiredstring | nullLine description
contact_idrequireduuid | nullContact (party) UUID, if the line names one
customer_idrequireduuid | nullCustomer the line counts toward in profit and loss by customer
entity_idrequireduuid | nullEntity UUID the line posts to
dimension_valuesrequiredobjectDimension tagging (dimension_id => value_id)
created_atrequireddate-timeWhen the journal entry was created
updated_atrequireddate-timeWhen the journal entry was last updated
next_cursorrequiredstring | nullPass as cursor for the next page; null on the last
has_morerequiredbooleanWhether another page follows

Errors

  • 401No valid access token (invalid_token).
  • 403The token or the person behind it can't do this: insufficient_scope names the scope the token lacks; forbidden means the person's role doesn't allow it.
  • 422since missing or not a timestamp with a zone, until not one or before since, a cursor sent with since or until, or a cursor that isn't one this endpoint gave (invalid_filter)

Every error uses the same envelope: error, message and error_code.