Accounting API
Accounting data for reporting and back-office integrations: accounting entries, the chart of accounts and bank transactions. For access, paging, filters and getting only changes, see API basics.
1. Accounting entries
GET /api/general_ledger_record/search
Example request
Entries of October 2026, as counted in the balance report:
curl -g -G 'https://{company}.smarton.app/api/general_ledger_record/search' \
-H 'Authorization: <token>' \
--data-urlencode 'paginate=true' \
--data-urlencode 'limit=1000' \
--data-urlencode 'offset=0' \
--data-urlencode 'date=>=2026-10-01&<=2026-10-31' \
--data-urlencode 'active=1' \
--data-urlencode 'locked=0' \
--data-urlencode 'partialJoin[accountCategory][]=name' \
--data-urlencode 'partialJoin[accountCategory][]=keyName' \
--data-urlencode 'partialJoin[supplier][]=name' \
--data-urlencode 'partialJoin[customer][]=name' \
--data-urlencode 'sort[date]=asc'
Fields
| Field | Meaning |
|---|---|
id | Unique ID. |
date | Date of the entry. |
accountCategory | The account: keyName is the account number, name its name. |
type | D (debit) or C (credit). |
sum | Amount and currency. |
pair | The opposite entry of the same operation. |
entity, entityId | The kind of document the entry comes from (for example a purchase, an invoice, a POS card or cash sale) and its ID. Direct links: purchase, invoice, payment. |
documentNumber, name, comments | Document number and description. |
supplier, customer | The supplier or customer, if any. |
namespace | The unit, for companies with several locations. |
active, locked | The balance report counts entries with active true and locked false. Entries of purchase documents become active when the document is confirmed and has an invoice number. |
Entries can be deleted without a trace when their document changes. To keep your copy correct, reload the entries of a period in full (for example the current and previous month) instead of fetching only changes.
2. Chart of accounts
GET /api/account_category/search?select[]=name&select[]=keyName&select[]=type&partialJoin[parent][]=keyName&paginate=true&limit=1000
Fields: id, keyName (account number), name, type (D or C) and parent (upper account). Expenses are classified by these accounts.
The same accounts as a tree, with the sub-accounts of each account in children:
GET /api/account_category/tree
3. Bank transactions
GET /api/bank_transaction/search?transactionDate=>=2026-10-01%26<=2026-10-31&paginate=true&limit=500
Transactions imported from bank statements. Fields: transactionId (the bank's ID), transactionDate, amount, currency, type, fromName and fromAccountNumber, toName and toAccountNumber, transactionText, and matched (linked to an invoice or purchase).
4. Balance
GET /api/account_category/get_balance?from=2026-10-01&to=2026-10-31
Debit and credit of every account for a period, the same figures as the balance report in Smarton. from and to are dates. A from before the beginning of the balance period (set in the accounting settings) is moved to that beginning.
{
"remnant": { "D": { "12": 1500.0, … }, "C": { … }, "sumD": { … }, "sumC": { … } },
"period": { "D": { … }, "C": { … }, "sumD": { … }, "sumC": { … } },
"total": { "D": { … }, "C": { … }, "sumD": { … }, "sumC": { … } }
}
| Key | Meaning |
|---|---|
remnant | Opening balance: from the beginning of the balance period to the day before from. |
period | Turnover from from to to. |
total | Closing balance: remnant plus period. |
D, C | Debit and credit amounts, by account ID (id of account_category, see section 2). |
sumD, sumC | The net balance: debit minus credit when it is positive (sumD), otherwise credit minus debit (sumC). |
The balance counts entries that are active and not locked, like the report. On a unit address it covers only that unit.
5. Sales invoices and their lines
GET /api/invoice/search
Example request
Invoices of 2026, without drafts and invalidated invoices:
curl -g -G 'https://{company}.smarton.app/api/invoice/search' \
-H 'Authorization: <token>' \
--data-urlencode 'paginate=true' \
--data-urlencode 'limit=200' \
--data-urlencode 'type==invoice' \
--data-urlencode 'isInvalidated=0' \
--data-urlencode 'date=>=2026-01-01T00:00:00Z&<2027-01-01T00:00:00Z' \
--data-urlencode 'partialJoin[customer][]=name' \
--data-urlencode 'sort[date]=asc'
Fields
| Field | Meaning |
|---|---|
id, number, date | ID, invoice number and date. |
type | invoice, proforma or draft. |
customer | The buyer. |
sum, sumVat, sumWithVat | Totals without VAT, VAT and with VAT. sumLocalCurrency… are the same in the company's currency. |
discount, discountPercent | Discount of the whole invoice. |
deadline, isPaid, paidAmount, paidAt, isOverdue, overdueDays | Payment due date and payment state. |
isCredit, creditInvoiceReference | Credit invoice and the invoice it corrects. |
isInvalidated, confirmed, locked | Invalidated, confirmed, locked for changes. |
namespace | The unit, for companies with several locations. |
Invoice lines
GET /api/invoice_record/search?invoice.id=3&partialJoin[vat][]=percentage&partialJoin[accountCategory][]=keyName&partialJoin[order][]=number
Fields: name, quantity, unit, price (unit price without VAT), sum (line amount without VAT), vat (VAT rate), accountCategory (account of the line) and order (the order the line comes from). Invoices made from POS sales are also described in Orders API.
6. Payments
GET /api/payment/search?date=>=2026-10-01T00:00:00Z%26<2026-11-01T00:00:00Z&partialJoin[customer][]=name&partialJoin[supplier][]=name&partialJoin[invoice][]=number&partialJoin[purchase][]=invoiceNumber&sort[date]=asc
Payments of invoices and purchase documents, and other accounting payments. Fields: id, date, sum (amount and currency), comments and type:
| type | Meaning |
|---|---|
invoice | Payment of a sales invoice: invoice and customer. |
purchase | Payment of a purchase document: purchase and supplier. |
salary, tax, ledger | Salary, tax and other accounting payments. |
Payments made in the POS are in account_registry, see Orders API.
7. Banks and fixed assets
GET /api/bank/search GET /api/assets/search?partialJoin[assetType][]=name&partialJoin[person][]=name GET /api/asset_type/search
Banks: name, address, swiftCode, bankCode. Fixed assets: name, inventoryNumber, assetType, exploitationStart (put into use), purchaseCost, installationCost, residualValue, amortizationDuration, person (responsible person) and purchase (the purchase document).
8. Lookups
VAT rates: GET /api/vat/search (name, percentage). Payment types: GET /api/payment_type/search (name, isEnabled). Both are used by the records above.
With an API key
The Accounting area of an API key reads accounting entries, the chart of accounts, bank transactions and payments. Sales invoices need the Sales area. VAT rates and payment types can be read with any key. The balance (section 4), the account tree, invoice lines, banks and fixed assets are not available with an API key: sum the accounting entries instead of the balance.
Not available
- Cash-flow categories: Smarton does not classify payments into cash-flow categories.
- Cost centres or departments: the only dimension is the unit (
namespace) of the entry.
English