Appearance
Accounting models
An accounting model (in the API an accounting target) decides which ledger account each part of a salary payment is posted to. If your product books payroll into a ledger, the model decides the account numbers you receive. Salaxy sets the models up for you; you review them and read the result.
Examples use the test environment; see Environments for demo and production. How to fetch the accounting data is on Accounting data.
What an accounting model is
- A chart of accounts and a rule set. The rules map each kind of salary amount, such as income types and totals like net pay, tax and social security, to a debit and a credit account.
- Export settings. Each model also names the accounting system and format the data is meant for.
- One for each system. Salaxy has built-in models for the accounting systems it supports.
- A default model. Every company has a default model. If none is set, the built-in Salaxy default is used.
What it changes
- The proposed account on invoice rows. Each row of a payment-channel invoice carries
accountingAccountNumberandaccountingCode: one proposed ledger account for the row. This is not the bank account. The bank account of the payee isrecipient.iban. - The accounting data of a report. The accounting-data endpoints post the rows with the model's rules. They take an optional
targetparameter to choose the model. A row with no matching rule, or a rule that is switched off, yields an entry with no accounts and no amount, silently, and not an error. Check the model against your chart before go-live. - The model is applied when the invoice is created, and the number is stored on the invoice. A later change to the company's model does not rewrite invoices that already exist.
- Only one account per row on an invoice. The counter-account (bank or payable) is not on the invoice row. For a full debit and credit voucher, use the accounting data from the reports, not the invoice.
Who provisions it
| Step | Who |
|---|---|
| Create and update an accounting model | Salaxy. You review the list of accounts it locks. |
| Attach it to your customer companies | Salaxy, through a service model |
| Changes for one customer | Salaxy's existing customer-specific process |
You do not assign a model to a company directly. The service model carries it down, and with the accounting section on, the company's models are replaced by the service model's list. The company's default may then be reset to the service model's default: always when the list includes Salaxy's built-in default model, and otherwise when the company's old default is not in the list. A company under such a service model cannot create customer-specific posting rules in its own settings.
Test and production hold separate models with different ids. Salaxy copies each model to production and tells you its production id, which your design document records.
Endpoints
You normally only read. Creating and editing is Salaxy's job.
| Method | Path | Purpose |
|---|---|---|
| GET | /v03/api/accounting-target | List the models of the account. This is a search result and does not hold the rules. |
| GET | /v03/api/accounting-target/{id} | One model with info and ruleSet. |
| GET | /v03/api/accounting-target/new | A blank model, not stored. |
| POST | /v03/api/accounting-target | Create or update. |
| DELETE | /v03/api/accounting-target/{id} | Delete. |
The same paths exist under /v04/api/. The list supports the OData parameters $search, $filter, $orderby, $select, $top and $skip. See the AccountingTarget reference.
The rule set (ruleSet) has accounts (account number and text), targetCoA (the chart of the target system, not only the accounts in use) and rows. A row has an entryCodeGroup, an entryCode, enabled, isIncluded, and debitId and creditId. The ids point into accounts; the account numbers are not on the row.
http
GET https://test-secure.salaxy.com/v03/api/accounting-target/{id}
Authorization: Bearer {customer-company-token}To see whether a model posts a given item, fetch it by id and filter ruleSet.rows by entryCodeGroup and entryCode, then read isIncluded. A row missing from rows behaves like isIncluded: false.
Test it
- Sign in as a test company under your service model and call
GET /v03/api/accounting-target. Note the default target inGET /v03/api/settings/company(accounting.defaultTargetId). - Fetch the default model by id and compare its accounts with your chart.
- Create and commit a test payroll, then read its accounting data, as on Accounting data. Every row you expect should carry an account number.
Checklist
- You have reviewed the accounts of each model with Salaxy, in test and in production.
- Every account in the model exists in your chart. Tell Salaxy about any account your chart lacks.
- You read the model by id when you need the rules; the list does not hold them.
- You treat a row without accounts as a configuration gap, not as zero.
- Production has its own copy of each model, and your design document holds the production ids.

