Autonify
Български · English

Autonify Public API v1

Български: API документация

For the developer wiring something up to Autonify. Base URL https://app.autonify.bg/api/v1, server-to-server only.

Authorization: Bearer atn_live_01k…_9f3…
Content-Type: application/json
Idempotency-Key: <your own unique string>     # required on every POST, PUT and PATCH

No CORS is configured, and none will be. An Origin header on these routes means the key is sitting in a browser, which is a leaked credential, not a missing feature. It is recorded so it can be noticed.

There is a second direction: events we push to you, so an integration does not have to poll for the seven things worth knowing about. That is §9.


1. Keys

Create one at Settings → Developer API, for the company you have open. The key is shown once; if you lose it, rotate rather than open a ticket.

API access is not something every plan carries. Small buys it as an add-on; Growth and Enterprise pick it as one of their capabilities; Firm Enterprise includes it; Starter, Micro and the practice plans have none. If the account has not bought or picked it, the keys still mint and whoami still answers — every other call returns 403 api_not_in_plan until they do. Sandbox keys keep working regardless (§6), so you can build against it first.

atn_live_<key id>_<secret>      # a real company's books
atn_test_<key id>_<secret>      # the sandbox company

A key carries one company for its whole life. There is no company parameter anywhere in this API — not in a path, not in a query, not in a body — so a request for a different EIK cannot be expressed. That is not a check we perform; it is a request you cannot make.

Two consequences worth knowing before you design around it:

  • One EIK per key. Integrating eight companies means eight keys, and your configuration needs somewhere to hold eight credentials.
  • Access is re-evaluated on every request against the same delegation and staff-assignment rules the browser uses. If the customer withdraws your accountant's delegation, the key stops on the next call.

Rotation mints a new key and leaves the old one working for seven days, so you can deploy without an outage. Revocation is immediate.

The new key belongs to the person who rotated it, not to whoever minted the old one: they are the one handed its secret. Like any key a person creates, it stops (403 token_orphaned) if they leave the account, and the expiry reminders go to them — which is also how an owner keeps an integration running past the last day of the colleague who first set it up.

A key's name is unique on its company, revoked keys included. A name that is already taken is numbered — ERP (2) — and a rotation adds the date: ERP (2026-09-28). Names are cut to 80 characters to make room for either.

Keys expire

Every key carries a hard expiry date, set at mint:

Environment Lifetime
atn_live_… 365 days
atn_test_… 90 days — a sandbox key is for building, not for running

Past it every call answers 401 token_expired. Nothing about that is gradual, and no grace window applies to it — this is a different clock from the developer terms above.

Two things keep it from surprising you. whoami returns expires_at on every call, so a health check can watch its own credential; and we notify the person who minted the key, and the account's owners, at 30, 7 and 1 days before the date. Rotate rather than wait for the refusal: rotation is the same seven-day overlap as always, so the switch costs you no downtime, while an expiry costs you all of it.

Terms changes

The developer terms carry a version. It is stamped on every key at mint and on the account that accepted it. When the terms change materially the version moves, and a 75-day grace window opens for every account still standing on the old one.

Nothing changes for you during the window. What does change is that every response your key gets — a 200, a 422, a 429, anything, including the refusal of a key that is revoked, expired, orphaned or suspended — carries:

X-Autonify-Terms: reaccept-by=2026-10-10

Log that header. It is the only place the news reaches your side, because the person who has to accept is the customer, and they are usually not you.

Past that date every endpoint answers 403 terms_reacceptance_required, whoami included. The message names the date and the page.

Nothing is revoked, rotated or re-issued by any of this. The customer opens Settings → Developer API and presses one button; your very next request is answered normally, with the same credential you are already holding. There is nothing for you to deploy, and no secret changes hands.

Only an owner or an admin of the account can accept — with that button, or by ticking the terms box while minting a key. A key minted by any other seat accepts nothing for the account, whatever version it carries.

Sandbox keys follow the same policy. One rule is easier to build against than two, and it is the same customer accepting either way.

An enterprise contract in force is never refused for this. A request the contract stands behind (its account's own key, on a company the contract covers — or that account's sandbox company) is governed by the signed agreement, not by the click-through terms, so past the deadline it is still answered. The header still carries the date, and the customer is still asked in the app. Once the contract ends, or for a key it does not cover (a delegated practice's, say), the deadline applies as above.

Permissions

Ticked per key at creation. Read-only by default.

purchases:read  purchases:write
sales:read      sales:write
orders:write
bank:read
masterdata:read masterdata:write
filings:read    filings:write
stock:read      stock:write
books:read
work:read       work:write
payroll:read    payroll:write      # enterprise contracts only — see below
payroll:account                    # enterprise contracts only; owner or admin, live keys — see below
account:companies                  # enterprise contracts only; owner or admin, live keys — see below

A key minted without any writes ticked carries purchases:read, sales:read, bank:read, masterdata:read, filings:read and stock:read.

filings:read reads every filing's status, and the files of every filing except the payroll's. The files of a Д1/Д6 and of the other payroll filings carry the people on them — EMPL2021.TXT holds every employee's full ЕГН and pay — so they need payroll:read as well, which only an enterprise contract grants and only a person with two-factor authentication can mint (§5, „Filings").

work:read / work:write log work and nothing else. They reach /billable-entries (§5, „Work to invoice") and no other route: a time tracker's key can push the hours a client is billed for, and cannot issue, send, cancel or even read an invoice. Those three routes accept sales:read / sales:write as well, so an existing sales key keeps working unchanged.

books:read is not in that set, and that is deliberate. Every other read here is a document the customer's counterparty already holds a copy of — an invoice they sent, a purchase they received, a bank line they can see. The books are the whole ledger, so it is ticked on purpose or not at all.

filings:write records an outcome; it does not file anything. It writes down what a human did through the НАП channel and the входящ номер they were handed. Two endpoints on this API do submit to НАП, under a different ability (payroll:write, enterprise contracts only), each signed with the person's КЕП and sent only when the company's API route is on: a package of електронни трудови записи (POST /payroll/employment-register/{YYYY-MM}/submit) and, since 2026-11-07, the month's Д1/Д6 (POST /payroll/runs/{YYYY-MM}/nra-submissions) — see §5 and §7.

There is no admin, billing or user permission, because there is no such endpoint. The API surface is deliberately smaller than the app's. Payroll exists, and only under an enterprise contract that includes it (below) — and so does adding a company to the account (account:companies, since 2026-10-23): through the app's own door, refused and billed as the app refuses and bills an add (§5, „The account's companies").

Your key's permissions are also intersected with the plan at request time. A sales:write key on a plan that only includes order push gets 403 ability_not_in_plan and starts working again, untouched, on upgrade.

AI assistants read through the same keys — read-only keys only. Claude, Cursor, VS Code and other assistants that speak the Model Context Protocol connect to /mcp, whose every tool is one of the reads below, with the same permissions, units and limits. A key holding any write, payroll or account-wide permission is refused there. See AI assistants (MCP).

Enterprise contracts

Some accounts use the API under an enterprise contract negotiated with us rather than a plan. For the companies it covers, the contract — not the plan — decides what the account's keys may do:

  • It names the permissions it includes, and a key's permissions are intersected with that list on every request, the free routes included. A key holding a permission the contract does not include gets 403 ability_not_in_contract. A contract can be narrowed or widened without anybody re-keying.
  • payroll:read / payroll:write exist only under a contract that includes them. No plan offers them; they are stripped at mint wherever no contract grants them, and they stop working the day the contract ends — a key minted under a contract does not outlive it with payroll access.
  • A payroll key is created by a person with two-factor authentication. A key with payroll:read or payroll:write can be created or rotated only by someone who has turned 2FA on — the account's owner included.
  • payroll:account is the one permission that reaches past the key's company (since 2026-10-22): the account's raise rules over every entity the contract covers, and their prepared raises applied across those entities in one call (§5, „Account-wide raise rules"), and (since 2026-10-23) the account's bonus rules over them (§5, „Account-wide bonus rules"). The contract must name it; it is minted only on a live key of a company the contract covers, and only by the account's owner or an admin with 2FA (the form says why it refuses one), never by the bulk „a key for every company" (forty keys each acting on all forty would be forty keys to the whole account). A key whose person later leaves those seats, or turns 2FA off, is refused the account (403 account_scope_not_permitted) and keeps its other permissions.
  • account:companies is the second one (since 2026-10-23): the account's companies listed and read, and a company added to the account from its ЕИК, with a key for it if asked (§5, „The account's companies"). Held under exactly the rule of payroll:account above — named by the contract, a live key, the owner or an admin with 2FA, never the bulk mint.
  • It applies to the contract account's own keys on the companies it covers (every company the account owns, or a named list). Anything else — a key on a company the contract does not list, an accountant's key on a covered company — is judged by its own account's plan exactly as if there were no contract.
  • whoami answers "plan": {"api": "contract"} and names the contract: "contract": {"reference": "MUL-2026", "ends_on": null} (null for a key no contract stands behind).
  • A contract can be suspended, until a date or until further notice. Every request made with a key it covers is then refused with 403 contract_suspended before any unit is spent — whoami and idempotent replays included — and details.resumes_on is the day access returns (null = until further notice). Nothing is revoked: the same key answers again on that day, from 00:00 Europe/Sofia. No events are pushed to your endpoints while it lasts, retries of ones queued before included.
  • Webhook events follow the same list: an endpoint of a contract account hears an event only when the contract includes the permission the event speaks for (sales.invoice.issued and sales.einvoice.* → sales:read, purchase.* → purchases:read, filing.* → filings:read, payroll.run.* → payroll:read).
  • A contract account's sandbox keys point at its sandbox company, like every account's (§6), and there it mirrors the contract: the same permissions, payroll included, on invented data — invented employees too — never billed. A sandbox key never writes to a real company — payroll or anything else: 403 sandbox_real_company (§6).
  • A contract can hold its contract-only permissions (payroll:*, payroll:account, account:companies) to the sandbox, while you build the integration before live access starts. The sandbox company still mirrors the whole contract, payroll:* included; live keys get the rest of its list and are not issued with those permissions, a payroll route answers a live key with 403 ability_not_in_contract, and your endpoints hear payroll events about the sandbox company only. Developers lists what the contract holds back.
  • A key minted under a contract cannot be rotated while the contract is suspended or after it has ended. A key minted before the contract falls back to the plan when the contract ends.

2. Limits

Units, not requests. A flat request counter would charge the same for one row and a hundred.

Call Units
GET /whoami, every /filings read 0
An idempotent replay 0 — served even past the ceiling
One record 1
A list page (≤ 100) 5
Any write 10
Any file upload 25

A rendered or built artefact — an invoice PDF, its UBL XML, a counterparty statement, a stored original — is priced as a list, not as a single record: it costs a render pass or an XML build. The file weight is different in kind; it is the price of us reading a document for you, not of handing back one the customer already owns.

Allowance is per company per day, plus an account-wide daily ceiling so a practice with many clients cannot multiply a per-company cap. Minting more keys on the same company buys no extra quota. Burst is 120 requests/minute per key.

What each plan with the API carries:

Plan Units included a month Past them, per 1,000 units Daily, per company Daily, whole account Keys per company
Small 20,000 €1.00 2,000 3,000 2
Growth 100,000 €0.75 5,000 20,000 5
Enterprise 400,000 €0.50 20,000 100,000 20
Firm Enterprise 400,000 negotiated 20,000 100,000 20

Prices exclude VAT. The monthly figure is included, not a ceiling; the two daily figures are the ceilings (see below). Firm Enterprise is granted with a negotiated agreement, so its price past the allowance is the one agreed. The current numbers for your account are on Settings → Developer API; whoami reports the per-company daily figure and the units used against it.

Failed authentications are counted per address. After 600 in a minute from one IP — a missing, wrong, revoked or expired key, on any route — that address gets 429 too_many_failed_attempts with a Retry-After until the minute is out. A key that has already authenticated from that address in the last few minutes keeps working, so one broken integration behind a shared egress (a NAT, Zapier, Make) does not lock out the others; a key never seen from it waits the minute out. Calls made with a valid key never count toward it.

Under an enterprise contract (§1) the contract's own ceilings replace the plan's: a daily unit allowance per company, an account-wide daily ceiling, a number of keys per company and, where one was agreed, its own per-minute burst — 0 meaning no ceiling. Both daily ceilings count the contract's traffic apart from everything else: a plan-funded integration on a company outside the contract keeps its own budget, and so does another account's key on a company inside it — a delegated accountant's, judged by their own plan. whoami reports the figures, and the units used, that apply to the key.

The monthly allowance is billed past, never refused. A plan with the API also includes a number of units a month. The units your account's own live keys spend past it are billed at the plan's price per 1,000 units, with the month's overage once the month has ended — the call itself always goes through, and the sandbox is never counted. Only the daily ceilings above, and the per-minute burst, ever refuse a call. The charge is proportional, not per started thousand, and rounded to the cent once, on the month's total: 1,234 units past the allowance at €1.00 per 1,000 is €1.23. The owners of the account are told when the month's units reach 80% and 100% of the allowance, once each a month. /billing and Settings → Developer API show the allowance, the units used this month, the overage so far and the price.

A month is never priced above its plan's figures in force when it began: a higher price takes effect from the next whole month, and an existing customer is told at least 30 days before. Across a change of plan, the plan held at the end of the month decides the whole month: one moved up counts the whole month against the higher plan's allowance and price, one moved down against the lower plan's.

Under an enterprise contract, the account's enterprise access can include a monthly allowance of its own: the units the contract's served calls are charged past it are billed on the contract's monthly statement, again never refused — unless the contract itself prices API usage (units or calls), in which case that is the one bill. An account can instead have no monthly limit: nothing is billed for its units, and the contract's daily ceilings stop applying to its keys. The per-minute burst is then the only limit, and it is never removed. Where there is no daily ceiling, X-Autonify-Units-Limit is 0, X-Autonify-Units-Remaining is not sent at all, and whoami answers "units_remaining": null — never a remaining 0 for a client to stop on.

Past the daily ceilings, billed instead of refused. An enterprise contract can be set — by us, per contract, off unless agreed — to bill the units its calls are served past a daily ceiling instead of refusing them. Such a call goes through, with X-Autonify-Quota-Warning: overage and X-Autonify-Units-Remaining: 0; the units it was charged past the ceiling are billed on the contract's monthly statement at the access's price per 1,000 units, on a line of their own, and are not counted again against the monthly allowance. The contract can cap those units with a monthly maximum: past it the ceiling refuses again — 429 quota_exceeded, the message naming the maximum, Retry-After until the daily ceiling comes back at midnight (Europe/Sofia). The per-minute burst is never billed past: it stays a 429. Nothing else such a contract bills past its limits answers 403, 409 or 429: a purchase sent with a file is read past the month's automatic reads when the contract bills them, and companies and team seats are added in the web app.

Every response the quota check answers — a served call, a route's own refusal, a 429 quota_exceeded — carries:

X-Autonify-Units-Limit: 5000
X-Autonify-Units-Remaining: 4310
X-Autonify-Units-Reset: 2026-07-27T23:59:59+03:00     # midnight, Europe/Sofia

At the ceiling you get 429 quota_exceeded and a Retry-After. Never a partial or degraded response — a half-answer from an accounting API is worse than a refusal, because your code will persist it.

A request that is refused before it does any work — a 404, a validation failure — is refunded. The ceiling is not a punishment for a typo.

Two deliberate exceptions:

  • POST /purchases and POST /orders have a 10% grace band. A refused supplier invoice or customer order is a document that legally exists and the customer loses it, not you. Inside the band the call succeeds with X-Autonify-Quota-Warning: grace.
  • Every filings read is exempt entirely — the list, the file listing and the files themselves. A billing limit never blocks a compliance filing, and your quota is a billing limit. POST /filings/{id}/transition is a write and is priced as one: recording an outcome is bookkeeping, not a compliance read.

Free is a price, never a permission. A zero-unit route still requires the ability it declares. A key minted with orders:write alone cannot list a company's filings, and the 403 it gets costs nothing.

Contract usage

GET /usage tells a key under an enterprise contract what the contract has used this month (Europe/Sofia) — quantities only, never money. It costs 0 units and needs no permission; ?period=YYYY-MM reads an earlier month.

{ "data": {
  "contract": { "reference": "MUL-2026", "metric": "payslips",
                "included_per_month": 2000, "starts_on": "2026-10-01", "ends_on": null },
  "period": "2026-10",
  "totals": { "payslips": 1874, "api_calls": 5210, "api_units": 40110 },
  "companies": [ { "id": "01k…", "eik": "131063188", "name": "Ентитет 1 ЕООД",
                   "payslips": 51, "api_calls": 140, "api_units": 1105 } ],
  "areas": [ { "ability": "payroll:write", "calls": 2300, "units": 23000 },
             { "ability": null, "calls": 820, "units": 0 } ]
}, "meta": { "complete": true, "as_of": "2026-10-28T09:14:02+00:00" } }
  • A payslip belongs to its payroll month: October's payroll computed on 5 November counts in October.
  • api_calls counts calls that were served — a refused, failed or replayed call is not usage — and not the free routes (whoami, /usage, the /filings reads), which are listed under "ability": null.
  • The figures cover the companies the person who minted the key can reach. When that is not every company under the contract, meta.complete is false and the totals are theirs, not the contract's.
  • included_per_month is null when the contract has no monthly ceiling.
  • A key no contract stands behind gets 404 no_contract.

3. Idempotency

Idempotency-Key is required on every POST, PUT and PATCH. Not because a duplicate row is untidy, but because a duplicate invoice lands in a legally gap-free series, becomes visible to the NRA, and cannot be quietly deleted.

  • Same key, same body → the first response, replayed, at 0 units, even past your quota. The replay is marked:

    X-Autonify-Idempotent-Replay: true
    X-Autonify-Units-Charged: 0
    

    It is the first answer's status and body, not its headers: a replay carries no Location (an upload's receipt is data.id in the body) and none of the X-Autonify-Units-Limit / -Remaining / -Reset trio. It does count towards the per-key burst, like every call (§2).

  • Same key, different body → 422 idempotency_key_reused. That is a bug in your code — two documents sharing one key — and answering with the first document's id would let the second one vanish.

  • One part of an answer is never kept: the secret of an API key minted in the call (POST /companies with key). It is shown once, so the replay is the first answer with "secret": null — we hold no copy of a key's secret, not even for a day.

  • A refusal (400, 422) is remembered at no more than 16 KB: past that, its field errors are kept from the top, one message each, and the replay carries "truncated": true beside them. The status, the code and the message are the first answer's.

  • Keys are honoured for 24 hours. A 5xx is not remembered, so a genuine retry after a server error genuinely retries.

What is remembered is only what the bytes deserve. A 2xx, a 400 and a 422 are verdicts on your request, and the same bytes must always get the same answer. Everything else — 402, 403, 409, 429, 5xx — is a fact about the world at that instant: a plan that has lapsed, an allowance that is spent, a period that is locked. Those are released, so the retry the documentation tells you to make genuinely re-runs. Nothing was created either way; that is what makes releasing them safe.

A few 422s are about the books, not the bytes, and are released too. Each depends on something you or the customer can change without changing the request — the person's contract type, whether a termination is on record, which pay components the company keeps, which cost centres, projects and values it has and which of them are archived:

not_an_employee  not_employment_income  use_active_to  use_termination
hours_not_applicable  components_not_applicable  unknown_component
employee_data_missing  termination_ground_required
unknown_analytic  analytic_archived

(A month that has not begun is 409 period_in_future, never a 422, so it is not remembered either.)

The same request succeeds once that has changed. Every other 422 — validation_failed, the framework's field errors (§4) — is remembered.

If two of your workers race the same key, the loser gets 409 idempotency_in_progress rather than a second document.

A request that died is not in progress for ever. A key is reserved before the work and answered after it; a request killed in between (a deploy restarting our servers, a timeout) leaves a reservation with no answer. Once it is 10 minutes old — far past the longest request we serve, since every heavy job is queued — it is treated as abandoned: your retry with the same key does the work and is answered normally. Nothing of the killed request survived it, so there is nothing to duplicate.


4. Shapes

Money is always an object, never a float:

{ "amount": "1234.56", "currency": "EUR" }

A document carries figures in its own currency and in EUR, because the books are in EUR and the supplier's invoice may not be. A float would also lose cents on the way through JavaScript, which is what most integrations are written in.

A quantity is not money. Stock levels and line quantities are plain decimal strings — "20.000" — because three decimals of a kilogram is not an amount of anything.

Dates are YYYY-MM-DD. Timestamps are RFC 3339. Every business-day boundary is Europe/Sofia, including the quota reset.

Success:

{ "data": { … }, "meta": { "next_cursor": "01k…", "limit": 50 } }

Failure:

{ "error": { "code": "duplicate_document", "message": "…", "request_id": "01k…" } }

Some refusals carry a details object beside those three — the id you already have, the transition you asked for, the seconds until a cooldown lifts. §8 says which.

An unexpected error on our side is an answer in the same envelope: 500 server_error, with the request_id to quote. The message says nothing about the failure; the request id is how we find it.

One exception, and it is the framework's. A body that fails field validation is answered by Laravel itself, in its own shape, with the messages in the installation's language:

{ "message": "Полето дата на издаване е задължително. (and 3 more errors)",
  "errors": {
    "issued_on": ["Полето дата на издаване е задължително."],
    "lines":     ["Полето редове е задължително."]
  } }

Much of the API validates by hand and answers 422 validation_failed in the ordinary envelope, with the field errors in details: every list's query string (below), POST /orders, PATCH /counterparties/{id}, GET /usage and the whole payroll API (§5). Where a body is validated otherwise, the answer is the framework shape above. Handle both; the status is 422 either way, and neither one comes right on a retry. Branch on the status, not on the body.

Lists are cursor-paginated. Pass ?cursor= from meta.next_cursor, up to ?limit=100, and ?updated_since= for incremental sync. A cursor rather than a page number because these lists change while you read them: a document captured between page 2 and page 3 shifts every later row, and an offset would silently skip one.

A list's filters are checked before they touch anything: ?from= / ?to= are YYYY-MM-DD, ?updated_since= a date or an RFC 3339 timestamp, and every filter a single value. ?kind[]=invoice or ?from=31.12.2026 is 422 validation_failed, never a server error.

Binary answers

Several endpoints hand back a file rather than JSON: the invoice PDF and its UBL XML, a purchase's stored original, a counterparty statement, one of a filing's artefacts, and — payroll, §5 — a payslip, a civil contract's сметка за изплатени суми and приемо-предавателен протокол, and the month's ведомост CSV and other reports.

Content-Type: application/pdf
Content-Disposition: attachment; filename="invoice-0000000042.pdf"
  • Raw bytes. No {"data":…} wrapper and no base64 — the artefact these routes exist to hand over is a PDF a buyer prints or an XML their ERP parses, and wrapping it would mean every integrator writes the same decode step before they can use it.
  • Refusals are still JSON. A 403, a 404 or a 409 on these routes is the ordinary {"error":{…}} envelope, so your error handling does not fork on the endpoint. Only the 200 is bytes.
  • The quota headers are still there, and the call is still metered and logged: the meter reads the status code and never the body.
  • Content-Disposition is always attachment, with an ASCII filename. There is no ?inline=1 — nothing here is being rendered in a page — and a Cyrillic filename would need RFC 5987 encoding to survive every client, so names are transliterated or keyed by id.

409 or 422 — the doctrine

The distinction is not severity. It is whose fact it is.

  • 422 is a fact about your bytes. The field is missing, the VAT rate is not one ЗДДС has, the payload does not match the contract. Re-sending the identical body could never succeed, so the answer is memoised against your Idempotency-Key.
  • 409 is a fact about the world. The document is already posted, the period is locked, the proforma has been converted, the transition is not legal from the status the filing is in, the buyer has no email address yet. The same bytes succeed once the fact changes, so the answer is released and your retry genuinely retries.

If you are ever in doubt reading one: a 409 is worth retrying after you or the customer has changed something. A 422 is worth fixing in your code.


5. Endpoints

Method Path Permission Units
GET /whoami any 0
GET /usage any — a key an enterprise contract stands behind (§2) 0
GET /purchases purchases:read 5
GET /purchases/{id} purchases:read 1
POST /purchases (JSON) purchases:write 10
POST /purchases (file) purchases:write 25
GET /purchases/uploads/{id} purchases:read 1
POST /purchases/{id}/approve purchases:write 10
PATCH /purchases/{id}/fields purchases:write 10
POST /purchases/{id}/annul purchases:write 10
POST /purchases/{id}/protocol purchases:write 10
GET /purchases/{id}/file purchases:read 5
GET /purchases/{id}/einvoice.xml purchases:read 5
GET /sales/invoices sales:read 5
GET /sales/invoices/{id} sales:read 1
GET /sales/next-number sales:read 1
POST /sales/invoices sales:write 10
GET /sales/invoices/{id}/pdf sales:read 5
GET /sales/invoices/{id}/ubl sales:read 5
POST /sales/invoices/{id}/send sales:write 10
POST /sales/invoices/{id}/storno sales:write 10
POST /sales/invoices/{id}/annul sales:write 10
POST /sales/proformas/{id}/convert sales:write 10
POST /sales/invoices/{id}/einvoice/resend sales:write 10
GET /billable-entries work:read or sales:read 5
POST /billable-entries work:write or sales:write 10
DELETE /billable-entries/{id} work:write or sales:write 10
POST /orders orders:write 10
GET /counterparties masterdata:read 5
POST /counterparties masterdata:write 10
PATCH /counterparties/{id} masterdata:write 10
GET /counterparties/{id}/statement masterdata:read 5
GET /items masterdata:read 5
POST /items masterdata:write 10
GET /chart-of-accounts masterdata:read 5
GET /bank-accounts bank:read 5
GET /bank-transactions bank:read 5
GET /warehouses stock:read 5
GET /stock stock:read 5
GET /stock/movements stock:read 5
POST /stock/transfers stock:write 10
POST /stock/adjustments stock:write 10
POST /stock/counts stock:write 10
POST /stock/conversions stock:write 10
GET /stock/production-orders stock:read 5
GET /stock/production-orders/{id} stock:read 1
POST /stock/production-orders stock:write 10
POST /stock/production-orders/{id}/issues stock:write 10
POST /stock/production-orders/{id}/labour stock:write 10
POST /stock/production-orders/{id}/completions stock:write 10
GET /books/trial-balance books:read 5
GET /books/journal books:read 5
GET /books/cost-centers books:read 5
POST /books/cost-centers masterdata:write, a plan with cost centres and budgets 10
PATCH /books/cost-centers/{code} masterdata:write, a plan with cost centres and budgets 10
GET /books/projects books:read 5
POST /books/projects masterdata:write, a plan with cost centres and budgets 10
PATCH /books/projects/{code} masterdata:write, a plan with cost centres and budgets 10
GET /books/dimension books:read 5
POST /books/dimension/values masterdata:write, a plan with cost centres and budgets 10
PATCH /books/dimension/values/{code} masterdata:write, a plan with cost centres and budgets 10
GET /books/by-analytics books:read, a plan with cost centres and budgets 5
GET /books/budgets books:read, a plan with cost centres and budgets 5
GET /books/budgets/{id} books:read, a plan with cost centres and budgets 5
GET /books/budgets/{id}/vs-actual books:read, a plan with cost centres and budgets 5
GET /filings filings:read 0
GET /filings/{id}/files filings:read (+ payroll:read for a payroll filing) 0
GET /filings/{id}/files/{fileId} filings:read (+ payroll:read for a payroll filing) 0
POST /filings/{id}/transition filings:write 10
POST /filings/{id}/carrier filings:write 10
DELETE /filings/{id}/carrier/{year} filings:write 10
GET /filings/{id}/checks filings:read (+ payroll:read for a d1_d6) 0
GET /vat/crosscheck filings:read, a plan with the NRA data cross-check 1
GET /vat/crosscheck/findings filings:read, a plan with the NRA data cross-check 5
GET /oss-register filings:read 0
GET /companies account:companies, enterprise contracts only 5
GET /companies/{id} account:companies 1
POST /companies account:companies 10
… /payroll/… — every payroll endpoint payroll:read / payroll:write, enterprise contracts only see „Payroll" below

An id that belongs to another company answers 404 not_found, never 403. A 403 would confirm the id exists somewhere, which is an existence oracle over every EIK on the platform. That holds on every route below without being repeated on each one.

Start here

curl https://app.autonify.bg/api/v1/whoami \
  -H "Authorization: Bearer $AUTONIFY_KEY"

whoami costs nothing and works even when the plan does not include the API, so your health check reports the real reason instead of dying. It is the one endpoint to build your monitoring on.

{ "data": {
  "company": { "id": "01k…", "eik": "131063188", "name": "Тест ЕООД",
               "vat_status": "registered", "vat_number": "BG131063188" },
  "environment": "live",
  "plan": { "api": "full" },
  "contract": null,
  "abilities": ["purchases:read", "sales:read", "sales:write", "…"],
  "token": { "name": "ERP", "masked": "atn_live_01k9m2p1…4T7Q",
             "expires_at": "2027-07-27T09:14:02+00:00" },
  "seat": { "role": "owner", "access": null, "access_until": null, "suspended": false },
  "quota": { "units_used_today": 690, "units_daily": 5000,
             "units_remaining": 4310, "resets_at": "2026-07-27T23:59:59+03:00" }
} }

seat (since 2026-10-30) is the team seat of the person who minted the key — the key reaches no further than it. access is null for full access (owners, admins, an unrestricted staff seat), otherwise the level per area (payroll, banking, …) that team_access refusals come from. access_until is the seat's last day (Europe/Sofia); after it the key is refused with seat_stopped, as it is while the seat is suspended.

abilities is the effective set — what the key holds, narrowed by the plan (or by the enterprise contract, when plan.api is contract — §1). A token whose sales:write is currently unusable says so here rather than only at the moment it fails.

quota is the allowance the key is judged by: a sandbox key's is the flat sandbox one and its own counter (§6), never the plan's. units_daily is 0 when there is no daily ceiling, and units_remaining is then null.

Capture a supplier invoice

curl -X POST https://app.autonify.bg/api/v1/purchases \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: erp-doc-88213" \
  -H "Content-Type: application/json" \
  -d '{
    "supplier": { "name": "Доставчик ЕООД", "eik": "131063188" },
    "document_number": "0000012345",
    "document_date": "2026-07-14",
    "payment_due_on": "2026-08-13",
    "currency": "EUR",
    "total_net": "100.00",
    "total_vat": "20.00",
    "lines": [
      { "description": "Хартия A4", "product_code": "PAP-A4",
        "quantity": 10, "unit_price": "10.00", "vat_rate": 20 }
    ]
  }'

Required: supplier.name, document_number, document_date, currency, total_net, total_vat. Optional: supplier.eik, supplier.vat_number, payment_due_on, kind (invoice | credit_note | debit_note | protocol, default invoice), expense_account_code, external_ref, up to 500 lines, and analytics — the cost centre, project and value of the company's own dimension the cost lines carry, by code (since 2026-11-16; see „Cost centres, projects and budgets").

expense_account_code — one document, more than one account. Send it at the top level to say where the whole cost goes, and on a LINE to charge that line somewhere else: a landlord's invoice carrying rent and re-billed electricity is one paper document with two accounts, not two documents. The codes are the company's own chart, so an account that is not on it — or one its owner has retired — is refused rather than quietly replaced. Omit both and nothing changes: the document is classified the way it always was. A line that names no account belongs to the document's own.

The document's total_net and total_vat stay authoritative whatever the lines say — they are what the supplier printed, what the дневник покупки reports and what 401 is credited with. Lines only describe how the cost is DIVIDED, so they are never cross-footed against the totals and a line list that does not add up produces a different split rather than a refusal. What the lines leave unexplained is charged to the document's own account.

One shape is worth knowing about, and it is not refused: a document whose own account is a stock account (302–308) and whose lines leave a remainder. That remainder is debited to the stock account with no line to receive it into the stock records, so the ledger and the sub-ledger part by exactly it and those goods cost out at zero when sold. The document is captured and posted normally — a supplier's invoice is a fact your books have to record — and a notice naming the amount is raised in the app when it is posted. Send the remainder as its own line, or put the document on an account that is not stock, if you want it gone. Line-level rounding never triggers it: a cent per line is tolerated, because Σ round(x) ≠ round(Σ x).

payment_due_on is the due date the supplier's document STATES, and it is optional because a due date is not a чл. 114 ЗДДС requisite — plenty of invoices print none. Send it only when the paper carries one: it is what lets the payables aging report lateness rather than only age, and what dates the bill in the cash-flow forecast instead of the assumed 30-day term. Omit it and the document simply has none; never send a term you computed yourself.

A line takes description, quantity, unit_price, optionally vat_rate, net, vat — both derived from quantity × price when absent — expense_account_code (see above), and product_code. That last one is how goods reach the stock sub-ledger: a line with a code that matches an article receives stock when the document is posted. Without it the purchase is an expense and nothing else.

The response is your own document record — supplier, number, date, totals, VAT credit right, expense account — after Autonify's classification has run.

{ "data": {
  "id": "01k…",
  "kind": "invoice",
  "source": "api",
  "supplier": { "name": "Доставчик ЕООД", "eik": "131063188", "vat_number": null },
  "document_number": "0000012345",
  "document_date": "2026-07-14",
  "payment_due_on": "2026-08-13",
  "currency": "EUR",
  "totals": {
    "net":   { "amount": "100.00", "currency": "EUR" },
    "vat":   { "amount": "20.00",  "currency": "EUR" },
    "gross": { "amount": "120.00", "currency": "EUR" },
    "eur_net":   { "amount": "100.00", "currency": "EUR" },
    "eur_vat":   { "amount": "20.00",  "currency": "EUR" },
    "eur_gross": { "amount": "120.00", "currency": "EUR" }
  },
  "vat_credit_right": "full",
  "expense_account_code": "601",
  "status": "posted",
  "needs_review": false,
  "review_reasons": [],
  "created_at": "2026-07-14T10:02:11+03:00",
  "updated_at": "2026-07-14T10:02:11+03:00",
  "lines": [ { "description": "Хартия A4", "product_code": "PAP-A4",
               "quantity": "10.000000",
               "unit_price": { "amount": "10.00", "currency": "EUR" },
               "vat_rate": "20.00",
               "net": { "amount": "100.00", "currency": "EUR" },
               "vat": { "amount": "20.00",  "currency": "EUR" } } ]
} }

source says where the FIELDS came from, not where the request came from: api for a document you described, api_upload for one our reader filled in. An integrator reconciling a mismatch needs to know which of the two they are looking at.

Duplicate protection is built in: a content hash over supplier, number, date and amount means re-sending the same invoice returns 409 duplicate_document with the existing id in details.existing_id, not a second document.

Filter the list with ?kind=, ?needs_review=, ?from=, ?to=, plus the usual ?cursor=, ?limit= and ?updated_since=.

Send a file instead

Same endpoint, multipart/form-data, one file field. PDF, JPG or PNG, up to 10 MB.

An XML e-invoice (UBL 2.1 or UN/CEFACT CII) goes in the same field and is not read at all but taken at once, with no OCR entitlement asked for — see „E-invoicing (groundwork)" below.

curl -X POST https://app.autonify.bg/api/v1/purchases \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: scan-2026-07-27-0041" \
  -F "file=@invoice.pdf"
{ "data": {
  "id": "01k9…",
  "object": "purchase_upload",
  "status": "extracting",
  "original_name": "invoice.pdf",
  "document": null
} }

You get 202 and a Location header, not a document — because there isn't one yet. Poll the receipt:

curl https://app.autonify.bg/api/v1/purchases/uploads/01k9… \
  -H "Authorization: Bearer $AUTONIFY_KEY"
status Meaning document
extracting Queued or being read. null
captured Read and captured. the document
needs_review Not enough was legible to capture. A human finishes it in the app. null
duplicate You already have this one. the document it duplicates
failed The file could not be read at all. null

Or subscribe to purchase.upload.finished (§9) and stop polling: it fires on every one of those outcomes, failed included.

Three things about this endpoint are deliberate and will not change:

  • The read is asynchronous, at the account's normal queue priority. There is no ?wait=true and there will not be one: poll the receipt. A busy hour can mean minutes, so do not block a checkout on it.
  • A file costs 25 units, not 10. Budget uploads separately from writes.
  • You never receive the reader's output. Not the raw fields, not the text, not confidences or bounding boxes. File in, your own record out. If a read is wrong, correct the document — in the app or through PATCH /purchases/{id}/fields below — and the correction is remembered for that supplier, so the next invoice from them comes back better.

The upload also needs the OCR entitlement, which is a separate feature from the API. Without it you get 403 ocr_not_in_plan — and capturing the same document as JSON still works, because a billing gate never blocks entering a document, only reading one for you.

A plan whose monthly reading allowance is spent is not a refusal: the file is accepted and receipted as always, and comes back needs_review for a human to finish. Losing a supplier's invoice over a monthly count would be the one shape this endpoint must not have.

Idempotency on an upload hashes the file's bytes, not just the body, so the same key with a different scan is refused (422 idempotency_key_reused) rather than silently answered with the first document. Retrying the identical file under the same key replays, as it should.

Correct, approve, annul a supplier document

curl -X PATCH https://app.autonify.bg/api/v1/purchases/01k…/fields \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: erp-fix-88213-1" \
  -H "Content-Type: application/json" \
  -d '{
    "supplier": { "name": "Доставчик ЕООД", "eik": "131063188" },
    "document_number": "0000001234",
    "document_date": "2026-06-11",
    "payment_due_on": "2026-07-11",
    "total_net": "120.00",
    "total_vat": "24.00"
  }'

The five header fields above payment_due_on are required — this is the API half of the review screen, and it submits the header as a whole rather than a field at a time. payment_due_on is the exception: send it to set or change the stated due date, send it as null to say the document states none, and leave it out entirely to keep whatever is stored. Omitting it is not the same as sending null — a client written before the field existed must not silently erase a падеж somebody read off the page. It answers the document with meta.corrections_recorded beside it, and it runs the same four consequences the browser's review screen runs: the recorder's snapshot, the withdrawn registry suggestion, the supplier's master record, the learning pass. An API correction that skipped any of them would slowly make the learning corpus mean "what people fixed in a browser".

  • 409 document_posted — the figures are already in the ledger. The remedy is a storno, which exists and leaves a trail.
  • 409 analytics_on_posted_document — the body's analytics would change a posted document's cost centre, project or value: those are re-tagged in the app, never here („Cost centres, projects and budgets"). On a document not yet posted, analytics is accepted like the other fields, and leaving it out keeps the stored tags.
  • 409 document_annulled — an annulled document is immutable.
  • 422 exchange_rate_missing — the corrected figures are in a foreign currency with no published rate on the document's date. A correction re-converts to euro exactly as a capture does, and never guesses a rate.

POST /purchases/{id}/approve posts a captured document to the ledger and answers the document with status: "posted". It is idempotent in the service: approving twice posts once.

POST /purchases/{id}/annul takes a required reason (≤ 500 chars) and writes a mirrored entry — never an edit. A document that never reached the ledger cannot be annulled: 409 annul_refused. (Binning an unposted document is a decision a person makes while looking at it, and is deliberately not on this API.)

POST /purchases/{id}/protocol issues the чл. 117 protocol for a reverse-charge acquisition and answers 201 with the protocol as a purchase document (kind: "protocol", number ПРОТ-…). It is idempotent — a second call returns the protocol that already exists — and refused with 409 protocol_requires_reverse_charge when the document is not a reverse-charge acquisition. Whether it is one is a classification decision the app makes, not one the caller may assert.

GET /purchases/{id}/file streams the stored original — the scan or PDF the supplier sent. Bytes, per §4. It is the customer's own document coming back out, which is the one thing the extraction embargo was never about. A document captured as JSON has no file: 404 no_file.

Issue an invoice

curl -X POST https://app.autonify.bg/api/v1/sales/invoices \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: shop-order-5512" \
  -H "Content-Type: application/json" \
  -d '{
    "kind": "invoice",
    "issued_on": "2026-07-27",
    "buyer": { "name": "Клиент ЕООД", "eik": "831919992" },
    "lines": [
      { "description": "Абонамент", "quantity": 1, "unit_price": "50.00", "vat_rate": 20 }
    ]
  }'

kind is invoice, proforma or credit_note. buyer takes either a counterparty_id or a name, plus optional eik, vat_number, address. Optional on the document: taxable_event_on (defaults to issued_on — an advance or a continuous supply sends its own), payment_method, external_ref, analytics (the revenue lines' cost centre, project and value, by code — „Cost centres, projects and budgets"; a credit note that names none takes its invoice's). A credit_note also requires corrects_document_id (the invoice it corrects, below) and correction_reason — the основание, up to 255 characters, which чл. 115, ал. 4 ЗДДС makes part of the document.

buyer.counterparty_id names a counterparty of this company (GET /counterparties), and the invoice is filed against it. The buyer the invoice prints is filled from that counterparty — name, ЕИК, ДДС номер, МОЛ, address, email — and a name or eik in the body does not rename it; the body's address is used only where the counterparty has none. An id that is not one of this company's counterparties is 422 on that field, before any number is taken. Up to 200 lines, each description + quantity + unit_price + vat_rate, plus the optional unit (a measure label of up to 20 characters, e.g. бр. or kg — printed on the invoice) and the optional item_id and restocked below. Line quantities must be above zero: a negative line is not how a supply comes down — that is what a кредитно известие is for, it takes the next number in the same series, and it is the only instrument that can also put the goods back.

vat_rate must be 20, 9 or 0. Those are the rates ЗДДС has. Anything else is refused at the door, because a 10% line would produce an invoice charging 10%, a ledger crediting it, and a ДДС return declaring the sale zero-rated — undeclared output tax, which is the direction НАП penalises.

A line that names an article moves goods. lines[].item_id is the id of an income Артикул from GET /items, and it is the same optional link the browser's composer sends: an invoice or a дебитно известие carrying one relieves the stock sub-ledger and posts COGS through the same engine an order does. Without it the line is a service, a free-text line, or goods you are choosing not to track — the document posts revenue and VAT and nothing leaves a shelf.

The id is resolved within the token's own company, and an id that is not is 422 on that field rather than a silent skip. It is 26 characters anybody can generate, and unscoped it would let a key relieve another tenant's shelf and put their goods into this company's 611.

lines[].restocked says the goods came back, and only a кредитно известие may say it. чл. 115 is about VALUE — a discount agreed later, a cancelled supply, a quality allowance, and sometimes an actual return — and nothing on the document tells those apart, so the flag is per line and opt-in, and silence never moves stock. A restocking line returns the units at the original issue's own cost, to the place they left from, capped at what that issue actually took, which is why corrects_document_id is what makes it possible at all.

On any other kind the flag is a 422, not an ignored field. It used to be dropped silently while that same line's item_id moved the article the OPPOSITE way, so an integrator reading 201 for "restocked": true and watching stock go down had been told the wrong thing twice.

corrects_document_id must be an invoice of this company's own. Validated as a bare string it would let a token park a кредитно известие against another tenant's invoice — landing in these books pointing across the fence and blocking the victim's own annulment for ever. "Not yours" and "does not exist" answer identically, so the check leaks nothing.

{ "data": {
  "id": "01k…",
  "kind": "invoice",
  "status": "issued",
  "annulled_on": null,
  "corrects_document_id": null,
  "series": "1",
  "number": 42,
  "issued_on": "2026-07-27",
  "taxable_event_on": "2026-07-27",
  "buyer": { "name": "Клиент ЕООД", "eik": "831919992" },
  "currency": "EUR",
  "totals": {
    "net":   { "amount": "50.00", "currency": "EUR" },
    "vat":   { "amount": "10.00", "currency": "EUR" },
    "gross": { "amount": "60.00", "currency": "EUR" }
  },
  "vat_breakdown": { "20": { "base": "50.00", "vat": "10.00" } },
  "origin": "api",
  "created_at": "2026-07-27T12:00:00+03:00",
  "updated_at": "2026-07-27T12:00:00+03:00",
  "lines": [ … ]
} }

vat_breakdown is keyed by rate and carries plain decimal strings — it is the document's own VAT summary, in the shape the ДДС return reads, and a zero-rated bucket carries the legal basis beside them.

Numbering goes through the same counter the browser uses, so an API-issued invoice takes the next number in the same gap-free series as one typed by hand. There is no separate API series — that would be the fastest way to produce the gap Art. 113 forbids.

GET /sales/next-number is a preview. The number is allocated at issue, so two callers asking at once see the same answer and only one of them gets it. Never render it on a document you have not issued.

A refusal about the company's state — a chart with no account 702, a locked period, a posting that does not balance — is 409 invoice_refused, not 422. Nothing was created, so your retry re-runs work that never happened.

Filter the list with ?kind=, ?from=, ?to= (YYYY-MM-DD).

The life of an invoice after it is issued

All six of these re-enter the same service the browser button calls. A сторно issued through the API takes the next number in the same чл. 113 series, posts the same reversal, and is refused by the same guards as one clicked in the app — because it is one.

GET /sales/invoices/{id}/pdf — the invoice as a PDF, bytes. Rendered on demand if the stored copy is missing, so a document issued before the renderer ran is still fetchable.

GET /sales/invoices/{id}/ubl — the EN 16931 / UBL 2.1 XML, the artefact a buyer's ERP ingests. Generated from the row on every call rather than stored: the document is immutable once issued (чл. 116), so the XML is a pure function of it. A proforma has no e-invoice form — 404 ubl_not_available — and a row whose lines no longer reproduce its total is 409 ubl_refused.

POST /sales/invoices/{id}/send — email it to the buyer. Answers 202:

{ "data": { "id": "01k…", "status": "queued", "to": "kupuvach@example.bg" } }

Queued, not delivered — delivery is the mail provider's verdict and arrives later; nothing here can honestly promise it. The ceilings are the browser's ceilings, key for key: one budget per document and one per company per day, shared with the resend button a customer may be watching. Two meters on one mailbox is no meter at all.

A document is delivered to its buyer once. If the app has already emailed it — every issued document with a buyer address is delivered automatically unless the company has switched that off — this answers 200 and sends nothing:

{ "data": { "id": "01k…", "status": "already_delivered",
            "to": "kupuvach@example.bg", "delivered_at": "2026-08-30T09:12:44+00:00" } }

Not an error, and it spends no send allowance: the state you asked for already holds. To put a second copy in the buyer's hands anyway, send {"resend": true} — the API's spelling of the Изпрати повторно button — and it answers 202 as above. Without it, calling this endpoint straight after issuing a document cannot mail one numbered чл. 114 document twice from two message ids.

  • 409 no_buyer_email — the document has no buyer address yet.
  • 429 send_cooldown — emailed a moment ago. details.retry_after is seconds.
  • 429 send_daily_limit — this company has spent today's manual send allowance. details.retry_after is seconds.
  • 403 send_not_in_sandbox — sandbox documents are never emailed (§6). A refusal rather than a silent no-op: an endpoint that answers 202 and sends nothing is worse to build against than one that says no.
  • 403 send_not_in_demo — the company belongs to a DEMO account (invented books a prospect evaluates on the live site): its documents are never emailed, whatever the key.

POST /sales/invoices/{id}/storno — a кредитно известие under ЗДДС чл. 115. reason is required, because чл. 115, ал. 4 makes основанието part of the document. Optional quantities credits a subset, keyed by the original invoice's line index; absent, the whole invoice is credited. Answers 201 with the credit note, whose corrects_document_id names the invoice.

POST /sales/invoices/{id}/annul — this document should never have been issued. A different legal act from a сторно, hence a different route: a кредитно известие declares a reversal, an annulment declares nothing at all. The number stays spent either way (ППЗДДС чл. 78). reason required; answers 200 with status: "annulled". annulled_on is not accepted, here as in the browser — the date decides which VAT period the reversal lands in, and letting the caller choose it is letting the caller move output tax between periods.

Both answer 409 period_locked against a closed period, and 409 storno_refused / 409 annul_refused when the service refuses — an invoice already credited cannot then be annulled.

POST /sales/proformas/{id}/convert — проформа → фактура. The real invoice takes the next number in the чл. 114 sequence, never the proforma's; that counter is one the law does not read. One conversion per proforma: the second is 409 convert_refused, with a unique constraint behind it. Answers 201 with the new invoice.

E-invoicing (groundwork)

Since 2026-11-15. The amendments to the VAT Act the government approved on 4 November 2026 make structured e-invoices (EN 16931) mandatory from 2028, each cleared through a channel to the NRA. The bill is not law yet, and no such channel exists. What is here is the groundwork that holds whatever Parliament decides: the data the draft asks for on every invoice, the state an issued invoice has as an e-invoice, and received e-invoices taken from their XML. Nothing on this API sends anything to the NRA.

A line's classification code. The draft asks every e-invoice line for the code of the goods in the EU Combined Nomenclature (КН) or of the service under „the UN/CEFACT classifier". POST /sales/invoices takes it per line:

"lines": [
  { "description": "Лаптоп", "quantity": 1, "unit_price": "900.00", "vat_rate": 20,
    "classification": { "scheme": "cn", "code": "8471 30 00" } }
]
scheme For Stored as
cn goods — the КН code 8 digits (84713000); spaces, dots and hyphens dropped
uncefact services — the draft's UN/CEFACT classifier, which its ordinance has yet to name up to 32 letters, digits, dots and hyphens, upper-cased
cpv public buyers (Common Procurement Vocabulary) NNNNNNNN-N — nine digits gain their hyphen
unspsc buyers that ask for UNSPSC 8 digits

A code without its scheme's shape is 422 on lines.N.classification.code, and the message is the scheme's sentence key: ui.einvoice.classification.invalid_cn, …invalid_uncefact, …invalid_cpv, …invalid_unspsc, or …invalid_scheme for a code sent without a scheme. Nothing is issued and no number is taken.

The document's lines carry the code as stored, with where it came from: "classification": {"scheme": "cn", "code": "84713000", "source": "line"} for one you stated, "source": "item" for one filled in from the article the line names (item_id) when you stated none. A line with neither carries no classification. Articles hold their code too: GET /items returns classification ({"scheme", "code"} or null), and POST /items takes it in that shape, under the same rules.

The seller's account — seller_iban. The draft also asks every e-invoice for the supplier's bank account. POST /sales/invoices takes an optional seller_iban (an IBAN; spaces allowed): sent, the invoice names that account; sent as null or empty, it names none, on purpose; left out, it names the company's profile account, else its first connected bank account — what the app's own invoice form starts on. An IBAN that fails its check is 422 (ui.banking.err_iban_invalid).

The einvoice block. Every sales document — GET /sales/invoices[/{id}] and every answer that returns one — says where it stands as an e-invoice, beside its own status and never inside it:

"einvoice": { "scope": "in", "status": "rejected", "reason": "sim_classification",
              "code": null, "cleared_at": null, "fix_by": "2026-11-18T09:00:12+00:00",
              "problems": [ { "code": "sim_classification", "line": 1 } ] }

It is null for a document issued before e-invoice states existed — never assessed, neither in nor out. Otherwise scope is out (with status: "out_of_scope", and reason says why) or in, and status is one of:

status What it means
out_of_scope Not an e-invoice under the draft. reason: not_tax_document (a proforma, an order document), seller_not_registered (the draft covers an unregistered supplier only when it supplies state and municipal bodies, which nothing in a document tells us yet), seller_special (VAT-registered under чл. 97а, 99 or 100, ал. 2 only — a case the draft does not settle), buyer_not_business (a private person, or no ЕИК and no VAT number), buyer_foreign, not_domestic (an intra-EU supply, an export, a triangular operation, a service supplied abroad)
not_sent In scope, and nothing was sent. Where there is no channel — every real company today — an invoice stays here, and it means nothing was sent anywhere
held Not sent: our own check before sending found a problem, the channel was unavailable, or the channel said it never received it. Safe to send again
queued On its way to the channel
submitted The channel accepted it for processing; its answer is awaited
cleared Accepted: code is the compliance code, cleared_at when
rejected Refused by the channel: problems says why, and fix_by is when the draft's 48 hours to fix it run out — null once the invoice is annulled, when nothing is left to fix
unknown Sent, and the answer was lost on the way back. It is asked about, never sent again

On held and rejected, reason is the first problem's code. problems lists the newest attempt's, each a code and — where it is about one line — that line's line, counted from 1: line_classification_missing, seller_account_missing, unit_code_fallback, writer_refused, seller_vat_missing, buyer_identifier_missing, channel_unavailable, not_received, annulled (the invoice was annulled before the attempt left — nothing was sent), sim_classification, sim_account, sim_test, and provider for a channel's own words. The number is the invoice's, never the channel's: whatever the channel answers, it stays allocated, and an invoice sent again goes out under the same number.

POST /sales/invoices/{id}/einvoice/resend — send an e-invoice that is held or rejected again, or send one nothing was ever sent for (not_sent: an invoice goes by itself only on the day it is issued or the next, so a backdated one waits for this). Every attempt is a new one with a key of its own; nothing is ever sent twice. It answers 202 with the document, whose einvoice says where the attempt went — queued (the answer comes later: the sales.einvoice.* webhooks, §9, or your next GET), or held with the problems our own check found, in which case nothing was sent.

  • 409 einvoice_not_resendable — any other state: already accepted, out of scope, issued before e-invoice states existed — or annulled, which is never sent.
  • 409 einvoice_in_flight — an attempt is live: queued, being sent, or awaiting its answer. Wait for the answer.
  • 409 einvoice_no_channel — there is no e-invoice channel for this company. Today that is every real company.

An invoice whose e-invoice is on its way (queued, submitted, unknown) cannot be annulled until the answer comes: POST /sales/invoices/{id}/annul answers 409 annul_refused with the message ui.einvoice.annul.in_flight. The one exception is an attempt made through the simulator after the simulator has been switched off: nothing will ever answer it, so the invoice annuls as any other.

Receiving: an XML e-invoice through POST /purchases. Send the XML in the file field, as you would a PDF: a UBL 2.1 Invoice or CreditNote, or a UN/CEFACT CII (D16B) CrossIndustryInvoice — Peppol BIS Billing 3.0, XRechnung and the XML of a Factur-X or ZUGFeRD invoice are each one of those. The bytes decide, never the file name or the declared type, so an XML without its <?xml …?> declaration is taken too. It is not read by our reader, so:

  • no OCR entitlement is asked for and no reading is spent — a plan without document reading takes it, and so does a month whose readings are used up;
  • it is taken at once: the 202 receipt is already final — captured, duplicate (the books already hold this invoice, and document names it) or failed — and purchase.upload.finished fires for it as for any file;
  • it is checked against a named subset of the EN 16931 business rules and against your company (the buyer it names must be you); whatever those checks cannot vouch for is captured held for review (needs_review with its review_reasons) and never posted by itself;
  • it costs the file weight (25 units), as any file does.

The receipt gains einvoice: {"syntax": "ubl_invoice", "verdict": "valid"} for an XML taken (syntax is ubl_invoice, ubl_credit_note or cii; verdict is valid or hold), {"refusal": "doctype"} for one it could not take, null for a file our reader read. A refusal is one of not_xml, doctype (a DOCTYPE declaration, which no invoice carries), encoding (the file declares an encoding other than UTF-8 or US-ASCII — send it in UTF-8), too_large (over 5 MB), too_many_lines (over 2,000), unknown_root, no_number, no_issue_date, bad_type, bad_currency, no_seller, no_totals, no_lines, profile_without_lines (a Factur-X MINIMUM or BASIC WL file, in which the PDF is the invoice — send the PDF), unreadable_amount and capture_failed. Each code's sentence, in Bulgarian and English, is ui.einvoice.inbound.refusal.{code}.

{ "data": { "id": "01k9…", "object": "purchase_upload", "status": "captured",
  "original_name": "invoice.xml",
  "document": { "id": "01k9…", "kind": "invoice", "source": "einvoice", "…": "…" },
  "einvoice": { "syntax": "ubl_invoice", "verdict": "valid" } } }

An XML that is not one of those invoices goes on to the reader's own rules, which take PDF, JPG and PNG only: 422. A PDF with an e-invoice inside (Factur-X, ZUGFeRD) is a PDF: it needs the OCR entitlement like any PDF, and the reader takes the XML inside it instead of reading the page where it can — its receipt then carries einvoice as an XML's does, once it is final.

A document taken from an XML says "source": "einvoice", whichever door it came through — this endpoint, the app's upload, the company's invoice address. GET /purchases/{id} adds how it read:

"einvoice": { "syntax": "ubl_invoice", "profile": "peppol", "verdict": "hold", "buyer_matches": "yes",
              "report": [ { "rule": "BR-CO-15", "severity": "hold", "line": null } ],
              "xml_url": "/api/v1/purchases/01k9…/einvoice.xml" }

profile is peppol, xrechnung, facturx, en16931 or other — a label, never a gate. buyer_matches is yes, no or unknown. report names every finding by its EN 16931 rule id, or by one of ours — BG-R1 (the recipient), BG-S1 (a Bulgarian supplier's VAT number), BG-N1 (the ten-digit number), BG-P1 (an amount already paid), UNIT (a unit outside UN/ECE Rec. 20), TYPE (an unusual document type), SIGN (a negative invoice taken as a credit note), CORRECTS (a note whose invoice was not found) — with severity hold or note. The block is null for a document not received as an e-invoice, and a list carries only source.

GET /purchases/{id}/einvoice.xml — the original XML, the supplier's own bytes. Bytes per §4, and only ever a download: Content-Disposition: attachment, with Content-Security-Policy: sandbox; default-src 'none' and X-Content-Type-Options: nosniff. A document not received as an e-invoice is 404 not_found.

What the sandbox simulates. Where this installation runs the e-invoice simulator, your sample company's invoices go through it — a stand-in that behaves like the draft's system and reaches nobody. An invoice issued today or yesterday is sent by itself; the simulator rejects one with a line that has no classification code (sim_classification, with the line) or that names no seller account (sim_account), and accepts anything else for processing, then as cleared — with a code that starts SIM- — when its answer is asked for, within a few minutes. So you can build against rejected → resend → cleared and both webhooks today. The sample company has no bank account of its own, so send seller_iban with an invoice you mean to see cleared. Where the simulator is not running, every invoice stays not_sent and the resend answers 409 einvoice_no_channel. A real company never sees a simulated answer.

Work to invoice — billable entries

A standing invoice set to bill work done (on /recurring-invoices) puts on each period's invoice the services logged for its client in that period, one invoice line per entry. These three routes are how a time tracker, a helpdesk or an ERP hands that work over, so nobody retypes it.

curl -X POST https://app.autonify.bg/api/v1/billable-entries \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: tracker-7731" \
  -H "Content-Type: application/json" \
  -d '{ "counterparty_id": "01k…", "performed_on": "2026-07-03",
        "description": "Консултация по договора", "quantity": "2.5",
        "unit": "ч.", "unit_price": "80.00", "vat_rate": 20,
        "external_ref": "tracker-7731" }'
{ "data": {
  "id": "01k…", "counterparty_id": "01k…", "performed_on": "2026-07-03",
  "description": "Консултация по договора", "quantity": "2.5000", "unit": "ч.",
  "unit_price": "80.0000", "vat_rate": 20,
  "net": { "amount": "200.00", "currency": "EUR" },
  "item_id": null, "account_code": "703", "status": "unbilled",
  "sales_document_id": null, "billed_at": null, "recurring_invoice_id": null,
  "source": "api", "external_ref": "tracker-7731", "…": "…"
} }

POST /billable-entries — required: counterparty_id (one of the company's counterparties), performed_on (the day the work was done, never later than today in Sofia), description, quantity (> 0), unit, unit_price (net of VAT, EUR, up to four decimals) and vat_rate (a rate this seller may charge — 20, 9 or 0, and 0 only for a company not registered under the VAT Act). Optional: item_id (one of the company's income items), account_code (702 | 703 | 709; default the item's, else 703) and external_ref (up to 100 characters).

  • description is at most 240 characters, because the entry is printed as the invoice line 03.07.2026 — Консултация по договора and an invoice line is at most 255 on every door that issues one.
  • 201 when it created the entry. The same external_ref again answers 200 with the entry it already made — send the tool's own id for the work, and re-syncing a week can never put the same hour on an invoice twice. That is beside the Idempotency-Key (§3), not instead of it: the key covers a retried request for a day, the reference covers the same work sent twice.
  • 403 recurring_not_in_plan — the plan does not include recurring invoices. Reading and deleting entries keep working.
  • unit_price is a decimal string with the four places an invoice line keeps, like a line's own; net is an amount, so it is money (§4).

What happens to an entry next. On day 1–5 of the month after its period, the client's work-based rule issues that period's invoice: one line per unbilled entry dated inside the period, the period's last day as the данъчно събитие (ЗДДС чл. 25, ал. 4), and the entry turns billed — with sales_document_id and billed_at — in the same transaction that issued the document. An entry dated in a period whose invoice has already gone out is never pulled into a later one: that would declare a supply in the wrong period. It stays unbilled, and the customer is told and offered a separate invoice for it. So send work when it is done, dated the day it was done.

GET /billable-entries — ?counterparty_id=, ?status=unbilled|billed, and ?from= / ?to= on performed_on, both inclusive. Cursor-paginated (§4).

DELETE /billable-entries/{id} — takes back an entry no document carries: 200 {"data": {"id": "01k…", "deleted": true}}. A billed entry is the опис of an issued invoice, which чл. 116 forbids editing, so it answers 409 entry_billed with details.sales_document_id; the correction is a credit note (POST /sales/invoices/{id}/storno).

The permission is work:write / work:read — the pair a time tracker's key should be minted with, which reaches these three routes and nothing else — or sales:write / sales:read: an entry exists to become an invoice line, and a key that may issue the invoice may say what goes on it.

Push a shop order

curl -X POST https://app.autonify.bg/api/v1/orders \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: shop-5512" \
  -H "Content-Type: application/json" \
  -d '{
    "store_id": "01k…",
    "id": "SHOP-5512", "number": "5512", "status": "completed",
    "currency": "EUR",
    "created_at": "2026-06-10T09:00:00+03:00",
    "paid_at": "2026-06-10T09:01:00+03:00",
    "payment_method": "card",
    "total_gross": "120.00", "total_vat": "20.00",
    "lines": [
      { "name": "Чаша", "sku": "CUP-1", "quantity": 2, "unit_price": "50.00",
        "vat_rate": 20, "net": "100.00", "vat": "20.00", "gross": "120.00" }
    ]
  }'

The same ingestion the signed store webhooks reach, judged by the same wire contract the WooCommerce plugin, the OpenCart plugin and the Windows till connector are judged by. A second normaliser for API callers would mean two ideas of what an order is, drifting apart until a merchant's shop and their ERP booked the same sale two different ways.

store_id names the store and is resolved within the token's company — a store belonging to someone else is simply not found. Required beside it: id, status, currency, created_at, payment_method, total_gross, total_vat, lines. Optional: number, paid_at, delivered_at, business_date (strict Y-m-d), total_discount, buyer. Totals may not be negative — the direction of money lives in the event, and a negative total here is always an adapter that read a сторно as a sale.

The document must foot against itself. Σ lines.vat has to equal total_vat, and Σ lines.gross has to equal total_gross, both within one stotinka. This is not a formality: the ledger credits output VAT from the SUM OF THE LINES and derives revenue as total_gross − that sum, while the чл. 114 document takes its own totals from the HEADER and its per-rate breakdown from the lines. A body whose halves disagree does not fail anywhere downstream — it books, and the difference lands silently in the merchant's VAT return. Note that total_discount is stated, not subtracted: the lines are already net of any order-level discount, exactly as the WooCommerce and Shopify rails send them, so it never enters the sum. 422 validation_failed names both figures and the difference.

Synchronous, where the webhook is queued: nothing is waiting on a checkout here, and you want the order id back. Answers 201 with the order, its totals in the shop's currency and in EUR, and delivered_at — the field that says whether the sale is in the books yet. Ingestion is idempotent on (store, order id): a re-send updates the paid/delivered transitions and never duplicates, so 201 does not mean "new".

  • 404 not_found — no such store on this company.
  • 409 store_not_push — Shopify and eMAG stores are pulled on a cursor, and accepting a push would let an integration inject orders the real connector then contradicts on its next tick.
  • 402 plan_required — no active plan or trial. details.retryable is true: hold the order and re-send it once one is live. A pause, not a rejection.
  • 422 validation_failed — the body does not match the contract, with the field errors in details. A refusal of the bytes themselves, which no retry can bring right.
  • 409 period_locked / 409 order_refused — the ledger said no. order_refused also answers a change to an order whose invoice a live e-invoice channel has accepted: an accepted e-invoice is annulled by a structured notice, which is not available yet, so record the change by hand. No live channel exists today.
  • 409 einvoice_in_flight — since 2026-11-15: the order changed after its invoice was issued, and that invoice's e-invoice is on its way or awaiting its answer (§5, „E-invoicing"), so the invoice cannot yet be annulled and replaced. Nothing was changed — the books keep the order as it was booked. Send the order again once the answer has come: the sales.einvoice.* webhooks (§9), or a GET of the invoice.
  • 409 refunded_order_changed — since 2026-11-15: money has already gone back on this order — a refund is booked against it — and the body changes it: a different shape, or delivered after the refund. Nothing was booked and nothing was reversed a second time. Whether the shop is correcting the sale or the refund cannot be told from the body, so a person reconciles the sale and its refund by hand; the same body sent again is refused the same way.

This lane carries the grace band (§2), for the same reason POST /purchases does.

Наличности — stock

This whole section needs a plan that carries the stock module. Every route below answers 403 inventory_not_in_plan without it — a different refusal from api_not_in_plan: the plan has the API and does not have this module, so a bigger API allowance changes nothing and the customer upgrades the plan instead. Sandbox keys are not exempt, because the door would still be shut on the company the key is really for. What keeps working on every plan is the BOOKKEEPING: a purchase with lines[].product_code still receives into the sub-ledger and a delivered order still relieves it and posts COGS. Only the stock endpoints are priced.

GET /warehouses lists the places stock can be: a shop with a till and an online channel are both warehouses here, and kind says which is which. Filter with ?kind=.

GET /stock answers per article, with the breakdown per place:

{ "data": [ {
  "id": "01k…",
  "sku": "CUP-1",
  "name": "Чаша",
  "quantity_on_hand": "20.000",
  "unit_cost": { "amount": "5.00", "currency": "EUR" },
  "locations": [ { "warehouse_id": "01k…", "quantity": "8.000" } ],
  "updated_at": "2026-06-05T12:00:00+03:00"
} ], "meta": { "next_cursor": null, "limit": 50 } }

quantity_on_hand is always the company total, even when ?warehouse_id= narrows the breakdown below it: the two answer different questions and you need both to reconcile a count. unit_cost is the НСС 2 weighted average per article in the books' currency — not per location, because a per-location average would make carrying a box between two shelves post a gain or a loss. ?sku= narrows to one article; a warehouse id that is not this company's is 404 not_found.

A negative location balance is information, not an error, and it is reported as it stands. A shop that sold goods the books still show in the warehouse has moved them without recording it, and «магазин −3 / склад +10» is exactly what that looks like. The company total and the article's stock account — 304 unless the article's вид says 302, 303 or 307 („Производство" below) — both stay right, and the next count settles it.

GET /stock/movements?sku= is the стокова карта: every movement of one article, oldest first, with the running balance beside it. It is how the figure above is proved rather than trusted — the balance on the article's newest movement is its quantity_on_hand, because the balance is summed over the whole history in business-day order before anything is filtered or paged. meta.quantity_on_hand carries that figure on every page, so you can assert the column without reading to the end of it.

curl "https://app.autonify.bg/api/v1/stock/movements?sku=CUP-1&from=2026-06-01&to=2026-06-30" \
  -H "Authorization: Bearer $AUTONIFY_KEY"
{ "data": [ {
  "id": "01k…",
  "moved_at": "2026-06-05T12:00:00+03:00",
  "warehouse_id": "01k…",
  "direction": "in",
  "quantity": "20.000",
  "unit_cost": { "amount": "5.00", "currency": "EUR" },
  "value": { "amount": "100.00", "currency": "EUR" },
  "balance": "20.000",
  "movement_type": null,
  "source_type": "purchase_document",
  "source_id": "01k…"
} ],
  "meta": { "next_cursor": null, "limit": 50, "sku": "CUP-1", "name": "Чаша",
            "quantity_on_hand": "20.000",
            "from": "2026-06-01", "to": "2026-06-30" } }

sku is required — a running balance belongs to one article. An SKU these books have never held is an empty page, not a 404, exactly as ?sku= on GET /stock: an article that does not exist here has no history rather than a missing one.

?from= and ?to= are inclusive business days, and they narrow what is shown, never what is counted. A balance re-based on the visible rows would read as "the article held this much" while meaning "this much moved since the 1st" — the same number with a different meaning, on the one document an accountant reconciles an article with.

value is what the movement did to the article's stock account — 304 unless its вид says 302, 303 or 307: on an issue, the weighted average in force at the time, not a revaluation at today's. Do not re-derive it by multiplying — unit_cost is rounded to the cent like every other money figure here, while the sub-ledger carries four decimals.

movement_type is the SAF-T nomenclature entry the row was stamped with, and null where nothing stamped one: a purchase receipt and an ordinary order issue both leave it empty, and the стоков файл derives the entry from the source and direction when it is built. What you get here is what the row carries, never a guess at what the file will say.

Two of those codes mean something different from every other row. On a 130 «Увеличение от преоценка» or 140 «Намаление от преоценка» row an НСС 2 обезценка moved VALUE and no units: quantity is "0.000", unit_cost carries the whole amount of the write-down or its reversal, value restates it, and balance is unchanged. Reported rather than hidden, because that row is the only trace the article carries of having been written down.

Paging is keyset on (business day, id), not on the bare id every other listing here uses. A back-dated document — a June write-off entered in July — carries a later id than movements that happened after it, and paging by id alone would hand back a balance column that jumps. Pass ?cursor= from meta.next_cursor as usual; a cursor that is not a movement of that article is 404 not_found rather than a silent restart from page one, because restarting a sync in silence is how the same movements get imported twice.

?updated_since= is not accepted here, unlike every other listing — it is ignored rather than honoured, so do not sync on it. A movement row is never edited: history only ever grows, and the cursor is where you left off.

There is no set-quantity call, and there will not be one. The obvious API to ask for is PUT /stock/{sku} {quantity}. It cannot exist here: the quantity on hand is a sub-ledger. It cross-foots against its stock account — 304 unless the article's вид says 302, 303 or 307 — every costing path reads it, and its value is the sum of the movements that produced it. A call that assigns to it breaks that sum silently — the books say one thing, the count says another, and nothing on either side records which write disagreed.

So stock moves the way it moves in the app: a document.

curl -X POST https://app.autonify.bg/api/v1/stock/transfers \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: wms-move-4471" \
  -H "Content-Type: application/json" \
  -d '{
    "from_warehouse_id": "01k…",
    "to_warehouse_id": "01k…",
    "moved_on": "2026-06-05",
    "lines": [ { "sku": "CUP-1", "quantity": "8" } ]
  }'

Both warehouses must be this company's and must differ; up to 200 lines, each quantity greater than zero. Two lines of one article on one document are summed by the service, not written twice. Answers 201:

{ "data": { "document_number": "ПРХ-000004",
            "from_warehouse_id": "01k…", "to_warehouse_id": "01k…",
            "moved_on": "2026-06-05",
            "lines": [ { "sku": "CUP-1", "quantity": "8" } ] } }

A transfer changes where the goods are and nothing else: same quantity, same average cost, no journal entry. A correction is the transfer back, which is the operation that actually happened.

  • 409 period_locked — the period is closed.
  • 409 transfer_refused — a fact about the stock at this instant: not enough at the source, an unknown SKU, a unit that will not convert. details.reason names which.

No stock document may be dated after today, today being the day in Bulgaria (Europe/Sofia), not UTC: a transfer, an adjustment, a count or a conversion with a later date is refused as 409 transfer_refused, adjustment_refused, count_refused or conversion_refused with details.reason ui.items.date_in_future, and nothing is written. A count dated next week used to move that place's count mark into next week, after which every snapshot until then was refused as older than a count nobody had taken yet. Documents a connected till delivers through the store webhook are not refused on this ground — the till's own clock is the shop's business.

Корекция / брак

POST /stock/adjustments writes signed deltas off, each with a reason.

curl -X POST https://app.autonify.bg/api/v1/stock/adjustments \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: wms-writeoff-8891" \
  -H "Content-Type: application/json" \
  -d '{
    "adjusted_on": "2026-06-20",
    "warehouse_id": "01k…",
    "notes": "Счупени при разтоварване",
    "lines": [ { "sku": "CUP-1", "quantity_delta": "-3", "reason": "scrap" } ]
  }'

adjusted_on and lines are required; warehouse_id falls back to the company's default place — a single-warehouse merchant is never asked a question with one answer — and notes is free text. Up to 200 lines, each with a non-zero quantity_delta of at most three decimals, which is the sub-ledger's own precision.

The reason is required, and the taxonomy is closed:

reason What it says happened SAF-T
scrap брак — damaged, spoiled, destroyed 160
shortage липса — missing, and nobody can say where it went 120
surplus излишък — more on the shelf than the books hold 110
own_use лично ползване — taken out of the business by its owner 180
donation дарение — given away 150
za_smetka_na_mol за сметка на МОЛ — a липса somebody is answerable for 120

The sign decides the ledger legs and cannot carry what the reason carries: the SAF-T entry (a брак filed as «други движения» is a false statement to НАП) and the ЗДДС чл. 79 consequence, which turns on the cause and never on the direction. A free-text reason would be neither mappable nor searchable, so an unknown one is a 422 no retry fixes. surplus is the only reason that may carry a positive delta, and any other one fighting its own sign is refused.

Answers 201 with the document: its number (КОР-…), its net effect on the articles' stock accounts — 304 unless an article's вид says 302, 303 or 307 — as money, and per line the book quantity, the delta, the reason and the movement_type a SAF-T reader will see — returned because an integrator reconciling a filed стоков файл has no other way to learn it.

One field is deliberately not on this wire: the продажна цена a начет may be raised at (ЗЗД чл. 82 / КТ чл. 203) is a browser-only field, so a za_smetka_na_mol line sent here is charged at what the goods carried and nothing is credited to 709.

  • 409 adjustment_refused — a fact about the stock at this instant: deeper than that place holds, an unknown SKU, a reason that fights its sign. details.reason names which.
  • 409 period_locked — refused, never clamped. The caller chose the date, and moving the document into a month they did not name would file a ДДС период that disagrees with the one already sent.

Инвентаризация

POST /stock/counts states what is on one place's shelves on one day.

curl -X POST https://app.autonify.bg/api/v1/stock/counts \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: wms-count-2026-06-20" \
  -H "Content-Type: application/json" \
  -d '{
    "counted_on": "2026-06-20",
    "warehouse_id": "01k…",
    "lines": [ { "sku": "CUP-1", "quantity_on_hand": "17" } ]
  }'

This is the call that looks like the set-quantity API and is the opposite of one. Nothing is assigned. The payload states what is on the shelf, and the DIFFERENCE against that place's books becomes a correction with a reason (shortage or surplus), a value at the weighted average, a journal entry and a SAF-T code — so the sub-ledger still equals the sum of its movements. A line that agrees moves nothing and still comes back on the опис, with a quantity_delta of "0.000" and no reason: classifying it anyway would put a липса on every article a merchant ever counted correctly. Up to 500 lines.

Zero is a legitimate answer — "the shelf is empty" is exactly what a count of a sold-out article says. A SKU the payload omits is unanswered, not zero. The sub-ledger is per company and a count is per place, so silence means "not counted here"; zeroing on silence would wipe every other location's stock the moment one shop counted, and it is what lets you send a partial sheet honestly.

The difference is taken against the books ON counted_on, not today's: the place's balance less everything that moved there after the end of that day (in Bulgaria). A year-end count dated 31 December and sent on 5 January books December's difference and nothing that happened since — a place that held 100 on 31.12, sold 30 and received 50 in January, and counted 98, gets a shortage of 2 dated 31.12 and ends at 118. book_quantity on each line is that same figure, the book on the count date. Movements dated on the count day itself are inside the book. Only the quantity is taken as of the date; the shortage or surplus is valued at the article's current weighted average, as every correction is.

  • 409 count_refused, details.reason ui.items.count_stale — a snapshot older than the last count of that place, whether that count came from this endpoint, the browser or a connected till. It is the one refusal here that reads like a bug and is not: the later count already settled those shelves, and an older snapshot applied on top of it would undo that settlement. The message names the day that place was last counted.
  • 409 count_refused, details.reason ui.items.count_short_since — the shortage found on the count date is larger than what the place holds today: more has been issued since than the count says was there.
  • 409 count_refused, details.reason ui.items.date_in_future — counted_on is after today.
  • 409 count_refused also covers the ordinary stock facts, and 409 period_locked the filed month.

Answers 201 with the same document shape the adjustment returns, numbered ИНВ-…, carrying every line you sent — the ones that moved and the ones that agreed — with counted_quantity beside book_quantity.

Преработка

POST /stock/conversions consumes articles and produces others, splitting one carrying amount between them.

curl -X POST https://app.autonify.bg/api/v1/stock/conversions \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: wms-kit-4471" \
  -H "Content-Type: application/json" \
  -d '{
    "direction": "disassemble",
    "warehouse_id": "01k…",
    "converted_on": "2026-06-20",
    "allocation_method": "sales_value",
    "inputs":  [ { "sku": "KIT-1",  "quantity": "2" } ],
    "outputs": [ { "sku": "PART-A", "quantity": "2", "sale_value": "30.00" },
                 { "sku": "PART-B", "quantity": "2", "sale_value": "10.00" } ]
  }'

Required: direction (disassemble | assemble), warehouse_id, converted_on, and at least one inputs[] and one outputs[] — up to 200 lines on each side — every line with a sku and a quantity above zero.

Optional on the document: allocation_method, residual_method, item_composition_id (a рецепта of this company's), input_account_code, output_account_code, scrap_account_code, notes, and up to 20 costs[] — разходи за преработка absorbed per СС 2 т. 6.1, each with a basis (actual | normal_capacity), an account_code, an amount and, for the second basis, a normal_capacity. Per output line: sale_value, fixed_share, manual_value, is_by_product, nrv. Per input line: abnormal_loss — the part of what was consumed that was lost beyond нормалните граници (СС 2 т. 7.2 „а"), which never reaches the surviving articles.

allocation_method is the basis the input value is split by — sales_value (the default), quantity, fixed_share, by_product or manual. On a разкомплектоване it is a judgement, not an arithmetic detail. residual_method says how the remainder is split once the by-products are deducted, and takes the same four proportional bases — never by_product itself, because "take the by-products out again" is not an instruction for what is left.

manual is refused when the figures do not meet the total, and that refusal is the reason this endpoint could not simply be "post the numbers you already have". Ten and ten typed against a carrying amount of a hundred books ninety and ten: the document's total comes out right, every per-article cost is wrong, and every future COGS of both articles is poisoned by it. 409 conversion_refused, with details.reason ui.items.conv_manual_off_total.

Answers 201 with the протокол — its number (РАЗК-… for a разкомплектоване, КОМП-… for a комплектоване), the carrying amount, the by-product value, the absorbed and unabsorbed cost, the abnormal loss, and one line per article on each side carrying a role of input or output, its quantity, its unit_cost, its allocated value, and is_by_product / abnormal_loss_quantity where they apply. Σ of the outputs' value equals total_value to the cent, and so does Σ of the inputs less the abnormal loss plus the absorbed cost: the СС 2 cross-foot, on the wire rather than only in the протокол. value is the exact figure and unit_cost is derived from it, so foot the document on value.

  • 409 conversion_refused — anything the service or the ledger refuses: not enough of an input at that place, an unknown SKU (an output has to be an article the books already know), an abnormal loss bigger than its own line, a cost line whose account_code is not an active class-6 account of this company's own chart, a normal_capacity basis with no positive capacity or on a document producing more than one article — there is no single rate to absorb against — and a chart that will not take the entry. details.reason is present when the refusal has a name. An article whose вид the document's input_account_code or output_account_code contradicts — a 302 flour sent in on 304 — is refused as well, with details.reason ui.items.conv_class_mismatch: name the article's own account, or give it a document of its own. An article with no вид is not checked.
  • 409 period_locked — the month is filed.

Unlike a transfer, a conversion posts — and a plain one posts nothing, because what leaves the inputs is exactly what lands on the outputs. The entry appears when the document carries something that is not a reclassification: absorbed разходи за преработка arriving in stock, and абнормен брак leaving it for the scrap account, each booked where СС 2 puts it. A correction is the inverse document, which the app writes; there is no conversion-reversal endpoint here.

Goods come in through POST /purchases with lines[].product_code, and out through a sale. Neither needs a stock endpoint.

Производство — production orders

A production order is how own production is costed. It is a batch (kind: "batch"), made by recipe — its product shares one article and one weighted average with every other batch of it — or a job (kind: "job"), made once for one customer, which gets an article of its own (СС 2 т. 9.1) so that the invoice for it takes off exactly its cost. The order's cost builds up on account 306 Незавършено производство through numbered documents and leaves it at the output protocol as finished goods on 303 — or a semi-finished good on 307 — at actual cost, into the ordinary weighted average.

Every article carries a вид — the stock account its value is kept on: 302 материал, 303 продукция, 304 стока, 307 полуфабрикат. It is set in the app (Артикули → Наличности), and a supplier document that founds an article stamps the account its lines were booked to. An article with no вид is kept on 304, exactly as before the вид existed. Production never guesses one: a requisition of an article with no вид is refused.

Six documents move an order, each in its own gap-free series. The API writes three of them; the rest, and the rates they are costed at, are set in the app:

Document Number Here What it posts
Материално искане ИСК-… POST …/issues Per article, at its weighted average now: a purchased one (вид 302 or 304) Дт 601 / Кт its вид and Дт 306 / Кт 616; an own one (303 or 307) Дт 306 / Кт its вид
Връщане на материали ВРМ-… app The mirror, at the order's own issue cost
Отчет за вложен труд ТРД-… POST …/labour Hours × the labour rate in force on the date, and the overhead absorbed on them: Дт 306 / Кт 616
Отнасяне на преки разходи ПРР-… app A cost already booked by nature (a subcontractor's invoice): Дт 306 / Кт 616
Протокол за произведена продукция ПРП-… POST …/completions Дт the product's вид its cost, Дт each by-product's вид its value at NRV, Дт 616 the loss beyond the norm / Кт 306 the whole work in progress
Корекция при приключване КПР-… app (the month close) Over-absorbed overhead and labour taken back out of open work in progress: Дт 616 / Кт 306

616 Капитализирани производствени разходи (or the group-61 account the company chose instead) is the one corrective account everything capitalised meets, so 601, 604 and 605 stay whole in the by-nature income statement. No production entry touches a VAT account, 611 or 613: an internal production is not a supply (ЗДДС чл. 25, ал. 2), so a filed ДДС month alone refuses nothing here — a books-locked one does. Returns, direct costs, reversals, the labour and overhead rates and the month close stay in the app: each is a judgement an accountant makes looking at the order, not a fact a shop-floor system reports.

GET /stock/production-orders lists the orders, oldest first, cursor-paged like every list. ?status= is draft, in_progress, completed or cancelled; ?kind= is batch or job; ?updated_since= matches an order whose own row changed or that received a document since then — a labour report moves an order's work in progress without touching the order, and syncing on the row alone would leave your copy of wip stale.

{ "data": [ {
  "id": "01k…",
  "number": "ПОР-000001",
  "kind": "batch",
  "status": "in_progress",
  "product": { "sku": "BREAD-W", "name": "Хляб бял 600 г", "class": "303", "unit": null },
  "planned_quantity": "200.000",
  "produced_quantity": null,
  "planned_hours": "8.00",
  "warehouse_id": "01k…",
  "recipe_id": "01k…",
  "counterparty_id": null,
  "customer_reference": null,
  "agreed_price": null,
  "planned_start": null,
  "planned_end": null,
  "completed_on": null,
  "wip": { "amount": "255.40", "currency": "EUR" },
  "total_cost": null,
  "unit_cost": null,
  "created_at": "2026-11-16T10:00:00+00:00"
} ], "meta": { "next_cursor": null, "limit": 50 } }

number is the order as it is printed — the prefix is the document's name and the digits its number. product.class is the вид the output is received on. wip is never stored: it is the order's opening work in progress plus the sum of its documents' wip_delta, and 0.00 once the order is completed. total_cost and unit_cost are set by the protocol; unit_cost keeps the four decimals the books carry, like every unit cost and rate in this section.

GET /stock/production-orders/{id} adds three things. materials: per article the recipe planned (and any the order used without one), the planned, issued, returned and net quantity, the variance, the tolerated loss in per cent, the net value at the order's own issue cost, and over_tolerance — used beyond the norm and its tolerance. cost_card: the калкулационна карта the app and its PDF print — opening, materials, labour (with its hours), overhead variable and fixed, direct costs, month-close corrections, loss beyond the norm, by-products, output, work in progress, the product's cost and unit cost, and for a job the agreed price and the margin once its output is received. And documents, every one, reversals and month-close corrections included:

{ "id": "01k…", "kind": "issue", "number": "ИСК-000001", "document_on": "2026-11-16",
  "warehouse_id": "01k…", "labour_hours": null, "labour_rate": null,
  "materials_value": { "amount": "95.40", "currency": "EUR" },
  "labour_value": { "amount": "0.00", "currency": "EUR" },
  "overhead_variable_value": { "amount": "0.00", "currency": "EUR" },
  "overhead_fixed_value": { "amount": "0.00", "currency": "EUR" },
  "direct_value": { "amount": "0.00", "currency": "EUR" },
  "abnormal_value": { "amount": "0.00", "currency": "EUR" },
  "by_product_value": { "amount": "0.00", "currency": "EUR" },
  "output_value": { "amount": "0.00", "currency": "EUR" },
  "output_quantity": null,
  "wip_delta": { "amount": "95.40", "currency": "EUR" },
  "reverses_document_id": null, "journal_entry_number": 41, "notes": null,
  "lines": [ { "role": "input", "sku": "FLOUR", "stock_account_code": "302",
               "quantity": "103.000",
               "unit_cost": { "amount": "0.8000", "currency": "EUR" },
               "value": { "amount": "82.40", "currency": "EUR" },
               "nrv": null, "account_code": null, "purchase_document_id": null,
               "description": null } ] }

A document's arithmetic is in its row: wip_delta = materials + labour + overhead (both parts) + direct − abnormal − by-products − output. A reversal (made in the app) negates every figure of the document it reverses, so the sum of wip_delta over an order is its work in progress with no special case; its lines are positive copies of the original's, and their sign is the document's reverses_document_id. A line's role is input, output, by_product, abnormal or cost (a direct cost: account_code and an amount, no article). journal_entry_number is the entry the document posted, as the journal numbers it.

POST /stock/production-orders makes an order: kind, planned_quantity (above zero, at most three decimals) and warehouse_id — the place its materials come from and its output goes to — plus planned_start, planned_end and notes. A batch names recipe_id, one of the company's рецепти — its product, its вид, the planned hours and the materials scaled to the quantity come from it — or, without a recipe, product_sku, product_name and product_class (303, the default, or 307). A job names product_name and optionally product_code, counterparty_id, customer_reference (a number, not a name) and agreed_price (net). Leave product_code out and the job takes the order's own number — ПОР-000007 — which only the server can know. A job's code must be its own: an article, a catalogue row or another live order holding it is refused (ui.production.error.job_code_taken). Its income catalogue row is made by its first protocol with output, not by the order, so it cannot be invoiced before its article exists. A field of the other kind — a customer on a batch, a recipe on a job, a product_sku beside a recipe — is 422 validation_failed, never dropped in silence. An order started before the books moved here, with work in progress already in 306's opening balance, is entered in the app. Answers 201 with the order as GET …/{id} answers it.

POST …/{id}/issues — document_on, warehouse_id and up to 200 lines, each a sku and a quantity above zero, at most three decimals; notes is free text. POST …/{id}/labour — document_on, hours (0.01 to 10 000, two decimals) and an optional description. The rate is the one set in the app for that date, stamped on the report — a later rate never moves it. POST …/{id}/completions — document_on, warehouse_id, the quantity made, and optionally abnormal — up to 200 lines of sku and quantity, the loss beyond the norm of that input, valued at the order's own issue cost — and by_products — up to 20 lines of sku, name, quantity, nrv (per unit) and stock_account_code (302, 303 — the default — or 304). without_output: true closes the order with nothing made: the whole work in progress becomes a cost of the period, so a quantity above zero or abnormal lines beside it are 422 validation_failed. Each answers 201 with the document.

The API declares no abnormal loss you did not send. The app's protocol dialog pre-fills what the order used beyond the recipe's norm and tolerance; here, what is not in abnormal is not declared, and the product takes the whole work in progress. When a protocol does carry such a loss, meta.notice holds the ЗДДС чл. 79 sentence the app shows beside it — a loss beyond the norms of the technological documentation may require a correction of the input VAT once claimed; ask the accountant whether a протокол is needed. Nothing is issued for it here.

Example A — a bakery's batch of 200 loaves. Rates from the app: 12.0000 an hour of labour; overhead on hours worked, 3.0000 an hour variable and a fixed 2,000.00 a month on a normal 400 hours (5.0000). FLOUR, YEAST and SALT are materials (вид 302) at 0.8000, 6.0000 and 0.5000; the recipe BREAD-W makes 100 with 50 FLOUR (2 % tolerated), 1 YEAST, 1 SALT and 4 hours.

curl -X POST https://app.autonify.bg/api/v1/stock/production-orders \
  -H "Authorization: Bearer $AUTONIFY_KEY" -H "Idempotency-Key: mes-bread-1116" \
  -H "Content-Type: application/json" \
  -d '{ "kind": "batch", "recipe_id": "01k…", "planned_quantity": "200", "warehouse_id": "01k…" }'

curl -X POST https://app.autonify.bg/api/v1/stock/production-orders/01k…/issues \
  -H "Authorization: Bearer $AUTONIFY_KEY" -H "Idempotency-Key: mes-bread-1116-isk" \
  -H "Content-Type: application/json" \
  -d '{ "document_on": "2026-11-16", "warehouse_id": "01k…",
        "lines": [ { "sku": "FLOUR", "quantity": "103" }, { "sku": "YEAST", "quantity": "2" },
                   { "sku": "SALT", "quantity": "2" } ] }'

curl -X POST https://app.autonify.bg/api/v1/stock/production-orders/01k…/labour \
  -H "Authorization: Bearer $AUTONIFY_KEY" -H "Idempotency-Key: mes-bread-1116-trd" \
  -H "Content-Type: application/json" \
  -d '{ "document_on": "2026-11-16", "hours": "8" }'

curl -X POST https://app.autonify.bg/api/v1/stock/production-orders/01k…/completions \
  -H "Authorization: Bearer $AUTONIFY_KEY" -H "Idempotency-Key: mes-bread-1116-prp" \
  -H "Content-Type: application/json" \
  -d '{ "document_on": "2026-11-16", "warehouse_id": "01k…", "quantity": "200",
        "abnormal": [ { "sku": "FLOUR", "quantity": "1" } ] }'
Answer Figures Entry
ПОР-000001 planned FLOUR 100, YEAST 2, SALT 2; 8 hours none
ИСК-000001 82.40 + 12.00 + 1.00 = 95.40 Дт 306 95.40 · Дт 601 95.40 · Кт 302 95.40 · Кт 616 95.40
ТРД-000001 96.00 labour + 24.00 variable + 40.00 fixed Дт 306 160.00 · Кт 616 160.00
ПРП-000001 FLOUR allowed 100 × 1.02 = 102, used 103: 1 kg × 0.8000 = 0.80 beyond the norm; product 255.40 − 0.80 = 254.60, a unit 1.2730 Дт 303 254.60 · Дт 616 0.80 · Кт 306 255.40

The order is then completed with wip 0.00, and BREAD-W holds 200 on 303 at 1.2730 — sold the next day, its cost of sales is credited to 303, not 304. Without the abnormal line the product takes all 255.40 (a unit 1.2770).

  • 409 production_refused — the service or the ledger refused, and nothing was written: no movement, no entry, no number — the series stays gap-free. details.reason names the refusal and message says it in the language of the person the key belongs to, in the words the app uses. Among them: ui.production.error.class_missing (an article with no вид), not_enough_here (that place holds less), unknown_sku, order_closed (a completed or cancelled order), no_rate (no labour rate on that date), loss_over_issued (more loss than the order used), output_required (a quantity of 0 without without_output), completion_before_documents, by_product_too_dear and negative_cost (by-products or loss would take the whole cost), no_cost (output with nothing left to cost it — nothing charged to the order yet, or all of it declared as loss; close it with without_output instead), product_class_mismatch and product_unclassified_stock (the product's article is kept on another вид, or holds stock with none), job_code_taken, saft_filed (the month's SAF-T file is submitted) — each under ui.production.error. — and ui.items.date_in_future (after today in Bulgaria) and ui.production.chart_conflict (the chart holds another account under 306 or under the capitalisation account). A ledger that will not take the entry has its own message and no details.
  • 409 period_locked — the month is closed for the books.
  • 404 not_found — no such order on this company.
  • 422 validation_failed — the body does not match, in the ordinary envelope with the field errors in details (not the framework's shape).

The books

Read-only, and only ever read-only. There is no endpoint here that posts an entry and there must not be: the ledger has one write seam, the balance invariant is a database constraint, and a posted entry is only ever changed by another one. An API that could post would be a second door into all three.

GET /books/trial-balance?from=&to= — the оборотна ведомост. Both dates are required and to may not precede from.

{ "data": [ {
  "code": "702", "name": "Приходи от продажби на продукция",
  "name_en": "Revenue from sales of products", "class": 7, "type": "revenue",
  "opening": { "amount": "0.00",    "currency": "EUR" },
  "debit":   { "amount": "0.00",    "currency": "EUR" },
  "credit":  { "amount": "100.00",  "currency": "EUR" },
  "closing": { "amount": "-100.00", "currency": "EUR" }
} ],
  "meta": { "from": "2026-06-01", "to": "2026-06-30", "count": 12,
            "totals": { "opening": {…}, "debit": {…}, "credit": {…}, "closing": {…} } } }

Six figures per account, because that is what a Bulgarian ведомост is: начално салдо, обороти за периода, крайно салдо. A file carrying only the middle pair cannot be tied back to the previous period's closing balances, and an account that carries a balance but saw no movement in the window would vanish from it entirely.

Both saldo figures are signed, debit-positive: "-1234.56" on a payable means 1234.56 credit. The browser splits them into Дт and Кт columns because that is how the ведомост is read and filed on paper; a JSON reader wants one number with a sign.

Every figure is money, in EUR — the books' functional currency — including the negative ones.

GET /books/journal?from=&to= — the journal behind it, cursor-paged.

{ "data": [ {
  "id": "01k…",
  "entry_id": "01k…", "entry_number": "2026-000123",
  "entry_date": "2026-06-10", "entry_status": "posted",
  "description": "Фактура 0000000042",
  "account_code": "411", "account_name": "Клиенти", "account_name_en": "Trade receivables",
  "debit":  { "amount": "120.00", "currency": "EUR" },
  "credit": { "amount": "0.00",   "currency": "EUR" },
  "original": null,
  "analytics": { "cost_center": null, "project": null, "dimension_value": null },
  "reclass_of_line_id": null
} ],
  "meta": { "next_cursor": "01k…", "limit": 50, "from": "2026-06-01", "to": "2026-06-30" } }

One row is one line, not one entry. A caller reconciling against their own ledger matches on account code and amount, and nesting lines inside entries would make a page boundary fall in the middle of a double entry. entry_id and entry_number are on every row, so regrouping is a one-liner for anyone who wants entries back.

Posted and reversed entries only — a draft is not in the books. original carries the original-currency trail on an FX posting and is null when the line was always in EUR. updated_since is accepted for symmetry, but a posted line is immutable by database trigger: it will only ever surface a reversal's own new lines, never an edit to an old one, because there are none.

analytics (since 2026-11-16) is the cost centre, project and value of the company's own dimension the line carries — codes, each null when the line has none — on every line, whatever the plan: they are the company's own books. A posted line never changes, so a corrected analytic arrives as an entry of its own, its lines described „Прекласифициране: …": a pair of lines on the same account, one taking the amount off the old tags and one putting it on the new, each with reclass_of_line_id naming the line it corrects (null on every other line). Summing by analytic, add them in — that is what the app's reports do; reconciling operations, leave them out. See „Cost centres, projects and budgets" below.

Cost centres, projects and budgets

Since 2026-11-16. A company can keep cost centres (up to three levels — a workshop, its lines), projects (with a client and dates) and one dimension of its own („Обект", „Регион" — whatever it names it), and tag the revenue and cost lines of its books with them. This is how an integration keeps that catalogue, tags the documents it sends, and reads revenue and costs by analytic and the company's budgets. There is no endpoint that re-tags posted lines, and no webhook: a correction of analytics is an entry a person dates in the app (/books/retag), and the reads below serve a BI tool on its own schedule.

Codes are the identifiers — in paths and in bodies, never an id. A code is 1–20 letters (any script), digits, ., _ or -, starting with a letter or a digit; unique per kind ignoring case (ЦЕХ1 and цех1 are one code), archived items included; and locked once anything uses it — a line of the books, a document, a bank rule, a department, a budget line, a project's default — because people quote codes in files and integrations keep them. In a path it is percent-encoded (PATCH /books/cost-centers/%D0%A6%D0%95%D0%A51), and every lookup ignores case.

The plan. Cost centres, projects and budgets are part of „Разширени анализи" (advanced_analytics: Micro and up, every practice plan, the NGO plan). Without it a catalogue write, GET /books/by-analytics and every budget read answer 403 analytics_not_in_plan, as does an analytics object that changes a document's tags. The catalogue reads and the journal's tags still answer — they are the company's own data. A practice's own plan counts on a client's company, as in the app.

The catalogue

GET /books/cost-centers — every cost centre, archived ones included, parents before their sub-centres (each level by code), so a mirror creates a parent before its children. Not paginated: at most 300 are in use. ?archived=true|false narrows it.

{ "data": [
  { "code": "ЦЕХ1",   "name": "Цех 1",   "parent": null,   "archived": false },
  { "code": "ЦЕХ1-А", "name": "Линия А", "parent": "ЦЕХ1", "archived": false }
], "meta": { "count": 2 } }

POST /books/cost-centers — code, name and optionally parent (a code) → 201 with the cost centre. PATCH /books/cost-centers/{code} — code, name, parent (a code, or null for the top level) and archived; what you do not send keeps its value. "archived": true takes the centre's active sub-centres along and names them in meta.archived_along; "archived": false restores it (its parent must be in use).

GET /books/projects — cursor-paged, with ?archived=true|false and the usual ?cursor=, ?limit=, ?updated_since=:

{ "data": [ {
  "code": "П-17", "name": "Обект Лозенец",
  "client": { "id": "01k…", "name": "Инвеститор ООД" },
  "starts_on": "2026-03-01", "ends_on": "2026-11-30",
  "default_cost_center": "ЦЕХ1", "description": null, "archived": false
} ], "meta": { "next_cursor": null, "limit": 50 } }

POST /books/projects — code, name, and optionally client_id (a counterparty id from GET /counterparties), starts_on and ends_on (YYYY-MM-DD, the end not before the start), default_cost_center (a code — the cost centre the app's forms suggest when the project is picked; a document you send is never given one it did not name) and description (up to 2,000 characters). PATCH /books/projects/{code} takes any of them, and archived.

GET /books/dimension — the company's own dimension with its values, or {"data": null} while it has not named one. Naming it is done in the app — it names a column on every page — and until then POST /books/dimension/values answers 409 analytic_dimension_missing.

{ "data": { "name": "Обект", "archived": false,
            "values": [ { "code": "Р-СЕВЕР", "name": "Север", "archived": false } ] },
  "meta": { "count": 1 } }

POST /books/dimension/values — code and name; PATCH /books/dimension/values/{code} — code, name, archived.

There is no DELETE: deleting is for an item nothing names, and a person does it in the app; an integration archives. The rules are the app's own — names up to 120 characters (a project's 160), at most 300 cost centres, 1,000 projects and 300 values in use, cost centres three levels deep — and a refusal is one of:

  • 422 validation_failed — a code's shape, a name's length, the dates the wrong way round, a client_id that is not this company's counterparty; details names the field with the sentence the app shows, in the key holder's language.
  • 409 analytic_code_taken — another item of the kind has that code, archived ones included.
  • 409 analytic_in_use — a code something already uses (details.field: code; the name still changes), or an archive refused because something that will post later names the item, or a sub-centre it would take along. details.references lists them: {"kind": "department", "name": "Цех"}, the kinds being bank_rule, journal_template, recurring_invoice, department, project_default and draft_document (with number).
  • 422 unknown_analytic / 422 analytic_archived — a parent or default_cost_center no cost centre has, or one that is archived (details.field, details.code).
  • 409 analytic_refused — details.reason says which rule: parent_cycle (a centre under itself or its own sub-centre), parent_depth (details.max: 3), limit (details.max), restore_parent (restore the parent first).
  • 409 analytic_dimension_missing — above.

Tags on documents

POST /purchases (JSON), PATCH /purchases/{id}/fields and POST /sales/invoices take an analytics object:

"analytics": { "cost_center": "ЦЕХ1", "project": "П-17", "dimension_value": null }
  • On a supplier document the tags go on the cost lines when it posts — never on the ДДС line or the payable; on a sales document, on the revenue lines — never on the receivable or the ДДС.
  • Each key is optional. A kind the object names is set, null clears it, a kind it leaves out stays as it is, and an absent object leaves the document's tags alone. A credit note that names none takes its invoice's; a proforma keeps them for the invoice it becomes.
  • Any other key in the object is a 422: cost_center_id with an id in it would otherwise be dropped without a word.
  • 422 unknown_analytic — no item of the company has that code; 422 analytic_archived — the item is archived, and the document does not already hold it. Both carry details.field (e.g. analytics.project) and details.code. Both are about the catalogue, not your bytes: create or restore the item and the same request under the same Idempotency-Key goes through (§3).
  • 403 analytics_not_in_plan — the object changes the document's tags on a plan without them. Sending back what the document holds is no change, and passes on any plan.
  • A posted document is not re-tagged through the API. Its tags are in the books, and moving them is a correcting entry a person dates in the app („Смени аналитичността" on the document, or /books/retag). analytics that change a posted purchase's tags in PATCH /purchases/{id}/fields are 409 analytics_on_posted_document; without them the answer is the usual 409 document_posted.

The full purchase and sales documents — GET /purchases/{id}, GET /sales/invoices/{id} and what the writes answer — carry the document's analytics in the same shape, codes or null; the lists do not.

Revenue and costs by analytic

GET /books/by-analytics?kind=cost_center|project|value&from=YYYY-MM&to=YYYY-MM — all three required, to not before from, at most 24 months. One object per item with activity in those months, the largest result first, then the lines without that analytic (code: null):

{ "data": [
  { "code": "ЦЕХ1", "name": "Цех 1",
    "revenue": { "amount": "500.00", "currency": "EUR" },
    "costs":   { "amount": "100.00", "currency": "EUR" },
    "result":  { "amount": "400.00", "currency": "EUR" } },
  { "code": null, "name": null,
    "revenue": { "amount": "0.00",   "currency": "EUR" },
    "costs":   { "amount": "30.00",  "currency": "EUR" },
    "result":  { "amount": "-30.00", "currency": "EUR" } }
], "meta": { "kind": "cost_center", "from": "2026-10", "to": "2026-10", "count": 2 } }

Revenue is class 7 and costs class 6, both positive. Posted and reversed entries count (a reversal cancels its entry), the year-end closing sweep does not, and corrections of analytics do. The untagged object may be negative after an untagged correction of a tagged line.

Budgets

Read only: a budget is built, approved and versioned in the app.

GET /books/budgets?year= — newest year first, a year's approved budget before its drafts:

{ "data": [ {
  "id": "01k…", "year": 2026, "name": "Бюджет 2026", "status": "approved",
  "split": { "cost_center": true, "project": false, "dimension": false },
  "approved_at": "2026-01-12T10:02:11+02:00",
  "totals": { "revenue":  { "amount": "450.00", "currency": "EUR" },
              "expenses": { "amount": "80.00",  "currency": "EUR" },
              "result":   { "amount": "370.00", "currency": "EUR" } }
} ], "meta": { "count": 1 } }

status is draft, approved (one a year) or superseded; split says which analytics its lines are kept by. GET /books/budgets/{id} adds notes and lines, each {"account", "cost_center", "project", "dimension_value", "months", "total", "note"}: an account or group of class 6 or 7, the codes of its analytics (null is the untagged share of a kind the budget is split by), twelve amounts January first and their sum — in euro, before VAT.

GET /books/budgets/{id}/vs-actual?mode=month|ytd|year&month=1..12&running=0|1 — the budget against the books.

  • mode: month compares that month; ytd January to month (the default); year the whole year's budget against the actuals so far — what is left.
  • month: by default the last whole month of the budget's year so far (December of a year that is over or has not begun).
  • running=1 includes the month still running, which is otherwise never compared; meta.running_month names it.
{ "data": {
  "revenue":  { "rows": [ … ], "unbudgeted": [ … ], "totals": { … } },
  "expenses": {
    "rows": [ { "account": "602", "account_name": "Разходи за външни услуги",
                "account_name_en": "External services",
                "cost_center": "ЦЕХ1", "project": null, "dimension_value": null,
                "budget":   { "amount": "80.00",  "currency": "EUR" },
                "actual":   { "amount": "100.00", "currency": "EUR" },
                "variance": { "amount": "20.00",  "currency": "EUR" },
                "share": "125.0", "state": "over", "note": null } ],
    "unbudgeted": [ … ],
    "totals": { "budget": { … }, "actual": { … }, "variance": { … }, "share": "125.0", "state": "over" } },
  "result":   { "budget": { … }, "actual": { … }, "variance": { … } },
  "untagged": { "cost_center": { "amount": "30.00", "currency": "EUR" } }
}, "meta": { "budget_id": "01k…", "year": 2026, "status": "approved", "mode": "month",
             "month": 10, "running": false, "months": ["2026-10"],
             "actual_months": ["2026-10"], "running_month": null } }

Each actual goes to the one line that covers it — its account or a group above it, the line's cost centre or one of its sub-centres, the same project and value — the most specific one when two do; an actual no line covers is in unbudgeted. variance is actual − budget; state is over / under for costs, above / below for revenue and on when they are equal; share is actual ÷ budget in percent to one place, null when nothing was budgeted. untagged is, per kind the budget is split by, the costs of the compared months that carry no such tag — what the app's /books/retag can still put right.

Master data

GET /counterparties (?search=) and POST /counterparties. The create is matched on EIK first, so importing the same customer list twice does not double every counterparty in the books:

{ "data": { "id": "01k…", "name": "Клиент ЕООД", "created": false } }

201 when it created one, 200 with created: false when it updated the match. Required: name. Optional: eik, vat_number, address, country (2 letters), email, iban, kind (client | supplier, default client).

PATCH /counterparties/{id} corrects one, and it means PATCH: what you do not send keeps the value it has. The conditional integrity rules are applied to the merged row rather than to your request alone — a company still needs an ЕИК and an individual still needs an identifier, whether or not this particular request mentioned kind. Accepts role (client | supplier), kind (company | individual), country, name, name_latin, eik, personal_identifier, vat_number, legal_form, mol_name, address, email, phone, and answers the full counterparty.

kind means two different things across those two routes, and it is worth naming before it costs you an afternoon. On the create it is client | supplier — what the counterparty is to you; it lands on the is_client / is_supplier flags you read back, and the row itself is stored as a company. On the PATCH it is company | individual — what the counterparty is — while the relationship travels as role. A row created through this API PATCHes cleanly without either field; send kind on the PATCH only when you mean to reclassify the legal shape. One caveat: address is optional on the create but required by the merged-row rules — a row created without one must supply it on its first PATCH, and the 422 names it.

  • A role is only ever added, exactly as in the browser: a supplier who starts buying is both, and a document already posted against the old role must not be orphaned by a script narrowing it.
  • 422 validation_failed, with the field errors in details.
  • No delete and no merge, deliberately. Both destroy a row that documents point at, and a merge in particular picks a survivor — not a thing a script can be trusted to get right at three in the morning.
  • registry_verified is always false through this API and is not writable. It is a claim about the Commercial Register, not a field (§7).

GET /counterparties/{id}/statement?from=&to= — извлечение, the year-end изравняване document: what was invoiced, what was paid, what is left. Both dates required. ?format=csv|pdf (default csv), ?lang=bg|en (default the key holder's own language — a statement often goes to the counterparty, who may not read Bulgarian).

Bytes, per §4. The CSV carries a UTF-8 BOM and CRLF line endings, without which Excel renders the Cyrillic as mojibake. There is no JSON form: what the service builds is a document's layout — sections, a running balance, a footer that has to add up — and publishing that as an API contract would freeze a rendering decision as an integration promise.

GET /items (?kind=income|expense) and POST /items — the catalogue an invoice line can be prefilled from. sku on the wire is the item's code; kind is its direction. On POST, vat_rate must be 20, 9 or 0 — the rates ЗДДС has, and the same three an invoice line accepts — and unit_price, when sent, must be zero or more; anything else is a 422 naming the field.

GET /chart-of-accounts — the company's own сметкоплан, both names, not paginated (a Bulgarian model chart is a few hundred rows and bounded by construction). ?active=true|false narrows it; meta.count is the total.

{ "data": [ { "id": "01k…", "code": "702", "name": "Приходи от продажби",
              "name_en": "Sales revenue", "class": 7, "type": "revenue",
              "is_active": true } ], "meta": { "count": 214 } }

Read only, and it will stay that way. A chart is editable in the app because a human doing it is looking at the consequences; a script adding or renaming an account is one exception away from a company that can no longer issue an invoice, because the posting rules name account codes.

GET /bank-accounts returns the accounts with the IBAN masked — the first four characters and the last four, everything between them starred. You are reconciling payments, not initiating them. GET /bank-transactions (?from=, ?to=) returns booked lines with amount, counterparty name and IBAN, reference (the end-to-end reference) and description.

Filings

GET /filings (?kind=, ?period=) lists what exists, with status, due_on, generated_at, submitted_at and nra_incoming_number — and whether it can be filed as it stands:

{ "id": "01k…", "kind": "d1_d6", "period": "2026-10", "status": "generated",
  "caveats": ["Т. 7 „Инициали" за Иван Петров носи само първата буква …"],
  "ready_to_submit": false, "stale": false,
  "correction_required": false, "nra_verdict_needed": false,
  "regenerated_after_submission": null, "…": "…" }
  • caveats — every box the generator could not fill or wants checked, in the words the app prints beside the downloads (Bulgarian). A payroll filing's caveats name people, so they come back only to a key with payroll:read; for any other key they are null there.
  • ready_to_submit — the generator's own verdict where it gives one (Д1/Д6 among them): true only when nothing is outstanding. null for a kind whose generator gives none. A Д1 record is ready once the person has a middle_name (т. 7 — not asked of a lnch person, since round 11c) and names in Cyrillic (т. 6–7 — names_in_filings.proposed empty, since round 11c), the company a КИД code that reaches one row of the year's ЗБДОО annex (т. 12.3) and the person a qualification group (т. 12.1) — the one recorded, else the first digit of the НКПД code, else 1 for a manager under a management contract: the group the МОД was priced on. The КИД code must be a КИД-2025 class: НАП refuses a КИД-2008 one КИД-2025 no longer has for every period from 2025. One НСИ moved whole into a single class (62.02 → 62.20, 78.30 → 78.20) is filed as that class — Д1 т. 12.2 and the ЕТЗ's т. 21 — with a caveat asking for the code to be updated; one НСИ split (56.10 → 56.11 or 56.12) is filed as it is, with a caveat naming the classes to choose from. And a Д1/Д6 package checks itself against НАП's own computation: the contributions НАП recomputes from the month's Д1 records — per record, per declared percentage, each rounded to the cent (Наредба № Н-13, ДР § 2) — must equal its Д6 columns fund by fund (the month's код 5 and код 4, and a вид осигурен 27 month's код 6); a difference is a caveat naming the month, the fund and both figures. A month computed since 2026-10-05 prices that way and never has one; one computed before, whose employer side was rounded at one combined percentage, can — until it is computed again.
  • stale — the payroll month behind a d1_d6 or prilozhenie_9 changed after it was computed. Its Д1/Д6 files answer 409 run_stale (below) until the month is computed again (POST /payroll/runs); the app's НАП submission refuses it too. Since round 6 (2026-10-06) also a month computed on a retro difference or a late correction priced before the per-box rule of 2026-10-05: computing it again prices that row anew, to НАП's box figures. Since 2026-10-13 stale is about the files still held back: those of a year — or of a year a part of which — already went to НАП are kept as they went and served as they are, and stale is true only while a year nothing of which went waits for the month to be computed again.
  • correction_required — the filing was submitted, and has since been regenerated into something different (a payroll month recomputed after its Д1/Д6 went to НАП, a ДДС month whose documents moved). What is owed is a корекционна декларация. Announced by the filing.superseded webhook. Since 2026-10-13 also a d1_d6 still generated a year of which — or a part of a year — already went to НАП: that year is kept as it went, a regeneration that says something else of it raises correction_required and filing.superseded, and the years nothing of which went are simply replaced (filing.generated).
  • nra_verdict_needed (since 2026-10-13) — a d1_d6 marked rejected after it went to НАП in more than one submission (a year each, or the parts of a year), none of which a person said НАП rejected. НАП takes each submission as a declaration of its own and may have accepted any of them, and one sent again declares everybody in it a second time. So nothing of it is taken as rejected: the filing stays rejected with its files as they went, and nothing of it is prepared again (computing the month, POST /payroll/runs, leaves it as it is) or sent again until НАП's verdict is recorded — in the app, on the payroll month's page („НАП отхвърли" beside each submission НАП rejected, or „НАП отхвърли всички" for a month it rejected whole), or, since 2026-10-17, here, on each submission НАП rejected (POST /payroll/runs/{YYYY-MM}/nra-submissions/{id}/rejected, in the payroll section below). Marked rejected by mistake — НАП accepted every submission — it goes back to submitted with its own numbers through POST /filings/{id}/transition with to: submitted (below; the app's „НАП не я е отхвърлила"), while nothing of it went to НАП since it was submitted. A d1_d6 that went in one submission is prepared and sent again whole, as before. false for every other filing.
  • regenerated_after_submission — that newer package, { "at", "files": [{ "name", "year", "sha256" }] }, or null (year as on /files). /files keeps serving what was filed: a submitted filing's artefacts never change.
  • carrier (since round 9, 2026-10-06) — each year of a d1_d6 kept for the носител (A month past its deadline, below), [] for every other filing: { "year", "file_id", "protocol_file_id", "months", "requires", "handed_in", "outstanding" }. file_id is the zip's id on /files; protocol_file_id (since round 9b) the id of its протокол of Приложение № 9 — null for a package written before it; months the months of year its records and columns are for; requires what they need — permission (НАП's or НОИ's, Н-13 чл. 9, ал. 5) and/or prescription (НОИ's предписания, чл. 4, ал. 1, т. 5). handed_in is the newest hand-in recorded (POST /filings/{id}/carrier) — { "handed_in_on", "incoming_number", "permission_number", "permission_date", "current" } — or null; current is false when it was recorded for an earlier version of the zip (the month computed again since, before the filing was submitted, and its zip changed). outstanding is true until a hand-in is recorded for the zip the filing holds now.
  • carrier_outstanding — a носител of this filing is still to be handed in. The filing is not complete, whatever status says of the files sent by electronic path: the app's calendar shows it in progress, its reminders say what is still to go, and the practice boards count it as pending.

The OSS return is kind: "oss", its period a quarter — 2026-Q3. It is generated on the 1st of every quarter for the quarter that just ended (and on request from Filings in the app), due the last day of the month after the quarter with no move off a weekend or holiday. Its file is a preparation sheet per member state and rate (…-oss-preparation.json); the return itself is submitted by a person in the NRA OSS portal, so ready_to_submit is null. Its caveats carry the sheet's two warnings, in Bulgarian: the portal's return layout is unverified, so the sheet holds figures to enter rather than a file to upload; and its rates are the ones the orders charged, to be checked against the VAT rates in force in the destination countries. An OSS filing prepared before its caveats were recorded shows [] until it is prepared again.

GET /filings/{id}/files lists the artefacts of one:

{ "data": [ { "id": "1", "name": "DEKLAR.TXT", "year": null, "part": null, "parts": null, "size": 6 } ],
  "meta": { "filing_id": "01k…", "count": 1 } }

year is the year whose data a Д1/Д6 file declares — EMPL2021.TXT and NRA62007.TXT, the annual Д6's included — and, since round 11, the year of the справка по чл. 73, ал. 6's own file, SPR73_6.xml (НАП's XML, WINDOWS-1251, put to НАП's schema dec73_6_publish.xsd when it is built, listed beside the справка's sheet on a spravka_73_6 filing; the name is НАП's and the same every year); null for every other file. A справка already filed is corrected in a filing of its own (since round 11b): a spravka_73_6 filing whose period is YYYY-N (2026-2, 2026-3, …) is the corrective file of the справка for YYYY. Its SPR73_6.xml holds only the people whose data moved since what НАП holds — the справка filed and every corrective file submitted after it — each under one код корекция: 1 (the person's whole Част II again), 8 (deleted: a person no longer in the справка, or one whose „работодател по основно трудово правоотношение" changed — a key НАП finds the data by, so the new data follows as 0 in the next file) or 0 (a person never filed). Its due_on is 30 September of the year the справка was filed (ЗДДФЛ чл. 73, ал. 9); its caveats say who is corrected, deleted or added, what moved and by when. It is prepared when the справка is prepared again after it was filed (the справка itself keeps what was filed, and its correction_required and regenerated_after_submission say a correction is owed), prepared again in place until it is submitted, and removed when nothing differs any more. One year per file: НАП's program reads the records of the first year it meets in an EMPL2021.TXT and refuses every other („Некоректна година"), and its API takes one year per submission. So a d1_d6 month that corrects a month of another year — a January carrying December's late sick leave, a raise dated back over December, a late leaver, a чл. 222 compensation for December — has a pair of files per year: the month's own pair where a month's pair has always been, then each other year's pair, ascending, under the same names (НАП requires them). Tell them apart by year, never by name. The Д6 columns are in the year of their т. 9: the tax withheld in January stays in January's NRA62007.TXT, the код 6 column of a raise for December goes to December's. File each year's pair on its own — in the portal, or as its own submission — and record the filing submitted once every year's pair has gone; the filing's caveats name which records went to which year's files. A year past 15 MB, in parts (since build round 2026-10-12): neither Наредба № Н-13 nor НАП's two file specifications limit a file, but НАП's e-service takes a file of up to 15 MB and one Д1 and one Д6 a submission. A year whose EMPL2021.TXT would be larger — about 67,000 records — is filed in parts, each its own pair under the same names, told apart by part (1, 2, …) and parts beside year on /files (both null for a year in one part and for every other file). Every record of one person is in one part. The first part holds every correction and the month's tax column (код 8); every part's NRA62007.TXT declares, column by column, the contributions НАП recomputes from its own EMPL2021.TXT, box by box (Н-13, ДР § 2) — so each part balances on its own (чл. 2, ал. 4) and the parts add up to the month's obligation to the cent (declarations обр. № 6 of a month add up — Приложение № 4, т. 7). The payment obligations are the month's, as ever. File each part as its own submission and record the filing submitted once every part has gone, with each part's number: "30Е000000301 (2026, 1/2), 30Е000000302 (2026, 2/2)".

A month past its deadline (since round 8, 2026-10-06): a correction of a month filed after 30 April of the year after it goes only on a носител (electronic or paper), after НАП's or НОИ's permission — never through the portal or НАП's API (Наредба № Н-13, чл. 9, ал. 5; чл. 8, ал. 1, т. 1 and 4) — and a past month's first record only after НОИ's задължителни предписания (чл. 4, ал. 1, т. 5). So when a month's package is due after 30 April of the year after a month it corrects (an April package correcting December), that month's records and its Д6 columns are in none of the pairs above — decided by the two months, never by the day the package is computed (a package due in time but computed late keeps them, and its caveats say so): they are in d1d6-nositel-{year}.zip (an EMPL2021.TXT and a NRA62007.TXT inside, under НАП's names), listed last with year: null — it is no file НАП's API takes, and a filing is submitted once its pairs are. Take it to the ТД of НАП with the протокол of Приложение № 9 once you have the permission — since round 9b listed right after the zip as d1d6-nositel-{year}-protokol.pdf (year: null too): the образец twice, one page each, filled from the zip (the company, the year, the months from and to, the records of обр. № 1, 3 and 6 counted in its files) and left blank where the person signs, authorises or adds paper declarations; like the zip it is not served while the month is stale (409 run_stale). The caveats say which records it holds and what they need. The money is not held: the contributions are still owed by the 25th of the month after the payment (КСО чл. 7, ал. 2). Since round 9 the filing says each such year in carrier, and is not complete (carrier_outstanding) until its hand-in is recorded with POST /filings/{id}/carrier (below). A filing whose every record went to the носител — none of its files goes by electronic path — is recorded submitted by that hand-in itself, once every year's is: its входящ номер and its day.

id is the file's position in the filing's artefact list, and it is a position on purpose: a submitted filing's artefacts are immutable by database constraint, so nothing may reorder them and the position cannot slide. size is null when the row points at a file no longer on disk — reported rather than hidden, because a caller reconciling an archive needs to know the difference between an empty file and a missing one.

The listing leaves out Autonify's own records — declaration.json, vies.json and the Д1/Д6 worksheets: НАП never asks for them, and the Д1/Д6 worksheet is our per-person record of every employee's ЕГН and pay. They are not served either: their position answers 404 not_found, like a position that does not exist. So the ids you see may not start at 0 and may not run consecutively — index the list, do not count it.

GET /filings/{id}/files/{fileId} streams one, bytes per §4.

409 run_stale (with details.period) for EMPL2021.TXT, NRA62007.TXT or (since round 8) a d1d6-nositel-{year}.zip of a filing that is not yet submitted while its payroll month is stale: the bytes describe the month before your change. Compute the month again, then fetch the new files. A submitted filing's files are served whatever happened since — they are the record of what went to НАП — and so (since 2026-10-13) are those of a year that went, or a part of which went, of a filing not yet submitted: kept as they went, they are what the rest of that year is sent with.

409 schema_superseded (with details.period and details.schema_version) for a SAF-T file — a saft_monthly, saft_on_demand or saft_annual filing (the annual file of fixed assets, period YYYY, due by 30 June of the following year) — that is not yet submitted and was built on a SAF-T schema НАП no longer accepts: from 1 November 2026 that is any file built on 1.0.2 (Заповед № З-ЦУ-30-1797/ 13.10.2026; details.schema_version names the version in force). Such a file is normally rebuilt on the current schema the moment you fetch it, and the bytes you receive are the rebuilt file's — list the files again for its new sha256. The 409 comes only when the rebuild itself is refused (an account with no national-chart mapping, an incomplete SAF-T profile, a year whose tax depreciation plan is not recorded), and the message says which. A submitted filing's SAF-T files are served as they went.

Both are free, and reachable on a plan whose API has lapsed: a customer at their ceiling must still be able to fetch the .txt files they are about to upload to НАП. They still require filings:read — free is a price, not a permission, and DEKLAR.TXT travels with POKUPKI.TXT and PRODAGBI.TXT beside it, which together are the company's whole purchase and sales дневник for the period. On the orders tier they are 403 filings_artefacts_not_in_orders_tier: that plan may see that a filing exists, not the files it was filed with.

The files of a payroll filing need payroll:read as well — d1_d6, d6_annual, employment_register (ЕТЗ), prilozhenie_9, spravka_73_1, spravka_73_6, chl49_recalculation, sol_equalization, nsi_labour_quarterly and decl_55. EMPL2021.TXT carries every employee's full ЕГН and pay, and payroll data leaves this API only through a key with payroll:read: enterprise contracts only, minted by a person with two-factor authentication. Without it the files answer 403 ability_missing (ability_not_in_contract when the key has it and the contract does not). The list, GET /filings, is unchanged and needs filings:read alone: a kind, a period, a status and a входящ номер name nobody and pay nobody.

POST /filings/{id}/transition records what happened at НАП.

curl -X POST https://app.autonify.bg/api/v1/filings/01k…/transition \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: erp-filing-2026-06-1" \
  -H "Content-Type: application/json" \
  -d '{ "to": "submitted", "nra_incoming_number": "1234567890" }'

to is submitted, accepted or rejected. nra_incoming_number is required when to is submitted — for a d1_d6 month with a pair of files per year (year on /files), only once every year's pair is filed, and with each year's number, as the app records them itself: "30Е000000126 (2026), 30Е000000127 (2027)". It runs the same status machine as the browser, tells the rest of the company what was recorded, and answers the filing.

A rejected filing moves back only to draft (the app does that when it prepares it again), with one exception since 2026-10-13: a d1_d6 with nra_verdict_needed: true that was marked rejected by mistake — НАП accepted every one of its submissions — takes to: submitted and is submitted again as it was, with its own nra_incoming_number (none is needed, and one sent is not used). Only while nothing of it went to НАП since it was submitted; otherwise 409 invalid_transition.

It does not submit anything to НАП, and it cannot. A status here records what happened elsewhere, and filings:write is a bookkeeping permission. This API makes two submissions, both on the payroll's side (§5), both signed with the person's КЕП and sent only when the company's API route is on: a package of електронни трудови записи (POST /payroll/employment-register/{YYYY-MM}/submit) and the month's Д1/Д6 (POST /payroll/runs/{YYYY-MM}/nra-submissions, since 2026-11-07). Everything else goes through НАП's portal, which is mTLS with the КЕП signing every handshake. A Д1/Д6 marked submitted here — filed through the portal — is not sent again over the API: in production such a month answers 409 submission_refused (filed_already).

409 invalid_transition when the move is not legal from the status the filing is in, with details.from and details.to. The same body is legal again once the filing reaches a status it can move from, which is why it is a 409.

409 send_in_progress (since 2026-11-08) when a d1_d6, employment_register or employment_register_123 filing is moved to submitted or accepted while the app is sending that very declaration to НАП — a person's press, the company's automatic submission of ЕТЗ, or a batch of an accounting practice's clients. Nothing is recorded. Send the same request again once the send is over: if it filed the declaration, the filing is submitted by then with НАП's own entry number, and moving it to submitted again answers 409 invalid_transition.

409 thin_cap_stale when an annual tax return (gdd) is moved to submitted while its Art. 43 CITA carry-forward must be recomputed: an earlier year was closed again, the return was prepared before the carried interest reached it, or the year's last close did not finish. details.key names the reason. Close the year again, then repeat the same request. The same code answers a return for a year given as the last one filed outside Autonify: change that answer on the Filings page first. Moving a submitted return to accepted is never refused for this reason.

POST /filings/{id}/carrier (since round 9, 2026-10-06) records that the носител of one year of a d1_d6 (carrier, above) was handed in at the ТД of НАП — like the transition, it records what a person did and sends nothing.

{ "year": 2026, "handed_in_on": "2027-06-09", "incoming_number": "94-00-1234",
  "permission_number": "РД-01-17", "permission_date": "2027-06-01" }

year, handed_in_on (never after today) and incoming_number (the number on the copy of the протокол the ТД gives back, Н-13 чл. 8, ал. 7) are required; permission_number and permission_date (never after the hand-in) when you have them — they are information only, nothing the app files depends on them. The answer is the filing, its carrier part handed_in and no longer outstanding. A filing with no file for the electronic path at all moves to submitted once every year's носител is recorded.

409 no_carrier_file — the filing holds no носител of that year (details.years lists the ones it holds). 409 carrier_already_recorded — the zip the filing holds now is already recorded (details.handed_in_on); to correct the record, take it back first. A date after today, or a permission dated after the hand-in, is 422 on its field.

DELETE /filings/{id}/carrier/{year} takes back the newest hand-in recorded for that year — one recorded by mistake, or to correct it — and answers the filing; an earlier one, if any, is the year's record again. The status is never walked back: a submitted filing stays submitted, and is not complete again. 409 carrier_not_recorded when none is recorded.

The Commercial Register pack (since 2026-11-10). A gfo_publication (form Г2) or no_activity (form Г3) filing whose registry pack was prepared in the app (Filings → „Пакет за ТР") carries the pack's PDFs after the annual close's own files: always {year}-registry-declaration-13-4.pdf; on a Г2 also {year}-registry-approval-declaration.pdf, {year}-registry-approval-decision.pdf or both, as the company's size and legal form require; on a Г3 {year}-registry-no-activity-declaration.pdf. A micro or small company's adopting decision is not filed, so it is not among them. Preparing the pack — and preparing it again — announces filing.generated. Nothing is filed with the register: record its answer with POST /filings/{id}/transition — submitted with the ЕПЗЕУ входящ номер as nra_incoming_number, accepted once announced, rejected on a refusal. The refusal's date is recorded only on the pack's page, and only a refusal recorded there is followed by the reminder of the 14-day window of чл. 38, ал. 2 ЗСч (a ГФО first filed on time and filed again within 14 days of the refusal taking effect counts as filed on time).

GET /filings/{id}/checks (since 2026-11-08) — the check before signing, as the app's „Проверка преди подписване" shows it for a ДДС return (vat_return), a monthly SAF-T file (saft_monthly) or a Д1/Д6 (d1_d6): what moved against the previous period, what НАП's portal will refuse, and why it matters. It says; it never refuses — nothing that records a filing's status reads it, and POST /filings/{id}/transition answers exactly as it would without it. Free and plan-exempt, like every filings read.

{ "data": {
    "filing": { "id": "01k…", "kind": "vat_return", "period": "2026-10", "status": "generated" },
    "pending": false, "record_id": "01k…", "computed_at": "2026-11-01T04:05:11+00:00",
    "compared_with": { "filing_id": "01k…", "period": "2026-09" },
    "counts": { "stop": 0, "warn": 1, "info": 0 },
    "flags": [ { "code": "vat.cell_moved", "severity": "warn", "live": false,
        "data": { "cell": "01", "key": "ui.filings.cell.total_sales_base",
                  "previous": { "amount": "2000.00", "currency": "EUR" },
                  "current": { "amount": "6100.00", "currency": "EUR" },
                  "delta": { "amount": "4100.00", "currency": "EUR" },
                  "percent": "205.00", "previous_period": "2026-09", "year_ago": null },
        "text": "Box 01 (“Total taxable base”): €6,100.00 against €2,000.00 for September 2026 — a change of €4,100.00 (205.00 %).",
        "why": "A large change is not an error in itself. …",
        "explained": [] } ],
    "reviewed": null },
  "meta": { "locale": "en" } }
  • The words — text (what the flag found) and why (why it matters; null for an info flag) come in ?locale=bg|en, Bulgarian when absent, filled as the app prints them. Any other locale is 422 validation_failed.
  • severity — stop: the portal will refuse the files, or they describe data that moved since they were prepared — fix it before filing; warn: a figure moved enough against the previous period to look at once; info: context. counts adds them up.
  • live — false for the comparison, worked out once for each preparation of the files (and of the period compared with) and kept as it was shown; true for a flag about the state now — the month's documents changed since the return was prepared (vat.inputs_moved), data the portal needs is missing (vat.readiness, with the missing items in the sentence), a SAF-T schema НАП no longer accepts (saft.superseded), a payroll month changed since it was computed (payroll.stale) and so not compared (payroll.not_compared) — read again on every call.
  • data — the flag's facts: money as money objects (§4), always EUR; percent a two-decimal string — null for a figure that moved from zero, where there is no share to give, and its text then gives none; periods YYYY-MM; key the content key of a ДДС cell's name. A Д1/Д6's flags are aggregates only — how many people moved, the month's totals — never a person.
  • explained — for saft.schema_invalid, the schema's error lines explained one by one, each as a line of the payroll explanation below (title, meaning, fix, basis in the same locale). [] otherwise.
  • compared_with — the period actually compared with, and its filing; null when there was nothing to compare with.
  • reviewed — { "at", "by" } once a person marked „Прегледах промените" in the app for these files, else null. A review is a person's word and is given in the app only; nothing here records one.

Checks are made only while a filing waits to be signed (generated or awaiting_signature). In any other status the answer is the check kept for its current files, if one was made, else no flags at all (record_id: null).

The codes: vat.cell_moved (warn — one of boxes 01, 20, 40, 50 and 60 moved by at least €1,000 and 50 %), vat.no_previous, vat.refund_claimed, vat.coefficient_changed (info), vat.inputs_moved, vat.readiness (stop, live); saft.schema_invalid (stop), saft.count_moved, saft.empty (warn — the month's ledger entries or documents moved by at least 50 and 50 %, or its ledger entries fell to none), saft.no_previous (info), saft.superseded (stop, live); payroll.people_above_threshold, payroll.total_moved (warn — by the company's own highlight threshold of the payroll variance), payroll.new_people, payroll.left_people, payroll.no_previous (info), payroll.variance_not_ready (info, live), payroll.stale (stop, live), payroll.not_compared (info, live — the month's data changed since it was computed, so it was compared with nothing; payroll.stale comes with it while the month's files wait to be computed again, and does not once a part of its year went to НАП, whose files go on as they went).

202 while a big payroll month is compared. A d1_d6 whose month has more people than the comparison is worked out for on request is compared in the background: the answer is 202 Accepted with Retry-After: 30 and the same body — pending: true, the live flags and payroll.variance_not_ready. Ask again after that many seconds; the same GET answers 200 once the comparison is ready.

A d1_d6's check is the payroll's: it needs payroll:read as well (enterprise contracts only) — 403 ability_missing without it (ability_not_in_contract when the key has it and the contract does not) — and a key whose person's team seat reads the payroll: 403 team_access otherwise. 404 checks_not_supported for any other kind of filing, and for a ДДС or SAF-T filing whose period is not a month; 404 not_found for an id that is not this company's. On the orders tier 403 filings_artefacts_not_in_orders_tier: the flags carry the return's own figures. filing.checks.flagged (§9) tells you when a new preparation of a ДДС return or a SAF-T file has something to look at.

The NRA data cross-check

Since 2026-11-08. Read only: what the app's Сверка с данните на НАП (/vat/crosscheck) found when it compared the company's purchase documents with what its suppliers declared to НАП. The file from the НАП portal is uploaded, its columns checked and confirmed in the app, and findings are settled there by a person; this API reads the result. Both endpoints need filings:read and a plan that includes the cross-check — otherwise 403 vat_crosscheck_not_in_plan. A practice's key on a client's company is also judged by the practice's own plan, as in the app.

GET /vat/crosscheck — the check at a glance:

{ "data": {
  "applicable": true, "has_imports": true,
  "open": 3, "waiting": 1, "dismissed": 2, "resolved": 14,
  "vat_at_stake_eur": { "amount": "412.80", "currency": "EUR" },
  "coverage": ["2026-08", "2026-09"], "incomplete": [],
  "last_run": { "id": "01k…", "status": "done", "reason": "nightly",
                "started_at": "2026-10-20T02:30:02+00:00",
                "finished_at": "2026-10-20T02:30:04+00:00",
                "counts": { "opened": 1, "reopened": 0, "resolved": 2, "open": 3, "…": "…" } }
} }
  • open — findings to review; waiting — waiting on a supplier or on a correction; dismissed — accepted as they are; resolved — closed by a later comparison (the document was entered, the data now agree, …).
  • vat_at_stake_eur — the VAT on the open findings.
  • coverage — the months the company has НАП data for; incomplete — those of them downloaded before the suppliers' deadline (the 14th of the next month), where a document no supplier declared proves nothing yet.
  • last_run — the latest comparison, or null. The app compares every night and after every upload.

A company that deducts no input VAT — not VAT-registered, or registered under ЗДДС Art. 97a, 99 or 100(2) — answers {"applicable": false} and nothing else, and its list of findings is empty.

GET /vat/crosscheck/findings (?status=, ?kind=, ?period=, and the cursor and updated_since every list takes) — every finding, oldest first:

{ "id": "01k…", "kind": "missing_in_books", "status": "open",
  "period": "2026-09", "books_period": null, "claim_by_period": "2027-09",
  "period_filed": false, "nra_listed": false,
  "advice": "book_now", "advice_params": { "period": "2026-09" },
  "supplier": { "identifier": "BG…", "name": "Доставчик ООД" },
  "document": { "number": "0000004411", "type_family": "invoice",
                "theirs_type_family": null, "issued_on": "2026-09-14" },
  "nra": { "base_eur": { "amount": "100.00", "currency": "EUR" },
           "vat_eur": { "amount": "20.00", "currency": "EUR" },
           "periods": ["2026-09"], "as_of": "2026-10-20" },
  "books": null,
  "vat_at_stake_eur": { "amount": "20.00", "currency": "EUR" },
  "suggestion": null, "link": null, "can_link": true,
  "dismissed_reason": null, "resolution": null, "reopened_after_change": false,
  "first_seen_at": "2026-10-20T02:30:04+00:00", "last_seen_at": "2026-10-21T02:30:03+00:00" }
  • kind — one of nine: missing_in_books (a supplier declared it, the books do not have it), captured_not_booked (uploaded, still waiting for review), not_declared_by_supplier (in the purchase register, and no supplier declared it), amount_differs, type_differs, period_differs (the books declare it before the supplier did), annulled_mismatch (cancelled on one side only), nra_duplicate (the supplier declared it twice) and nra_listed_unmatched (НАП's own list of discrepancies names it, the books do not have it).
  • status — open, disputed (waiting on the supplier), needs_correction, dismissed (accepted as it is — dismissed_reason says why) or resolved (resolution says how).
  • advice — what usually fixes it, as a code: book_now, book_within_window, window_passed, credit_note_missing, debit_note_missing, note_in_filed_period, approve_pending, ask_supplier, check_amounts, check_type, check_period, check_annulment, duplicate_at_supplier, not_in_books_listed. advice_params holds its values — a period as YYYY-MM, a date, or two type_family codes; the app words the sentence. The period of book_now, credit_note_missing, debit_note_missing and note_in_filed_period is the month the document was issued in, which a supplier that declared it late does not move.
  • period — the НАП period; for not_declared_by_supplier, the month the document was issued. books_period — the period the books declare it in. claim_by_period — for an invoice, the last return the input VAT can still be claimed in (ЗДДС Art. 72(1)); null once that window has passed. period_filed — the return of the month the advice is about is already filed: for missing_in_books the month the document was issued in, for every other kind period.
  • nra — НАП's side, null when only the books have the document; books — the purchase document, null when there is none. Every amount is in euro; a side that has no amount is null, never zero.
  • suggestion — a near miss the app suggests and never pairs by itself; link — a pairing a person made in the app.

?status takes the groups open, waiting (disputed or needing a correction) and done (accepted or resolved); ?kind one of the nine; ?period YYYY-MM. Without them every finding is listed. The team's notes on a finding, and the names of the people who acted on it, are never in this API.

OSS register (чл. 159г)

Since 2026-11-15. Read only: the company's electronic register of its supplies under the Union scheme (ЗДДС Art. 159г; Regulation (EU) No 282/2011, Art. 63c) — what the app's Регистър по OSS (/vat/oss-register) holds. Autonify fills it every night from the shops' orders, their refunds and the payments received; an entry is never changed or deleted — a change to an order is recorded as a new adjustment. Free and plan-exempt like every filings read: filings:read, minted on the key; the orders tier is refused 403 filings_artefacts_not_in_orders_tier, as for a filing's files.

GET /oss-register?period=YYYY-Qn (?member_state=, and the cursor and updated_since every list takes; ?limit= up to 100, 100 when absent) — the quarter's entries, oldest first:

{ "data": [
  { "id": "01k…", "entry_kind": "supply", "reason": null, "member_state": "DE",
    "supplied_on": "2026-10-03", "quarter": "2026-Q4", "description": "2 × Тениска",
    "items": [ { "name": "Тениска", "quantity": "2", "rate": "19.00",
                 "net": { "amount": "40.00", "currency": "EUR" },
                 "vat": { "amount": "7.60", "currency": "EUR" } } ],
    "currency": "EUR", "vat_rate": "19.00", "fx_rate": null,
    "taxable_amount": { "amount": "40.00", "currency": "EUR" },
    "vat_amount": { "amount": "7.60", "currency": "EUR" },
    "eur_taxable_amount": { "amount": "40.00", "currency": "EUR" },
    "eur_vat_amount": { "amount": "7.60", "currency": "EUR" },
    "payment": null, "before_supply": false,
    "invoice": { "number": "0000000123", "date": "2026-10-03" },
    "customer_location": { "billing_country": "DE", "shipping_country": "DE",
                           "dispatch_country": "BG", "evidence": ["buyer_address", "courier_waybill"] },
    "return_proof": null, "order_reference": "1042", "supply_entry_id": null,
    "recorded_at": "2026-10-04T02:35:00+00:00" } ],
  "meta": { "period": "2026-Q4", "scheme": "union", "registered_from": "2026-07-01",
            "synced_at": "2026-10-04T02:35:00+00:00",
            "totals": [ { "member_state": "DE", "vat_rate": "19.00",
                          "taxable": { "amount": "40.00", "currency": "EUR" },
                          "vat": { "amount": "7.60", "currency": "EUR" } } ],
            "next_cursor": null, "limit": 100 } }
  • entry_kind — supply (one per order and VAT rate), adjustment (a later change of the taxable amount) or payment. reason says why an adjustment or a payment was recorded: refund, order_changed, no_longer_qualifies, paid, paid_before_supply or cod_paid_out (a cash-on-delivery amount the courier paid out). An adjustment and a payment name their supply in supply_entry_id.
  • quarter — the quarter the entry belongs to: a supply's is its delivery's, a refund's its own day's, an order change's the day it was recorded — so a change after a filed quarter lands in a later quarter, among the corrections of ЗДДС Art. 159д. A payment keeps its supply's quarter; its own date is supplied_on. Dates and quarters are on the UTC calendar the OSS return uses.
  • Amounts in the entry's own currency and in euro (eur_…), every one a money object (§4), signed: an adjustment that reduces a supply is negative. A payment carries payment (date, amount, method) and zero amounts.
  • invoice — the number and date of the order's invoice, when one was issued. The buyer's name is never in this API, and the register holds none.
  • meta.totals — the quarter per member state and rate as the register holds it, in euro: its supplies and the changes recorded within the quarter, never its refunds — as the OSS return.
  • meta.synced_at — when the register was last brought up to date. This endpoint never writes; the app's nightly run and its Excel and CSV downloads do.

404 not_oss_registered when no OSS registration date is recorded for the company. A period that is not YYYY-Qn, or a member_state that is not two letters, is 422 validation_failed.

The account's companies (account:companies)

Since 2026-10-23. The account's companies listed and read, and a company added to the account from its ЕИК — what the app's own add and its „Add many entities from a list of ЕИК" do — for a key holding account:companies. Who may hold it is exactly who may hold payroll:account (§1, Enterprise contracts): a live key on a company your enterprise contract covers, under a contract that names account:companies, created or rotated by the account's owner or an admin with two-factor authentication — never a sandbox key, never the bulk „a key for every company". Refused before anything else, 403: ability_missing / ability_not_in_contract as for any permission, account_scope_sandbox and account_scope_not_permitted as for payroll:account.

GET /companies — every company of the account that owns the key's company (never its sandbox), by name; GET /companies/{id} — one (another account's is 404):

{ "data": [
  { "id": "01k…", "eik": "206612345", "name": "Ентитет 1 ЕООД", "legal_form": "EOOD",
    "covered": true, "has_keys": true, "archived": false, "created_at": "2026-10-23T08:00:00+00:00" } ] }

covered — the contract covers the company (a contract that lists its companies covers a new one once Autonify adds it). has_keys — the account holds a usable key on it (a rotated key until its week runs out).

POST /companies — the company added, 201:

Field
eik required — the company's ЕИК (or БУЛСТАТ code); spaces and a BG in front are ignored
activity_code the 4-digit КИД the payroll prices contributions by, when it is not the company's own (62.01 is 6201)
salary_iban the account salaries are paid from — a bank account of the company, the salary file's debtor account
setup_from the id of another company of the account the contract covers, whose payroll setup the new one starts from — as the app's „Start from the setup of…" (§5, payroll settings)
setup_departments true — its departments come too
key { "name": "ERP", "abilities": ["payroll:read", "payroll:write"] } — a live key for the new company, minted in the same call

Any other field is 422 validation_failed, by name — there is no way to type a company's details in: they are the registers'.

The company is created as the app's list add creates it: looked up in the registers (the Trade Register's data, БУЛСТАТ, VIES) in the request — one ЕИК takes seconds, as in the app's own add, so there is nothing to poll and no event to wait for — and written as a payroll entity: the register's name, legal form, address, МОЛ, КИД and ДДС registration, the general profile with the core and payroll accounts, and no bookkeeping questions (where the books start, the self-insured owner); activity_code and salary_iban as above.

{ "data": {
  "company": { "id": "01k…", "eik": "206612345", "name": "Ентитет 2 ЕООД", "covered": true, "has_keys": true, "…": "…" },
  "registry": { "active": true, "status": "active" },
  "setup": { "from": "01k…", "status": "copied" },
  "key": { "id": "01k…", "name": "ERP", "abilities": ["payroll:read"], "environment": "live",
           "masked": "atn_live_01k5xyz7…Ab3d", "expires_at": "2027-10-23T08:00:00+00:00", "secret": "atn_live_…" },
  "key_refusal": null,
  "warnings": [] } }
  • registry — whether the register lists the company as active, and its status: an entity in liquidation is added (the app adds it too, when a person ticks it), and said here.
  • setup.status — copied, or failed: the company stays added and its setup is copied from its payroll settings in the app, as after an add there.
  • key — minted for the new company, for the same person as the calling key: its permissions must be ones the contract grants and the calling key holds itself, and never payroll:account or account:companies — otherwise 403 key_ability_not_permitted (details.abilities), and nothing is added. The secret is in this answer only: a replay of the call (§3) is the same body with "secret": null — we keep no copy. Lost it? Revoke the key on /developers and create another.
  • key_refusal — the company was added and no key minted: company_not_covered — your contract lists the companies it covers and covers this one once Autonify adds it to the contract (the add itself is the app's, which adds such a company too; a payroll key needs the contract); key_refused — the key's own rule refused it, in words.
  • warnings — trial_abuse_flagged: the ЕИК's free fortnight was already had on another account, so adding it spent this account's trial — recorded for review and said, as the app says it. Never a refusal.

Refused for exactly the reasons the app refuses an add, in its words. The app's add, its list add and this call go through one door: the same checks, the same writer. message is the app's own sentence, in English. Before anything is written:

Code Status The rule — the app's
ability_missing / ability_not_in_contract / account_scope_sandbox / account_scope_not_permitted 403 The key's person and contract, above.
account_suspended 403 The account is suspended.
contract_suspended 403 The enterprise contract is suspended.
subscription_read_only 403 The key's company is read-only — a lapsed plan, an archived company — or the account is held for an unpaid plan upgrade (details.reason unpaid_upgrade): the app refuses every write then, an add included.
key_ability_not_permitted 403 key asks for a permission the contract does not grant, the calling key does not hold, or one that acts on the whole account. details.abilities.
eik_is_egn 422 A personal number (ЕГН) where the ЕИК goes: no register knows a business by one — a freelancer's code is a 9-digit БУЛСТАТ number since 4 January 2022.
invalid_eik 422 The check digit does not match.
demo_real_eik 422 A demo account holds invented companies, on sample ЕИК only.
bad_activity_code 422 activity_code is not 4 digits.
bad_salary_iban 422 salary_iban is not a valid IBAN.
eik_taken 409 The ЕИК already runs on Autonify — on another account (one company, one account: its holder transfers it) or on this one (details.company_id: the call that added it may have lost its answer). A company deleted in the last 24 hours holds its ЕИК until the deletion is carried out.
setup_source_unavailable 409 setup_from is not a company of the account the contract covers.
registry_not_found 409 The registers do not know the ЕИК, or did not answer. Retry later — or add it in the app, where its details can be typed in.
no_company_slot 409 The contract's company count is used up and the contract does not bill companies past it: more companies are a change to the contract.
company_slot_maximum 409 The contract bills companies past its count up to a safety maximum, and it is reached. details.max; contact Autonify to raise it.
slot_purchase_in_app 409 The plan's included companies are in use, so the next one would be bought — which the app does only after showing the price. Add it in the app (details.app_url).
trial_company_blocked 409 The account is on a trial and the ЕИК already had its free fortnight: start the paid plan in the app (details.app_url), then add it.

No reason here is one the app does not have, and the app has none the API skips. A few need no code of their own: the seat (an accountant seat assigned to some clients, or one whose add would be a purchase, is refused in the app; an account:companies key is an owner's or an admin's), two-factor authentication for privileged seats (always required here), the re-consent to changed legal documents (§1's terms gate stands in its place, and a contract's signed agreement governs) and a company shown before its transfer (a key never stands on one).

Billed exactly as an add in the app. The add counts against the contract's company count — or the plan's — through the same check, under the same lock; past a count the contract bills, the company is held and billed on the month's statement at the month's peak, up to the safety maximum; an enterprise account's month is read at the add; and a company past what the access includes is priced on the statement as in the app. Nothing is ever bought through the API (slot_purchase_in_app).

Idempotent. Idempotency-Key is required (§3): the retry of a call that added a company is its first answer, and adds nothing; a new key for the same ЕИК is 409 eik_taken naming the company. Two calls for one ЕИК at once add it once.

Metering. Like every account-scope call, against the key's own company: 10 units for the add, 5 for the list, 1 for one company — each in the request log and on the contract's usage under account:companies.

Payroll — enterprise contracts only

payroll:read and payroll:write exist only under an enterprise contract that includes them (§1). No plan sells them, and no payroll route is free: every one is priced like any other read or write, and metered under the contract.

A key is bound to one company, so a group of entities uses one key per entity. Everything below is that company's payroll and nothing else's: an id from another company — another of your own entities included — is 404 not_found.

Method Path Permission Units
GET /payroll/employees payroll:read 5
GET /payroll/employees/{id} payroll:read 1
POST /payroll/employees payroll:write 10
PATCH /payroll/employees/{id} payroll:write 10
POST /payroll/employees/{id}/termination payroll:write 10
PUT /payroll/employees/{id}/termination payroll:write 10
DELETE /payroll/employees/{id}/termination payroll:write 10
PUT /payroll/employees/{id}/termination/compensation payroll:write 10
POST /payroll/employees/{id}/reinstatement payroll:write 10
DELETE /payroll/employees/{id}/reinstatement payroll:write 10
POST /payroll/employees/{id}/annulment payroll:write 10
DELETE /payroll/employees/{id}/annulment payroll:write 10
PUT /payroll/employees/{id}/termination/ground payroll:write 10
GET /payroll/employees/{id}/carry-forwards payroll:read 1
PATCH /payroll/carry-forwards/{id} payroll:write 10
PUT /payroll/employees/{id}/recovered-abroad/{YYYY-MM} payroll:write 10
POST /payroll/employees/{id}/open-claim/settlements payroll:write 10
DELETE /payroll/open-claim/settlements/{id} payroll:write 10
GET /payroll/employees/{id}/father-leave payroll:read 1
POST /payroll/employees/{id}/father-leave/elsewhere payroll:write 10
POST /payroll/employees/{id}/father-leave/circumstances payroll:write 10
DELETE /payroll/father-leave/elsewhere/{id} payroll:write 10
DELETE /payroll/father-leave/circumstances/{id} payroll:write 10
GET /payroll/net-remuneration-corrections payroll:read 5
POST /payroll/net-remuneration-corrections payroll:write 10
DELETE /payroll/net-remuneration-corrections/{id} payroll:write 10
PUT /payroll/employees/{id}/leave-opening payroll:write 10
GET /payroll/employees/{id}/leave-entitlements payroll:read 1
PUT /payroll/employees/{id}/leave-entitlements/{effective_from} payroll:write 10
DELETE /payroll/employees/{id}/leave-entitlements/{effective_from} payroll:write 10
GET /payroll/employees/{id}/leave-postponements payroll:read 1
PUT /payroll/employees/{id}/leave-postponements/{year} payroll:write 10
DELETE /payroll/employees/{id}/leave-postponements/{year} payroll:write 10
PATCH /payroll/employees/{id}/annulment payroll:write 10
GET /payroll/employees/{id}/leave-time-without-work payroll:read 1
PUT /payroll/employees/{id}/leave-time-without-work payroll:write 10
GET /payroll/employees/{id}/unpaid-leave-elsewhere payroll:read 1
PUT /payroll/employees/{id}/unpaid-leave-elsewhere payroll:write 10
GET /payroll/employees/{id}/year-openings payroll:read 1
PUT /payroll/employees/{id}/year-openings/{year} payroll:write 10
DELETE /payroll/employees/{id}/year-openings/{year} payroll:write 10
GET /payroll/employment-records payroll:read 5
PATCH /payroll/employment-records/{id} payroll:write 10
DELETE /payroll/employment-records/{id} payroll:write 10
POST /payroll/employment-register/{YYYY-MM} payroll:write 10
GET /payroll/employment-register/{YYYY-MM}/xml payroll:read 1
POST /payroll/employment-register/{YYYY-MM}/submit payroll:write 10
GET /payroll/runs/{YYYY-MM}/nra-submissions payroll:read 1
POST /payroll/runs/{YYYY-MM}/nra-submissions payroll:write 10
POST /payroll/runs/{YYYY-MM}/nra-submissions/{id}/rejected payroll:write 10
DELETE /payroll/runs/{YYYY-MM}/nra-submissions/{id}/rejected payroll:write 10
GET /payroll/runs/{YYYY-MM}/nra-submissions/{id}/explanation payroll:read 1
GET /payroll/employees/{id}/deductions payroll:read 1
POST /payroll/employees/{id}/deductions payroll:write 10
PATCH /payroll/deductions/{id} payroll:write 10
POST /payroll/deductions/{id}/repayments payroll:write 10
PATCH /payroll/deductions/{id}/repayments/{repayment} payroll:write 10
DELETE /payroll/deductions/{id}/repayments/{repayment} payroll:write 10
GET /payroll/employees/{id}/allowances payroll:read 1
POST /payroll/employees/{id}/allowances payroll:write 10
PATCH /payroll/allowances/{id} payroll:write 10
GET /payroll/employees/{id}/documents payroll:read 1
POST /payroll/employees/{id}/documents payroll:write 10
GET /payroll/employees/{id}/documents/{document} payroll:read 1
GET /payroll/legal-parameters payroll:read 1
GET /payroll/readiness payroll:read 5
GET /payroll/settings payroll:read 1
PATCH /payroll/settings payroll:write 10
GET /payroll/settings/enterprise payroll:read 1
PATCH /payroll/settings/enterprise payroll:write 10
GET /payroll/sirv-schedules payroll:read 5
GET /payroll/employees/{id}/sirv-schedule payroll:read 1
PUT /payroll/employees/{id}/sirv-schedule/{YYYY-MM}/draft payroll:write 10
DELETE /payroll/employees/{id}/sirv-schedule/{YYYY-MM}/draft payroll:write 10
POST /payroll/employees/{id}/sirv-schedule/{YYYY-MM}/approve payroll:write 10
POST /payroll/employees/{id}/sirv-schedule/{YYYY-MM}/acknowledgment payroll:write 10
GET /payroll/departments payroll:read 5
POST /payroll/departments payroll:write 10
PATCH /payroll/departments/{id} payroll:write 10
DELETE /payroll/departments/{id} payroll:write 10
GET /payroll/pay-acts payroll:read 5
POST /payroll/pay-acts payroll:write 10
GET /payroll/pay-acts/{id} payroll:read 1
PATCH /payroll/pay-acts/{id} payroll:write 10
DELETE /payroll/pay-acts/{id} payroll:write 10
POST /payroll/pay-acts/{id}/apply payroll:write 10
GET /payroll/pay-acts/{id}/order.pdf payroll:read 1
GET /payroll/seniority-rates payroll:read 5
POST /payroll/seniority-rates payroll:write 10
DELETE /payroll/seniority-rates/{id} payroll:write 10
GET /payroll/seniority payroll:read 5
GET /payroll/seniority.csv payroll:read 5
GET /payroll/hours-rates payroll:read 5
POST /payroll/hours-rates payroll:write 10
DELETE /payroll/hours-rates/{id} payroll:write 10
GET /payroll/employees/{id}/hours-rates payroll:read 5
POST /payroll/employees/{id}/hours-rates payroll:write 10
DELETE /payroll/employees/{id}/hours-rates/{rate_id} payroll:write 10
GET /payroll/raise-rules payroll:read 5
POST /payroll/raise-rules payroll:write 10
GET /payroll/raise-rules/{id} payroll:read 1
PATCH /payroll/raise-rules/{id} payroll:write 10
DELETE /payroll/raise-rules/{id} payroll:write 10
GET /payroll/bonus-rules payroll:read 5
POST /payroll/bonus-rules payroll:write 10
GET /payroll/bonus-rules/{id} payroll:read 1
GET /payroll/bonus-rules/{id}/preview payroll:read 5
PATCH /payroll/bonus-rules/{id} payroll:write 10
DELETE /payroll/bonus-rules/{id} payroll:write 10
GET /payroll/employees/{id}/raises payroll:read 1
PATCH /payroll/employees/{id}/raise-settings payroll:write 10
GET /payroll/templates payroll:read 5
POST /payroll/templates payroll:write 10
GET /payroll/templates/{id} payroll:read 1
PATCH /payroll/templates/{id} payroll:write 10
DELETE /payroll/templates/{id} payroll:write 10
GET /payroll/templates/{id}/versions payroll:read 5
GET /payroll/templates/{id}/outdated payroll:read 5
GET /payroll/templates/{id}/hours-rates payroll:read 5
POST /payroll/templates/{id}/hours-rates payroll:write 10
DELETE /payroll/templates/{id}/hours-rates/{rate_id} payroll:write 10
POST /payroll/templates/{id}/applications/preview payroll:read 10
POST /payroll/templates/{id}/applications payroll:write 10
GET /payroll/templates/{id}/applications payroll:read 5
GET /payroll/templates/{id}/applications/{application_id} payroll:read 1
GET /payroll/templates/{id}/previews/{preview_id} payroll:read 1
POST /payroll/employees/{id}/template payroll:write 10
POST /payroll/pay-acts/{id}/approve payroll:write 10
PUT /payroll/periods/{YYYY-MM}/inputs payroll:write 10
DELETE /payroll/absences/{id} payroll:write 10
POST /payroll/absences/{id}/return payroll:write 10
DELETE /payroll/absences/{id}/return payroll:write 10
GET /payroll/periods/{YYYY-MM}/inputs/template.{format} payroll:read 5
POST /payroll/periods/{YYYY-MM}/inputs/file payroll:write 10
GET /payroll/imports/{kind}/template.csv payroll:read 5
POST /payroll/imports/{kind}/file payroll:write 10
GET /payroll/imports/runs/{id} payroll:read 1
GET /payroll/imports/runs/{id}/result payroll:read 5
GET /payroll/periods/{YYYY-MM}/adjustments payroll:read 5
POST /payroll/periods/{YYYY-MM}/adjustments payroll:write 10
DELETE /payroll/periods/{YYYY-MM}/adjustments/{id} payroll:write 10
POST /payroll/runs payroll:write 10
GET /payroll/runs payroll:read 5
GET /payroll/runs/{YYYY-MM} payroll:read 5
POST /payroll/runs/{YYYY-MM}/post payroll:write 10
GET /payroll/runs/{YYYY-MM}/approval payroll:read 1
POST /payroll/runs/{YYYY-MM}/approval/submit payroll:write 10
POST /payroll/runs/{YYYY-MM}/approval/approve payroll:write 10
POST /payroll/runs/{YYYY-MM}/approval/return payroll:write 10
GET /payroll/runs/{YYYY-MM}/payslips.zip payroll:read 5
POST /payroll/runs/{YYYY-MM}/payslip-archives payroll:read 10
GET /payroll/payslip-archives/{id} payroll:read 1
GET /payroll/runs/{YYYY-MM}/payslips/{employee}.pdf payroll:read 1
GET /payroll/runs/{YYYY-MM}/smetka/{employee}.pdf payroll:read 1
GET /payroll/runs/{YYYY-MM}/acceptance-protocol/{employee}.pdf payroll:read 1
GET /payroll/runs/{YYYY-MM}/register.csv payroll:read 5
GET /payroll/runs/{YYYY-MM}/obligations payroll:read 5
POST /payroll/obligations/{id}/paid payroll:write 10
GET /payroll/runs/{YYYY-MM}/bank-file.xml payroll:read 5
GET /payroll/runs/{YYYY-MM}/budget-payments.{format} payroll:read 5
GET /payroll/runs/{YYYY-MM}/budget-payments/bank-file payroll:read 5
GET /payroll/runs/{YYYY-MM}/gl payroll:read 5
GET /payroll/runs/{YYYY-MM}/gl.csv payroll:read 5
GET /payroll/runs/{YYYY-MM}/cost payroll:read 5
GET /payroll/runs/{YYYY-MM}/cost.csv payroll:read 5
GET /payroll/runs/{YYYY-MM}/cost-by-department payroll:read 5
GET /payroll/runs/{YYYY-MM}/cost-by-department.csv payroll:read 5
GET /payroll/runs/{YYYY-MM}/variance payroll:read 5
GET /payroll/runs/{YYYY-MM}/variance.csv payroll:read 5
GET /payroll/ytd payroll:read 5
GET /payroll/ytd.csv payroll:read 5
GET /payroll/ytd/preparations/{id} payroll:read 1
GET /payroll/ytd/preparations/{id}/result payroll:read 5
GET /payroll/ytd/preparations/{id}/result.csv payroll:read 5
GET /payroll/income-certificates/{year}.zip payroll:read 5
POST /payroll/income-certificates/{year}/archives payroll:read 10
GET /payroll/income-certificate-archives/{id} payroll:read 1
POST /payroll/calculate payroll:read 1
POST /payroll/runs/{YYYY-MM}/simulation payroll:read 10
POST /payroll/runs/{YYYY-MM}/parallel-run payroll:read 25 (a file)
GET /payroll/periods/{YYYY-MM}/off-cycle-payments payroll:read 5
POST /payroll/periods/{YYYY-MM}/off-cycle-payments payroll:write 10
GET /payroll/periods/{YYYY-MM}/off-cycle-payments.csv payroll:read 5
GET /payroll/periods/{YYYY-MM}/off-cycle-payments/bank-file.xml payroll:read 5
POST /payroll/off-cycle-payments/{id}/paid payroll:write 10
DELETE /payroll/off-cycle-payments/{id} payroll:write 10
GET /payroll/off-cycle-payments/{id}/advice.pdf payroll:read 1
GET /payroll/pay-transparency/categories payroll:read 5
POST /payroll/pay-transparency/categories payroll:write 10
PATCH /payroll/pay-transparency/categories/{id} payroll:write 10
GET /payroll/pay-transparency/people payroll:read 5
PUT /payroll/pay-transparency/people/{id} payroll:write 10
GET /payroll/pay-transparency/reports/{year} payroll:read 1
POST /payroll/pay-transparency/reports/{year}/preparation payroll:write 10

How a month works, in five lines.

  1. An employee is one employment: our id, and your own external_id. A rehire is a new employment and may reuse the external_id.
  2. A month's inputs — hours, one-off pay lines, absences — go in with one PUT per month, up to 1,000 employees a call.
  3. POST /payroll/runs asks for the month to be computed; the answer is 202 at once and the work happens on our queue.
  4. A computed month whose inputs change is stale: it reads normally with "stale": true, and it cannot be posted, nor its payslips or ведомост fetched, until it is computed again. Since round 6 (2026-10-06) stale is also true for a month computed on a retro difference or a late correction priced before the per-box rule of 2026-10-05: posting it answers 409 run_stale until it is computed again, which prices that row anew, to НАП's box figures — until then stale stayed false and only the post was refused.
  5. POST /payroll/runs/{YYYY-MM}/post posts the month to the books. That is final — see „What the payroll API will not do" below.

Every payroll write for a company waits for any other payroll write on the same company — yours, the payroll team's in the app, a computation — for up to five seconds, then answers 409 payroll_busy with nothing written. Retry after a few seconds.

Idempotency-Key is required on PUT as well as POST and PATCH (§3).

Payroll bodies that fail validation answer 422 validation_failed in the ordinary envelope, with the field errors in details keyed by the path you sent (employees.3.absences.0.start_date) — never the framework shape of §4. Unknown fields are refused rather than ignored, on every payroll body and at every depth: a misspelt gross_salary silently dropped would be a person paid nothing, an hours.overtime_hours overtime nobody pays, a bolnichen_no a болничен НОИ never hears of. The keys a GET returns that a write cannot set may ride along where a section says so. A PATCH whose body is not JSON at all is 400 invalid_json, and nothing is changed.

Moving a company over mid-year

A company whose payroll ran elsewhere until now comes over in this order. All of it but the first step is the API; the company itself and its key are set up in the app. Every step after the first changes money if it is skipped:

  1. The company and its key — in the app: the owner adds the company, and the key is created on /developers (one key per company).
  2. Its payroll policy — PATCH /payroll/settings (Payroll settings below): the company's own КИД (nkid_code — the ЕТЗ's т. 21 code, which the payroll follows for the ТЗПБ rate and the МОД thresholds unless economic_activity_code sets another apart; since 2026-10-10 settable here), and the СИРВ period if the company sums working time. GET /payroll/settings answers what each resolves to; check it before the first computation: with no КИД code the ТЗПБ falls to the highest band (1.10%) and the МОД to the minimum wage.
  3. The employees — POST /payroll/employees with existing_employment: true and the three history fields described under Employees below.
  4. Each person's year so far — PUT /payroll/employees/{id}/year-openings/{year}. The months it covers are the previous system's: none of them is computed here afterwards (409 opening_overlaps_payroll), so the first month you compute is the one after through_month.
  5. Each person's leave — PUT /payroll/employees/{id}/leave-opening, the unused days of each year on the day of the move; then, where the contract gives more than the statutory 20 days (26 with a disability decision), PUT /payroll/employees/{id}/leave-entitlements/{effective_from}, and for a year of leave postponed under КТ чл. 176, PUT /payroll/employees/{id}/leave-postponements/{year} (Leave entitlements and postponements below). Without the entitlement every person accrues the minimum, and a leaver's чл. 224 compensation is short by the difference.
  6. Running deductions — POST /payroll/employees/{id}/deductions (Running deductions below): запори, издръжки and advances, each with what is LEFT of it at the move as total_owed — the running total counts only what the months computed here withhold. The first payroll here withholds nothing it has not been told about.
  7. Standing allowances — POST /payroll/employees/{id}/allowances (Standing allowances below): each allowance the person is paid every month, with permanent saying whether it is of a permanent character (НСОРЗ чл. 15, ал. 2). Sent every month as a one-off line instead, an allowance is paid right but stays out of the sick-pay base (КСО чл. 40, ал. 5), and a permanent one out of the paid-leave, overtime and compensation bases too.

Then compute the first month (POST /payroll/runs).

Steps 3 to 7 also come as files — one upload each instead of one call per person: POST /payroll/imports/{kind}/file with roster, openings (the year so far, the leave opening and the entitlement in one row), allowances and deductions (Payroll files below). Each row goes through the same writer as the call it replaces.

Payroll settings

GET /payroll/settings — the company's payroll policy, the eleven fields of the app's Заплати → Настройки form, and what each resolves to in a month (?period=YYYY-MM; the current month by default):

{ "data": {
  "economic_activity_code": null, "economic_activity_group": null,
  "mod_regime": "standard", "sirv_period_months": null, "sirv_period_start_month": 1,
  "sirv_ktd_reference": null,
  "leave_pay_basis": "art177", "late_sick_recovery": "consent",
  "pays_employer_days_without_stazh": false, "late_leave_recovery": "consent",
  "consented_recovery_pace": "ceiling", "part_time_stazh": "law",
  "resolved": {
    "period": "2026-10",
    "activity_code": "62.01", "activity_follows_company": true,
    "tzpb": { "rate": "0.50", "source": "division", "division": "62" },
    "mod": [ { "qualification_group": 1, "floor": { "amount": "936.00", "currency": "EUR" }, "source": "mod" },
             "…one per group, 1 to 9…" ],
    "sirv": null,
    "hours_rates": {
      "overtime_workday": { "value": "75", "unit": "percent", "source": "company", "legal_minimum": "50",
                            "held": false, "rate_id": "01K…", "effective_from": "2026-08-01" },
      "night": { "value": "0.9303", "unit": "eur_per_hour", "source": "legal", "legal_minimum": "0.9303",
                 "held": false, "rate_id": null, "effective_from": null },
      "…": "…one per kind: overtime_weekly_rest, overtime_holiday, overtime_sirv, holiday_work" } } } }
  • economic_activity_code — a КИД code set apart for the payroll. null, the default, follows the company's own КИД — the code its електронни трудови записи file in т. 21, set in the app (Заплати → Настройки) — and a code naming that same activity is stored as null (62.01, 6201, 62.01 — софтуер alike; a division alone, 62, is not the same — the МОД can key a finer row), so the two cannot drift apart. Set one only when the employer's main activity under the ЗБДОО — „съобразно преобладаващия брой заети лица по трудови правоотношения" (ЗБДОО 2026, Приложения № 1 и № 1А, Забележка 3) — is not the company's code. resolved.activity_code is the code everything below is priced by and resolved.activity_follows_company whether it is the company's own. Its two-digit division sets the ТЗПБ rate: resolved.tzpb.source is division (with the division it was read from), or default — no code at all, or a division the table does not name — which is the highest band, 1.10%. rate is a percentage. This field never writes the company's КИД, so changing it opens no employment record; replacing the company's КИД in the app re-prices every computed month while the payroll follows it.

  • economic_activity_group — an explicit row of the МОД table (Приложение № 1А) that wins over the code: ЦКС, or a row the code cannot reach on its own. Empty follows the code, narrowed one level at a time (62.01 → 62.0 → 62).

  • mod_regime — standard, disability_enterprise (half the МОД) or budgetary (no МОД).

  • resolved.mod — the least an employee of each квалификационна група is insured on: source is mod (the table's cell), mod_half, exempt (budgetary), or mrz — no cell found, the minimum wage. The person's own group is the employee's qualification_group; with none recorded it is read off the first digit of the employee's nkpd_code (the НКПД основен клас — 2512… is group 2); a ДУК with none recorded is group 1.

  • sirv_period_months — СИРВ: 1, 2, 3 or 4 (КТ чл. 142, ал. 3), or 12 with sirv_ktd_reference naming the branch колективен трудов договор of КТ чл. 51б it stands on — its title and date (ал. 4; the НРВПО lists no branch, and the payroll cannot read the agreement: the name is the employer's word) — or null for daily time-keeping. Since round 11 6 is refused — the „до 6 месеца" was repealed on 01.01.2021 — and 12 without the agreement is 422 on sirv_ktd_reference. A 6 (or an unnamed 12) stored before keeps computing as it was, resolved.sirv.problem names it (length, ktd; null when the period is lawful), and every PATCH is refused until it is changed. sirv_period_start_month — the month the periods tile from. resolved.sirv is the period the month falls in (length, from, to, closing when the month closes it, and problem), or null. The period's close compares the worked hours with the norm after the night hours are converted to day hours (НРВПО чл. 9г since ДВ бр. 58/2018 — see The поименен график, below). Since round 11b a change of either field starts a new period: the period in progress when the PATCH is made runs to its end on the setting it began with, and the stored one tiles from the month after — resolved.sirv.pending (null otherwise) is {"months": 2, "start_month": 1, "until": "2026-04-30"}, the setting still in force and its last day. From daily time-keeping the new setting starts this month (the months before stay daily). A setting that began this month and holds no approved поименен график is simply replaced — a correction.

  • leave_pay_basis — how paid annual leave is paid. Every paid-leave day is paid on a line of its own, chl177_paid_leave (quantity the days, rate the day's figure), and the salary pays the days worked. art177 (the default) is the law: КТ чл. 177 — the average daily gross of the last calendar month before the leave with at least 10 worked days, adjusted to the two months' lengths (НСОРЗ чл. 18), with the НСОРЗ чл. 21 supplement for a raise granted back over that month; with no such month, the contract's basic and permanent supplements over the year's average month (чл. 177, ал. 2). art177_or_current_higher pays, per day, the higher of that and what the salary itself pays for the day — lawful because it can only pay more. The line's details.basis says which won (art177, current, or mixed when the days differ). Since round 11 the line's details.chl21_act is the НСОРЗ чл. 21, ал. 2 supplement it holds — an employer-wide act's raise from a date after the base month, on the leave days from that date (Employer-wide pay acts, below): amount, days, acts (id, kind, reference, effective_from, effective_to, percent); absent when there is none. Since round 11b details.civic lists the leaves of КТ чл. 157 and 159 among the line's days (kind, days); absent when there are none. A run's totals.leave_pay_contract_basis names whoever was paid on the contract only because no base month was on file for a person employed before the months the payroll holds — enter the base month with the year so far (PUT /payroll/employees/{id}/year-openings/{year}).

  • late_sick_recovery — what a sick absence for a POSTED month (A month's inputs, below) does with the salary that month paid for the sick days. consent (the default) proposes it for recovery — a recovery carry-forward with cause: "sick", withheld only once you confirm the employee's written consent (КТ чл. 271, ал. 1 and чл. 272, ал. 1); net takes it back in the first open month on its own, for a company that holds that consent already (a clause of the employment contract). The days, the приложение № 9, the employer's чл. 40, ал. 5 pay and the corrective declarations follow at once either way. A month keeps the choice it was first corrected under. The same choice answers for a late maternity, paternity, childcare or father_childcare absence (A month's inputs): КТ чл. 271 and 272 say nothing different of the salary paid for the days of a leave НОИ pays.

  • pays_employer_days_without_stazh (since 2026-10-04) — whether the КСО чл. 40, ал. 5 days of a sick absence marked lacks_benefit_stazh (the person has not the 6 months of чл. 40, ал. 1) are paid all the same. false (the default): НОИ — „Ако лицето няма изискуемия 6 месечен осигурителен стаж, то няма право и на възнаграждение за първите два работни дни" — so those days are days without the right, Д1 т. 16.4, and nothing is paid for them. true, for an employer that pays them anyway (НОИ's Указание № 1029-40-1563/17.02.2016 leaves it free to, as payroll vendors quote it): 70 % of the average daily gross, Д1 т. 16.А.

  • late_leave_recovery (since 2026-10-04) — the same choice for a paid_annual, additional_annual or unpaid absence for a POSTED month (A month's inputs): what that month paid for the leave's days and did not owe — the salary for the days of an unpaid leave, or what the salary paid for the days of a paid leave beyond the КТ чл. 177 pay that replaces it. consent (the default) proposes it for recovery — a recovery carry-forward with cause: "granted_leave", withheld once you confirm the employee's written consent; net takes it back in the first open month on its own. A setting of its own because the case is not a болничен's: the leave was granted by the employer's own order before the month was paid, and an employer may read the missed order as the technical error КТ чл. 272, ал. 1, т. 2 lets it withhold without consent — or may not. The days, the leave pay owed and the corrective Д1 follow at once either way.

  • consented_recovery_pace (since round 8) — how fast a sum the person consented in writing to return is taken back from their pay: a late correction's takeback confirmed with consent (late_recovery on a run's item) and a confirmed termination or pay_cut recovery (termination_recovery). КТ чл. 272, ал. 2 limits „удръжките по предходната алинея" — those withheld WITHOUT consent; a deduction made with written consent is outside it (ЗЗД чл. 105 lets a claim not subject to enforcement be set off with the creditor's consent; д-р А. Александров, „Труд и право"; МТСП ID 5848). ceiling (the default) takes no more a month than the чл. 446 ГПК ceiling leaves after the deductions without consent, never leaving less than one minimum wage — the pace since 2026-10-03; net takes whatever the month leaves to pay after the deductions, the минимална работна заплата not kept, and what it takes counts on no ceiling (late_recovery.outside, termination_recovery.cash_outside). A late correction's takeback follows net when the correction was priced under consent — its takeback rests on a consent confirmed here; one priced under net (the company withholds on its own word, or for a granted leave on КТ чл. 272, ал. 1, т. 2) stays within the ceiling. Since round 9 each correction keeps the mode it was first priced under, whatever the two policies say later (until round 9 the current policies decided — both consent, or none of it), and a month holding both kinds takes the one without consent first. A recovery typed by hand is an overpaid sum withheld without consent and stays within the ceiling at either pace — unless (since round 9) the line carries consented_on, the day the person consented to it in writing: then it follows the pace.

  • part_time_stazh (since round 11b) — how a part-timer's трудов стаж is counted for what the employer grants on it: the paid annual leave (НРВПО чл. 23, ал. 2 — „пропорционално на времето, което му се признава за трудов стаж"), the four months before a first job's leave (КТ чл. 155, ал. 2), the клас (НСОРЗ чл. 12, ал. 2) and the чл. 222, ал. 2 and ал. 3 lengths. law (the default) counts it as КТ чл. 355, ал. 2 does: a day of at least half the statutory working time is a full day of стаж, and a day below half is стаж pro rata to the working time (fte_fraction). The amendment that would have counted every part-time day pro rata from 01.01.2027 (§ 11 ПЗР ЗДБРБ 2026) was declared unconstitutional (Constitutional Court, Решение № 17 of 20.10.2026, к.д. № 15/2026), so this rule continues in 2027 and after. At four hours of eight the statutory leave is the full 20 days; at two hours it is 5, and the клас steps every four years. The statutory part of the leave is prorated; days a leave entitlement agrees above the statutory minimum stay whole. full_time counts every part-time day as a full one for all of these, below half too — more favourable, so lawful. ЕТЗ т. 30 states the стаж the law recognises either way. It re-prices like the first six.

  • resolved.hours_rates (since 2026-10-22, read-only) — what each kind of hours is priced at in the month: overtime_workday, overtime_weekly_rest, overtime_holiday and overtime_sirv (the increase on the hour, unit percent — КТ чл. 262, ал. 1, т. 1–4), night (euro per night hour, unit eur_per_hour — НСОРЗ чл. 8) and holiday_work (the increase for work on an официален празник — КТ чл. 264; 100 is the double). source is company — the company's rate in force, rate_id and effective_from its row — or legal: the statutory minimum (legal_minimum), also when a company rate sits below a minimum that rose since (held: true). Set through Hours rates below, never here.

PATCH /payroll/settings — send only what changes; it is merged onto the stored policy, and the result is validated as the app's form validates it, with one rule of the API's own: an economic_activity_code you send must begin with its two-digit division (text after it is kept), because a code the payroll cannot read a division from is priced at the highest band with nothing to say so. null clears economic_activity_code (the payroll then follows the company's КИД), economic_activity_group, sirv_period_months and sirv_ktd_reference (left out, it is kept); mod_regime, sirv_period_start_month, leave_pay_basis, late_sick_recovery, pays_employer_days_without_stazh, late_leave_recovery, consented_recovery_pace and part_time_stazh always hold a value, and null for any of them is 422 validation_failed.

{ "economic_activity_code": "62.01", "sirv_period_months": 4 }

200 with the policy as GET answers it, and meta.changed — whether anything moved. None of the first six, nor pays_employer_days_without_stazh, nor consented_recovery_pace, nor part_time_stazh, has an effective date: a change re-prices every month not yet posted, so every computed month turns stale — meta.stale lists them; compute them again before posting. A posted month keeps the policy it was computed with, and nothing here is refused because one exists. A PATCH that moves nothing marks nothing. late_sick_recovery and late_leave_recovery re-price nothing: they apply to the months corrected after the change, and meta.stale stays empty for them.

422 validation_failed names the field: an unknown one (a misspelt field silently dropped would be the highest band a company believed it had left), a code with no division, an economic_activity_group the МОД table does not have, a СИРВ length it does not allow, a leave_pay_basis, a late_sick_recovery, a late_leave_recovery, a consented_recovery_pace or a part_time_stazh other than the two, a mod_regime, a sirv_period_start_month, a leave_pay_basis, a late_sick_recovery, a late_leave_recovery, a consented_recovery_pace or a part_time_stazh of null, a pays_employer_days_without_stazh that is not a boolean; and period on GET when it is not YYYY-MM. 400 invalid_json for a body that is not JSON. 409 payroll_busy, as for every payroll write.

nkid_code (since 2026-10-10) — the company's own КИД, four digits (6201 or 62.01), or null: the code its електронни трудови записи file in т. 21 (a month's ЕТЗ package is not ready without it), and the activity the payroll follows unless economic_activity_code sets another apart. The app's Заплати → Настройки sets the same field. Send kid_change with it when a code replaces another: activity (the default) — the company's activity changed, and a change record opens for every employee who follows the company's code; renumbering — the same activity renumbered (КИД-2008 → КИД-2025) or a code typed wrong, and none opens. The answer's meta.employment_records_opened counts the records opened and meta.kid_renumbered says a renumbering was recorded; while the payroll follows the company's code, a new one re-prices the computed months not yet posted (meta.stale). kid_change without nkid_code is 422 validation_failed.

shadow_clearing_account — the account a shadow payroll's net posts to (Employees → Working across borders, below): null is the default, 499 „Други кредитори", which resolved.shadow_clearing_account names. Send an account code of the company's chart — three to eight digits, an account in use (4995 if you keep an analytic of 499 for the foreign employer) — or null for the default; an account the chart does not hold — or 421, the account the wages paid here are owed on — is 422 validation_failed. It moves no figure of a computed month, only where the posting credits a net, so it marks no month stale, and it is saved even when nothing else in the PATCH moves. Which account fits the arrangement with the foreign employer is your accountant's call.

variance_threshold — the change the variance report highlights (GET /payroll/runs/{YYYY-MM}/variance, below): {"percent": "10.00", "amount": null, "default": true} until you set one — 10 % is the default. Send {"percent": …, "amount": …} — a percentage of the month before and/or an amount in euro, each at least 0.01 with at most two decimals (a value that rounds to 0.00 is 422), or null for „not used"; with both, a figure must reach both; with both null, nothing is highlighted — or "variance_threshold": null to go back to the default. "default": true also goes back to the default (an untouched company's read, sent back as it came), and so does {}; "default": false is ignored; any other key inside is 422 validation_failed. It only marks rows of a report: it moves no figure, marks no month stale, and is saved even when nothing else in the PATCH moves.

Employees

GET /payroll/employees — ?active_in=YYYY-MM (everyone employed at any point in the month), ?type=employee|duk|civil_contract|self_insured, ?updated_since=, ?cursor=, ?limit=. ?external_id= returns every employment under that id, newest first, on one page.

GET /payroll/employees/{id} returns one:

{ "data": {
  "id": "01k…", "external_id": "E-1001", "type": "employee",
  "first_name": "Анна", "middle_name": "Петрова", "last_name": "Андреева",
  "first_name_cyrillic": null, "middle_name_cyrillic": null, "last_name_cyrillic": null,
  "names_in_filings": { "first_name": "Анна", "middle_name": "Петрова", "last_name": "Андреева", "proposed": [] },
  "personal_identifier_last4": "0011", "personal_identifier_type": "egn",
  "iban": "BG80 •••• 5678",
  "gross_monthly_salary": { "amount": "2400.00", "currency": "EUR" },
  "pay_basis": "monthly", "hourly_rate": null,
  "contract_currency": null, "contract_amount": null, "pay_in_contract_currency": false,
  "salary_history": [
    { "effective_from": "2019-03-04", "pay_basis": "monthly",
      "basic_monthly_salary": null, "gross_monthly_salary": { "amount": "2200.00", "currency": "EUR" },
      "hourly_rate": null, "contract_currency": null, "contract_amount": null, "pay_act_id": null },
    { "effective_from": "2026-07-16", "…": "the terms from that day on" } ],
  "weekly_hours": "40.00", "fte_fraction": "1.0000",
  "working_time_history": [
    { "effective_from": "2019-03-04", "fte_fraction": "1.0000", "weekly_hours": "40.00",
      "daily_hours": "8.00", "act": null, "act_reference": null } ],
  "active_from": "2019-03-04", "active_to": null,
  "contract_signed_on": "2019-03-01", "contract_start": "2019-03-04",
  "existing_employment": true,
  "employment_record": null,
  "termination": null,
  "…": "every other field POST accepts, under the same name"
} }

employment_record is the person's електронен трудов запис that needs attention — of the ones not yet filed, the one due first; all filed, the latest — or null when none was ever owed (a contract brought over, anybody not on a трудов договор). Read-only; „Employment records (ЕТЗ)" below has its shape and the list of all of them:

"employment_record": { "id": "01k…", "kind": "hire", "event_date": "2026-11-02",
  "due_on": "2026-10-23", "period": "2026-11", "filed": false, "overdue": false,
  "signed_on": null, "effective_from": null, "changes": null }

The ЕГН never comes back whole — personal_identifier_last4 only; you hold the rest. The IBAN comes back masked. Pay fields are money objects — an hourly_rate with its four decimals, a contract_amount in its own currency. salary_history is read-only: every dated set of the salary's terms, oldest first (The salary, below); it may ride along in a PATCH and is ignored. So is working_time_history (since round 11 — The working time, below), and so is reinstates (since round 6): the dismissed employee this one continues after a reinstatement (POST /payroll/employees/{id}/reinstatement, below), or null. personal_identifier_type is how every filing flags the number — the kind you declared, or, for a person entered in the app, the number's own ЕГН check.

POST /payroll/employees — the fields of the employee card in the app: type (employee, duk, civil_contract, self_insured), first_name, last_name, personal_identifier, active_from are required; everything else is optional (middle_name, the names' Cyrillic forms first_name_cyrillic, middle_name_cyrillic, last_name_cyrillic (below), gross_monthly_salary, basic_monthly_salary, iban, email (where a payslip link goes when the company delivers payslips — kept when a PATCH does not send it), position, department_id, nkpd_code, qualification_group, labour_category, weekly_hours, fte_fraction — and, since round 11, the day they took effect and the document, working_time_effective_from, working_time_act, working_time_act_reference (The working time, below) — contract_signed_on, contract_start, contract_end, contract_ground, kid_code, work_ekatte, dependent_children_count, the disability decision, civil_contract_fee and the civil contract's own number, date and subject (below), declared_monthly_income — required for self_insured — and the rest; the salary's terms and their date are under The salary below). Dates are YYYY-MM-DD, amounts at most two decimals.

A summed working time of the person's own (an employee only): sirv_period_months — 1 to 4, or 12 when the payroll settings name the branch колективен трудов договор (sirv_ktd_reference); null follows the company's period. Since round 11 a 6 is refused, and a 6 stored before is refused with any PATCH of the employee until it is changed. Since round 11b a change starts a new period — the person's period in progress runs to its end on the setting it began with — and the employee says so in sirv_period_pending (read-only; null, or {"months": null, "until": "2026-03-31"}, where months is the own length still in force — null when it is the company's). sirv_night_only (since round 11, false by default) — the трудов договор is for night work only: none of the person's night hours is converted to day hours when the period closes (НРВПО чл. 9а, ал. 4; a post on a reduced working time — a full time of fewer than 40 hours a week — converts none either). The person's поименен график is its own resource (The поименен график, below).

Where, and in what activity (an employee only — ЕТЗ т. 21 and т. 22): kid_code is the КИД of the activity the person is engaged in, four digits ("6201" or "62.01"; "0000" for staff in auxiliary activities of an employer with more than one) — null, the company's own code; work_ekatte is the ЕКАТТЕ code of the settlement the place of work is in, five digits ("00000" for work in more than one settlement, "99999" for remote work agreed in more than one place) — null, not recorded, and the record goes out with 00000. Both come back on the employee. Since 2026-10-03 kid_code is also Д1's т. 12.2, „Код икономическа дейност за осигурения" (Н-13), which filed the company's code for everybody until then.

A new трудов договор carries its two dates. For type: "employee", contract_signed_on and contract_start are required unless you send existing_employment: true: the employer owes НАП an електронен трудов запис for the сключване within three days of signing and before the first day of work (чл. 62, ал. 3 КТ; Наредба за вписване в регистъра на заетостта, чл. 10, ал. 1, т. 1 и ал. 3), and its deadline is computed from those two dates. Missing, the create is 422 validation_failed with the field named in details — nothing is written. A duk, a civil_contract and a self_insured person are not in the регистър на заетостта and need neither date — nor does an employee whose public_service is civil_servant or judiciary (below).

middle_name — the презиме. Optional, because not every name has one, but send it whenever the person has one: декларация обр. № 1, т. 7 is „the first letter of the first name and of the презиме", so without it the person's EMPL2021.TXT record carries a caveat and the month's Д1/Д6 filing reports ready_to_submit: false (Filings, below). Since round 11c, not for a person whose identifier is a lnch: a foreign national with no презиме gets the one initial and no caveat („За чуждите граждани, които нямат презиме, се попълва само първата буква от името").

first_name_cyrillic, middle_name_cyrillic, last_name_cyrillic (since round 11c, null by default) — the Cyrillic form of a name typed in Latin letters, as the person's Bulgarian residence document writes it (a foreigner's разрешение or удостоверение за пребиваване carries the names in Cyrillic too — ЗБЛД чл. 21, ал. 2). Д1 т. 6 and 7, the справка по чл. 73, ал. 6, the ЕТЗ's т. 7–9 and НОИ's приложения take names in Cyrillic only: НАП's program refuses a Д1 record whose т. 6 is in Latin („Грешка при структурата на поле 'Фамилия'"), and НОИ a document whose names are. Bulgarian letters only, with a space, a hyphen, a full stop or an apostrophe — anything else is 422 validation_failed on the field. A form is kept only for a name that holds a letter outside Cyrillic; for a name typed in Cyrillic it is stored null. A form is about one spelling: a PATCH that changes last_name without sending last_name_cyrillic drops the stored form (the filings then carry a proposal for the new spelling); a PATCH of anything else keeps it. Like a name, a change marks the person's computed months stale — the files carry it.

names_in_filings (read-only, since round 11c) — the names those filings carry: { "first_name": "Джон", "middle_name": null, "last_name": "Смит", "proposed": [] }. For a name typed in Latin letters with no Cyrillic form it is the app's proposed transcription, and its key is in proposed: each such name puts a caveat on every one of those filings, keeps the Д1/Д6 and the ЕТЗ at ready_to_submit: false, and is a blocks_filing item of the readiness check (person.last_name_cyrillic …). The proposal reads a name the way a romanised Slavic or Turkish name, or an English one, is read — it is wrong for French, German, Spanish and others — so confirm it against the residence document and send the form. It may ride along in a PATCH and is ignored.

template (since the 2026-10 round) — the code (any case) or id of an employee template the company uses (Employee templates, below). What it holds is merged under the body before the body is validated: a field you send wins, null included, and a salary you send replaces the template's whole (its basis, amount and currency are one set of terms); a fixed-term ground with the template's length and no contract_end gets its end. The hire then adds the template's standing allowances and leave entitlement from active_from, and the department it names — found, or created, when the body sends no department_id. Read back as template (read-only): { id, code, name, version, current_version, applied_at } — the version the person was given and the template's own now — or null for a person no template touched. 422 on template for one the company does not use (or archived) and for any type but employee; a term the template holds that this company's own rules refuse is refused like a term you sent (a 12-month sirv_period_months from an account-wide template where the company names no branch КТД — send sirv_period_months: null to follow the company). A create that named a template answers meta.template_notes: what the hire could not give as the template says — leave_raised_to_minimum (the template's basic leave is under this person's legal minimum, 26 days under a ТЕЛК decision of 50%+, КТ чл. 319: saved at the minimum, the template's other days kept) or leave_below_minimum (not saved at all; the person gets the legal minimum) — [] when nothing. A body without template is created exactly as before, with no meta.

Three fields are the API's own:

  • external_id — your id for this employment (≤ 64 printable characters). Unique per company and start date, so a rehire can carry it again.
  • existing_employment: true — the contract is already running; the person is being brought over, not hired today, and its ЕТЗ for the сключване was filed before Autonify. No ЕТЗ deadline is opened, and the answer is kept on the employee (existing_employment comes back on every read): the contract dates sent later, by a PATCH or a re-sync, open none either. Without it, a person with a signing date and a start date gets the three-day ЕТЗ record a new hire owes — for two thousand people hired years ago, two thousand overdue records. A change of the contract after the move is still owed (Employment records, below).
  • personal_identifier_type — egn (the default) or lnch (a ЛНЧ, a ЛН or a служебен номер). The identifier is ten digits; one declared an ЕГН must be a real one — its control digit AND the date of birth its first six digits encode (month 01–12, 21–32 or 41–52, a day the month has). The kind is stored with the employee, and every filing follows it: Д1 т. 5.1, the ЕТЗ т. 6, the НОИ приложения's FlagEGN and the справка по чл. 73's type code. A ЛНЧ passes the ЕГН control digit about one time in ten, so send lnch for every one — undeclared, the number is read by the ЕГН check, and a ЛНЧ that passes it would be filed as an ЕГН.
  • born_before_1960 decides the ДЗПО-УПФ split on Д1 and Д6. For an ЕГН it is read off the number — the date of birth it encodes — and what you send is ignored, every time the employee is written (a wrong value stored earlier is corrected on the next write). Send it only for a lnch, whose number states no date.
  • upf_opt_out_from, upf_resumed_from, ppf_opt_out_from (since 2026-10-06, null by default) — the person chose фонд „Пенсии" instead of a универсален пенсионен фонд (КСО чл. 4б) or a професионален one (чл. 4в), with an increased contribution the size of the УПФ or ППФ one. upf_opt_out_from is the first day insured so — „от първо число на месеца, следващ месеца на избора" (чл. 4б, ал. 3); upf_resumed_from the first day back in a УПФ, for a person who resumed it (чл. 124а); ppf_opt_out_from the first day of the ППФ choice, which is made once (чл. 4в, ал. 1 and 2). Each is the first of a month, 2015-01-01 or later (2016-01-01 for the ППФ one). 422 validation_failed names the field the law does not allow: a date that is not a first; the УПФ choice for a person born before 1960, who is in no УПФ (чл. 127, ал. 1); a return with no choice, or not after it; the ППФ choice for anybody but an employee, and a new one without labour_category first or second (one recorded earlier stays when the category changes). Nothing a month computes, declares or pays moves with them: Д1 keeps the rate in т. 26 (т. 25), Д6 the amount in т. 12 (т. 13), and it is paid to НАП's ДЗПО account with the second pillar (Наредба of ПМС № 175/2018, чл. 2, ал. 4), which НАП forwards to НОИ. What changes is whose money it is: the фиш names the share as фонд „Пенсии"'s, and the register, the cost report and the year to date say how much of fund_upf, employer_upf and employer_ppf is (*_to_pension, „Reports"). A change turns no month stale.
  • unpaid_leave_insured_elsewhere (an employee, since 2026-10-04, default false) — the person is health-insured on another ground through an unpaid leave (another employer, a pension, studies). The health contribution for the days of an unpaid leave (ЗЗО чл. 40, ал. 1, т. 1, б. „б" — 8 % of half the self-insured МОД over the unpaid working days, the employee's own) is then not owed here; otherwise each run computes it (health_unpaid_leave on its items, Д1 т. 27/28 — and a вид осигурен 28 record for the days past the year's 30, since 2026-10-04).
  • duk_main_workplace (a duk, since round 11b, default null) — whether the company is the manager's main place of work. НСИ's quarterly отчет counts a manager under a договор за управление и контрол in Раздел I and II when it is (the form's Указания т. 1 — „вкл. управителите и изпълнителните директори, на които основното работно място е в отчетната единица") and leaves one whose main place of work is elsewhere for код 5200 (т. 17). true, false, or null — not stated, counted as the company's and named on the отчет. Sent for anybody but a duk — false as much as true — it is 422 validation_failed on duk_main_workplace, never dropped; a PATCH of anything else keeps it. It prices nothing, so a change turns no month stale.
  • public_service (an employee, since 2026-10-28, default null) — an employee in public service, insured on КСО чл. 4, ал. 1, т. 2, 3 и 10: civil_servant (a държавен служител по ЗДСл — Д1 вид осигурен 05), judiciary (a judge, prosecutor, investigator, state bailiff, registry judge, member of the ВСС or inspector of the ИВСС, or a candidate for junior magistrate по ЗСВ — вид осигурен 24) or court_staff (a съдебен служител по ЗСВ — вид осигурен 24, on a трудов договор). It changes three things. The split of the contributions, by the month the pay is for (КСО чл. 6, ал. 5а; dated rows payroll.public_service_* of the legal parameters): until 31.07.2026 every contribution is the employer's and the employee pays none; from 01.08.2026 to 31.12.2026 the employee pays 6.50 % (pension 3, or 4 born before 1960; УПФ 1; ОЗМ 0.7; unemployment 0.2; health 1.6 — the 80:20 of ЗБНЗОК 2026 § 20, also on the employer-paid sick days) and the employer 25.80 % plus ТЗПБ; from 01.01.2027 the ordinary 13.78 / 18.52 (ОЗМ and unemployment 60:40 by ал. 5а, т. 2; УПФ and health on the general rule — those 2027 rows are evolving). The floor is the minimum wage, never the МОД of the activity (applied_floor_source public_service). Д1: т. 12.1–12.3 are blank, and т. 29/30 only for court_staff. A civil_servant or a judiciary person is on no трудов договор: no ЕТЗ is opened for them, contract_signed_on and contract_start are not required, the service ends by PATCHing active_to (their termination is 422 use_active_to), and no обезщетение of the Кодекс на труда is offered at the end — pay those of ЗДСл or ЗСВ as one-off lines. Sent for anybody but an employee it is 422 validation_failed on public_service; beside it a labour_category other than third (on labour_category), is_teacher: true (on is_teacher) and, for a civil_servant or a judiciary person, a contract_ground, termination_ground, kid_code or work_ekatte (on that field) are 422 validation_failed too — refused, never dropped. A PATCH of anything else keeps it. A change prices every open month again; a posted month keeps the kind it was declared under — a run's line carries it as its own public_service. Not offered: the military and the state officials of the МВР, ДАНС and ДАР (КСО чл. 4, ал. 1, т. 4 — вид осигурен 06, 17, 83), whose contributions stay wholly the state budget's (чл. 6, ал. 5) and go to фонд „Пенсии за лицата по чл. 69"; any other value is 422 validation_failed.

A граждански договор names its contract — three optional fields of a civil_contract person, printed on the приемо-предавателен протокол (see „Runs") and moving no figure, so a change turns no month stale:

Field
civil_contract_number the contract's number as the parties wrote it (≤ 60 characters)
civil_contract_date YYYY-MM-DD. Left empty, the protocol gives the person's start — contract_start, else active_from — and GET returns it empty
civil_contract_subject the work, in the parties' words (≤ 500) — „Изработка на уебсайт"

Sent for anybody but a civil_contract person they are 422 validation_failed, never dropped.

An existing employee carries history in three fields. active_from and contract_start are the dates the employment really began — years ago, not the day of the move: the compensations at its end and the ЕТЗ record are counted from them. recognised_experience_months is the стаж recognised when the person was hired (НСОРЗ чл. 12, ал. 4), not today's total: the payroll adds the months served since contract_start for the клас allowance, so an HRIS's current total counts those years twice and overpays клас.

Two read-only objects, as of a day. Every employee read (GET /payroll/employees, GET /payroll/employees/{id}, and the answers of POST and PATCH) carries, as of ?as_of=YYYY-MM-DD (Sofia's today when absent; a malformed date is 422 validation_failed):

  • salary_in_force — the salary terms in force that day (as_of, effective_from of the dated row they come from, pay_basis, basic_monthly_salary, gross_monthly_salary, hourly_rate, contract_currency, contract_amount, pay_act_id); null for a civil_contract or self_insured person. The top-level salary fields stay what they always were — the latest dated terms, even when dated ahead — so a raise entered for next January is basic_monthly_salary today and salary_in_force from January.
  • seniority — the клас said in full, by the engine's own count: recognised_months (the стаж recognised at hire), months_here, total_years and total_months, percent_per_year and its percent_source (person — the card's class_percent_override; company — the company's rate, Seniority rates; legal — the minimum), company_rate (the company row in force, or null), current_percent (years × percent), next_step_on, next_years and next_percent (at the rate in force on that day; null when the employment ends first), basic and amount (the клас of a whole month on that day's salary; null where the month prices it on its hours, converts it, or an explicit клас pay line is paid instead — explicit: true). null for anybody but an employee.

Both ride along unchanged when a read is sent back in a PATCH.

curl -X POST https://app.autonify.bg/api/v1/payroll/employees \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: hris-hire-E-1001" \
  -H "Content-Type: application/json" \
  -d '{ "external_id": "E-1001", "type": "employee",
        "first_name": "Анна", "middle_name": "Петрова", "last_name": "Андреева",
        "personal_identifier": "8501010011", "iban": "BG80BNBG96611020345678",
        "gross_monthly_salary": "2400.00", "active_from": "2019-03-04",
        "contract_signed_on": "2019-03-01", "contract_start": "2019-03-04",
        "existing_employment": true }'

201 with the employee. Safe to send again, with a new Idempotency-Key, on every re-sync:

  • the same external_id and active_from with identical data → 200 and the employee that exists; nothing is written;
  • the same external_id and active_from with different data → 409 employee_exists, details.id — change it with PATCH;
  • the same ЕГН on the same type of relationship over overlapping months → 409 employee_exists, details.id. Without this, a create retried without its external_id would put one ЕГН on Д1 twice.

A different personal_identifier_type is different data too (409 employee_exists on the same external_id): change it with PATCH.

PATCH /payroll/employees/{id} — send only what changes; it is merged onto the stored employee and the result is validated as a create would be. The identifier is checked only if you send one — against the personal_identifier_type you send with it; without one, a new number is checked, and stored, as an ЕГН, and the number already stored keeps its kind — or if you declare the stored one an ЕГН: personal_identifier_type: "egn" on a number that is not a real ЕГН is 422 validation_failed on personal_identifier_type. 409 external_id_taken when another employment already carries the external_id with the same start date; 409 employee_exists when the change would duplicate another person's employment. A body that is not JSON is 400 invalid_json.

The ЕТЗ for the сключване follows the PATCH. An employee hired without the two contract dates (on the app's card, or through this API before it required them) gets the record the moment a PATCH supplies them — unless the employee is existing_employment. Dates corrected while the record is not yet filed move its deadline with them; a filed record keeps its date. existing_employment can be PATCHed: true takes back a hire record that was opened by mistake for a contract filed elsewhere — while it is not filed; a filed one stays, as the регистър holds it — and false opens one from the dates on file.

A change of the contract owes an ЕТЗ of its own. A PATCH that changes an employee's основание (contract_ground), the срок of a fixed-term contract (contract_end), the salary's terms, the nkpd_code, the kid_code, the place of work (work_ekatte — the settlement; another workplace in the same one is not a change) or the working time (weekly_hours, fte_fraction) — and a leave entitlement that changes an agreed figure on file — opens an ЕТЗ for an изменение (тип на документа 2), due three days after the допълнително споразумение was signed (Наредба за вписване в регистъра на заетостта, чл. 10, ал. 1, т. 3). Two optional fields say what only the agreement knows:

Field
change_signed_on the day the допълнително споразумение (or the заповед) was signed — ЕТЗ т. 16, the day the three days run from. Never guessed: until it is sent, the deadline is counted from the earlier of the day the change takes effect and the day you sent it, and the record cannot be filed. Since round 11b it also makes a change of a contract brought over (existing_employment) taking effect on its first day here (active_from) an изменение with a record — as naming the pay_act_id it executes does; without either, that change corrects what was entered
change_effective_from the day the change takes effect — т. 16А. Left out, a working-time change's working_time_effective_from when you send one (since round 11), else a salary change's own salary_effective_from, else today

Changes taking effect on the same day are one agreement and fold into one record; a PATCH that undoes a pending change takes its record back. Not a change at all, and opening nothing: a field filled for the first time (an nkpd_code typed in after the move); a change taking effect on or before the contract's start while its hire record is not yet filed (a correction of the contract being registered); the same working time written another way (8 hours a day and 40 a week). A business trip and a remote worker's move under чл. 107з, ал. 8, второ изречение КТ are not a change of the place of work (чл. 10, ал. 2 of the наредба) — do not send them as work_ekatte. A change of the COMPANY's КИД (Заплати → Настройки in the app) opens a record for every employee whose kid_code is null, the company's code being theirs — unless the person replacing it says the activity is the same: a code renumbered (КИД-2008 → КИД-2025) or corrected opens none, and the replacement is noted on the company's change log instead. Records opened by mistake are withdrawn together on the app's payroll page. „Employment records (ЕТЗ)" below lists the records and sets or withdraws a change's facts afterwards.

The active window is not a free field. A start or an end moved inside a posted month is 409 period_posted (details.months) — ending a duk, civil_contract or self_insured person on the last day of a posted month is fine. A трудов договор is ended through the termination below, never by PATCHing an end onto an employee who has none, or moving their end earlier (422 use_termination) — the employee card in the app refuses it the same way. An end moved LATER — a fixed-term contract extended, a date corrected upwards — is a PATCH of active_to and contract_end, and active_to: null reopens the employment; both still answer 409 period_posted when the old end sits in a posted month. Once terminated, its active_to and contract_end follow the ЕТЗ record (409 already_terminated, details.terminated_on). So does termination_ground (since round 7): a PATCH that changes the ground of a recorded termination is 409 termination_ground_recorded (details.terminated_on, details.termination_ground, details.filed, details.correct_with) — until round 7 it was written past the termination, and a termination already filed with НАП got no correction in the register. Correct it through the termination (PUT /payroll/employees/{id}/termination with the same terminated_on — a filed record gets its correction, код 1) or, for a court's correction, PUT /payroll/employees/{id}/termination/ground. A PATCH that sends the ground as it stands goes through, and an employee with no termination recorded keeps the field.

The salary is dated. A change of the salary's terms — basic_monthly_salary, gross_monthly_salary, pay_basis, hourly_rate, contract_currency, contract_amount — applies from salary_effective_from (YYYY-MM-DD) onward. A raise from 16 July pays the old salary for July's working days before the 16th and the new one from it: the basic and the клас are each paid on their own part of the month's working days (salary × those salaried days ÷ the month's working-day norm), so an absence reduces only the part it falls in, and the run's row says so in salary.segments. Only the computed months from the date turn stale.

  • Left out, a change applies from the first day after the company's last posted month — from active_from when nothing is posted — which is what an undated change always did; and never from before the latest dated change, so a second change sent without a date corrects that one rather than replacing it and everything before it.
  • A date inside a posted month, or before one, is 409 period_posted with details.months and details.first_open, the earliest date a change may take: a posted month paid the old salary and is final — unless you send "retro": "pay_in_open_month". Then the salary is recorded from its real date, and the difference each posted month should have paid is paid in the first open month as a retro_pay line, with its contributions and tax priced as the month it is for (see Corrections below). A change that pays a posted month LESS is saved too (since 2026-10-04 — it was 422 retro_lower), and what each such month paid above the new salary is a proposed recovery: listed in the response's meta.recovery_proposals (id, for_period, settle_period, amount, and since round 9 past_deadline — what confirming it would re-declare past 30 April of the year after it, null for a month the person still works in, whose recovery is withheld before tax from the month that pays it and re-declares nothing) and in the carry-forwards read as a recovery with cause pay_cut. Nothing is withheld until you confirm it with the employee's written consent on PATCH /payroll/carry-forwards/{id} (КТ чл. 271 and 272; see Corrections); dismissed, the posted months keep what they paid.
  • A change applies from its date on: a later change it reaches is replaced (send it again if it still stands). The terms already in force, sent again, change nothing; salary_effective_from with unchanged terms changes nothing.
  • On POST it dates the first row — for a person brought over, the day their current salary took effect (active_from by default).
  • salary_history lists the terms by date, oldest first, each in force until the next one's date (the first also covers any earlier day).
  • pay_act_id (since round 11) — the employer-wide act a change executes (Employer-wide pay acts, below — a ПМС, a КТД or the employer's вътрешен акт; НСОРЗ чл. 21, ал. 2), read on each salary_history row. On a PATCH that changes the terms it is written on the change's row (null: an individual raise); with the terms unchanged and salary_effective_from the date of a row already there, it names that row's act, or null takes it off — a posted month whose leave the act now reaches is priced again (cause pay_act on the carry-forwards). Left out, a row keeps what it names. Another company's act is 422.

The working time is dated (since round 11). A change of fte_fraction or weekly_hours — an employee's or a duk's — applies from working_time_effective_from (YYYY-MM-DD) onward, as the salary does, and the employee carries working_time_history. Every month reads the working time it was worked on: its норма in hours and the hourly base of its overtime (each working day at that day's hours — НРВПО чл. 9б, ал. 1), the share of a full time its minimum insurable income is prorated by, Д1 т. 16 позиция 4 (a month the working time changed in states the average of its days' hours, rounded half-up — Наредба № Н-13, Приложение № 1), the hours on приложение № 9 and № 10, НСИ's full-time equivalents and the УП-3's conversion of a part-timer's days. Until round 11 every month read the working time the person had the day it was read: a posted month priced again — a raise dated back over it — divided its overtime by today's норма, and its corrective Д1 declared today's daily hours. Only the computed months from the date turn stale.

  • Left out, a change applies from the first day after the company's last posted month (from active_from when nothing is posted), and never from before the latest dated change — the salary's rule.
  • A date inside a posted month, or before one, is 409 period_posted with details.months and details.first_open — and retro does not open it: a posted month's working time is what it paid, insured (its minimum insurable income is proportional to it) and declared. Record the change from the first open day; its ЕТЗ can still state the agreement's own day (change_effective_from); and pay what a late agreement owes the posted months through the salary, dated back with retro.
  • working_time_act names the document behind the change: agreement (a допълнително споразумение, КТ чл. 119 — the default for a change), order (a заповед, КТ чл. 138а) or contract (the contract itself — the default on POST); working_time_act_reference its number and date (≤ 120 characters). A temporary change (a чл. 138а order, an agreement „за определено време") is two changes: the change from its first day and the return from the day after its last.
  • On POST, working_time_effective_from dates the first row — for a person brought over, the day their current working time took effect (active_from by default).
  • The change's ЕТЗ takes effect (т. 16А) on change_effective_from when you send it, else on the working_time_effective_from you send, else as before — a salary change's own date, else today. A working time and a salary changed in one PATCH from two different days you name are two agreements, and two records.
  • working_time_history lists the working time by date, oldest first, each row in force until the next one's date (the first also covers any earlier day): effective_from, fte_fraction, weekly_hours, daily_hours (a fifth of the week, else 8 × the share), act (null for the row the history began with — the working time on file when it was first dated, from active_from) and act_reference. Read-only; it may ride along in a PATCH and is ignored.
  • 422 validation_failed names working_time_effective_from (not a YYYY-MM-DD date), working_time_act (none of the three) and working_time_act_reference (longer than 120 characters).

Pay by the hour — pay_basis: "hourly" with hourly_rate (euro, at most four decimals); an employee on a трудов договор only (КТ чл. 247 — a duk is 422 on pay_basis). The month's basic pay is its worked_hours × the rate, with the клас on it; paid leave, which the hours do not cover, is paid on its own line (chl177_paid_leave, КТ чл. 177). A month with an hourly employee and no worked_hours is not computed (409 salary_inputs_missing); 0 is an answer. worked_hours is the hours within working time — overtime goes in the overtime buckets and is paid the hour plus its uplift on the hourly rate; under summed working time (СИРВ) send every hour worked, and the period close pays the over-norm hours their uplift only (the rate already paid the hour). A rate below the minimum hourly wage (3.74 EUR from 1 January 2026, ПМС № 243/2025) is flagged — salary.below_minimum_hourly_wage on the run — never lifted. When the rate changes inside a month, the month's hours are split between the rates in proportion to the working days on each side of the change. The МОД floor follows the contract's working time as the month was worked on it (fte_fraction — the working time is dated, above) and the recorded absences, as for everybody: hours not worked with no absence recorded do not lower it.

A salary agreed in another currency — contract_currency (ISO 4217: the ECB's reference currencies, or BGN at its fixed 1.95583) and contract_amount, the monthly salary — or, on the hourly basis, the rate per hour — in that currency; the euro salary fields are then empty, and "EUR" is simply euro. Every statutory figure stays in euro: each month converts the amount once, to cents (a rate per hour to four decimals), at the ECB reference rate of the month's last day — on a weekend or a TARGET holiday the last one published before it; for a month still running, the latest published so far, marked provisional (compute it again after the month ends). No rate published within 14 days of that day refuses the month (409 salary_inputs_missing, reason: rate_missing). The run's row keeps the amount, the rate, its day and the month's net converted back into the contract currency. The date rule is our reading, not a finding: the acts convert foreign-currency income at the rate of the day it is acquired, and a monthly wage is taken as acquired on its month's last day. Confirm it with an adviser before relying on it for a filing.

Paid in that currency — pay_in_contract_currency: true (default false, only with a contract_currency) pays the person's amount payable — the net less the month's deductions, as the run stores it in euro — in the contract currency, converted at the month's own rate and rounded to the currency's minor unit. register.csv's pay_amount for the person is then that amount, with pay_currency, pay_rate and pay_rate_date; the bank file pays it in a block of its own from a company account in that currency; the run's salary.contract.paid and the фиш say so. A garnishment withheld from it is still remitted in euro. Changing the choice marks no month stale — like the IBAN, it is read when the documents are made. Moving the salary back to euro turns it off.

422 validation_failed names hourly_rate (an hourly employee without one, or more than four decimals), pay_basis (hourly for anyone but an employee), contract_amount (a currency without it), contract_currency (one the ECB does not quote), pay_in_contract_currency (true for a salary in euro) and salary_effective_from (not a YYYY-MM-DD date).

A corrected name, ЕГН or personal_identifier_type marks the months too: they price nothing, but a computation stores its Д1 and НОИ files with them, so the months turn stale and their recompute writes the files again. The iban, position, department_id and external_id mark nothing.

Working across borders — four facts, each for an employee or a duk only: sent for a civil_contract or a self_insured person they are 422, never dropped. Every default is the domestic answer, so a person with none of them computes as before.

  • tax_resident (default true) — ЗДДФЛ чл. 4. false asks for non_resident_tax, the treatment of the month's tax — always stated, never assumed: withhold (the чл. 42 withholding, as for a resident) or treaty_exempt (a double tax treaty gives the right to tax the pay to the other state, and nothing is withheld here), which requires tax_treaty_reference (≤ 160: the treaty and its article). Optional: tax_residence_country (ISO 3166-1 alpha-2). true again clears all three. Whether a treaty's conditions are met, and the documents ДОПК чл. 135–142 ask for, are the employer's to establish and keep — confirm with an adviser: the payroll records the choice, it does not make it. A treaty_exempt person is left out of the годишно преизчисляване по чл. 49 (it would take the whole year's tax back in January), and Д1 carries a caveat for them.
  • An A1 certificate — a1_country (a state of Регламент (ЕО) № 883/2004 other than Bulgaria: the EU, IS, LI, NO, CH), a1_valid_from (required with it), a1_valid_to (empty: open-ended), a1_certificate_number. While it covers the person no Bulgarian contributions are due, the employee's or the employer's. A certificate that starts or ends inside a month covers the working days on its side of the date: the insurable income and the МОД floor are both taken in the proportion of the month's working days insured here (an A1 to the 14th of a month of 21 working days: 11/21), the monthly cap stays whole, and the pay is taken as earned evenly over the working days. A month it covers whole goes to Д1 under вид осигурен 90 with only т. 31 and т. 31а (the tax), as НАП's указания have it; a month it covers in part goes under the ordinary code, т. 14/15 being the days insured here, and the Д1 file names the day counts of т. 16 to correct by hand. The run's row says which — the item's international.a1 on GET /payroll/runs/{YYYY-MM}.
  • payroll_mode — paid (default) or shadow: a shadow payroll, the month computed and declared here as for anybody, the net paid abroad by a foreign employer. Nothing is paid from it — amount_payable is 0.00, no deduction is withheld, its register.csv row carries no transfer — and so it is not in the SEPA bank file either — and payment initiation refuses it; its net posts to the clearing account (Payroll settings, above) instead of 421. The cost is the company's as for anybody.

GET answers all of them, and department — the department department_id names (id, name, cost_center, archived), read-only; it may ride along in a PATCH. A department_id of an archived department is 422 on department_id for anybody not already in it. Changing any of the four marks the person's computed months stale, as a salary change does; department_id still marks nothing — a month records the department it was paid under, and a month not yet posted follows a move (a posted one keeps what it recorded).

POST /payroll/employees/{id}/termination — terminated_on (the LAST day of the contract), termination_ground (ЕТЗ т. 27), and optionally notice_unserved_days, pension_entitled, chl222_paid_before. It records the чл. 62, ал. 5 ЕТЗ termination (due in seven days), ends the employment and puts the обезщетения due in the month's payroll.

  • The ground is required unless the employee already has one on record (a re-send of the date keeps it). It decides every обезщетение but чл. 224 — чл. 220, 221, 222 and 331 — so a termination without one would pay the leaver nothing else and say nothing. With none sent and none on record the answer is 422 termination_ground_required (details.field, details.other = 064): send the article, or 064 (друго) when none of the listed grounds is it. About the employee's card as much as your body — a ground PATCHed onto the employee answers it too — so it is never memoised (§3).

  • 201 the first time. Once per employment: the same date again is 200 (a changed ground or compensation fact is written; one you leave out, or send as null, keeps its recorded value); another date is 409 already_terminated with details.terminated_on — a retry of the original can never rewrite it. A wrong date is corrected with PUT below.

  • A date before the person's active_from is 422 validation_failed on terminated_on; the same day is a one-day employment.

  • Only a трудов договор is terminated here. A duk, civil_contract or self_insured person ends by PATCHing active_to: 422 use_active_to — and so does an employee whose public_service is civil_servant or judiciary (details.public_service names it): no ground of the Кодекс на труда and no ЕТЗ end a служебно правоотношение.

  • A date in a posted month, or before one, is 409 period_posted — that month already paid a full salary — unless you send "settle": "first_open_month" (the leaving month itself posted): then the ЕТЗ record is written all the same (its seven days run from the leaving date), the posted months stay as they were paid, the обезщетения are paid in the first open month (termination.settle_period), and each posted month that paid salary after the end becomes a proposed recovery — never withheld until you confirm the employee's consent (Corrections below).

  • A key the termination does not have (a misspelt notice_unserved_day, a pension_entiteld) is 422 validation_failed naming it; the answer's own record_due_on and filed may ride along.

PUT /payroll/employees/{id}/termination — the same body; records or corrects. With no termination yet it records one (201). Otherwise another date is a CORRECTION: the ЕТЗ record's date and its seven-day deadline, the employment's active_to and contract_end all move together, and every computed month the old or the new date reaches turns stale. A ground or compensation fact you leave out keeps its recorded value. A correction can put the person back on payroll (since 2026-10-19): a termination day that has passed, moved to today or later, makes them count again — past the plan's limit of people on payroll that is 403 employee_limit_reached with the PATCH's details (§5, „Payroll error codes"), nothing moves, and the same request succeeds once the slot is bought on /billing; a day moved earlier, or one that still counts, asks nothing. A filed record the регистър refuses to correct here (below: employment_record_filed_elsewhere, employment_record_correction_pending) answers that refusal first, at the limit or not — a slot would not change it.

A FILED record is corrected too (the employee's termination.filed). The employment, the payroll months, the posted-month rules and settle move exactly as above; the record keeps the day it was filed with (the регистър holds it — GET /payroll/employment-records still shows that event_date), and what НАП is owed is its correction: т. 26 is not among the точки код корекция 1 may not touch (Наредба за вписване в регистъра на заетостта, Приложение № 1, т. 2), so a new date — or a new termination_ground, т. 27 — prepares one record with код корекция 1 carrying every точка, т. 25, 30 and 31 following the new day. It goes into the package of the day it was prepared and is listed in the answer under termination.record_corrections (the rows GET /payroll/employment-records shows, kind: "correction"); the employee's termination.terminated_on is the new day. Moved again before that package goes, the waiting correction is replaced; moved back to the day filed, it is taken back and none is owed. Refused, moving nothing: 409 employment_record_filed_elsewhere (no package prepared here carried the record, so what it was filed with is unknown — correct it in the portal) and 409 employment_record_correction_pending (the record's заличаване waits to be filed — file it or take it back first).

DELETE /payroll/employees/{id}/termination — withdraws it (a resignation taken back, a termination sent for the wrong person): the record goes, active_to and contract_end are cleared (a fixed-term end the termination overwrote is PATCHed back), and the ground and compensation facts go with it. 200 with withdrawn: true, or withdrawn: false when there was nothing to withdraw — and only while the ЕТЗ record is not filed with НАП: a filed one is 409 termination_filed (details.terminated_on), the регистър holding it. Both refuse a date or an end in a posted month (409 period_posted) unless settle carries it, as above. A withdrawal puts the person back on payroll when the termination's day has already passed (since 2026-10-19): past the plan's limit of people on payroll it is 403 employee_limit_reached with the PATCH's details (slots_needed, slot_price_minor, billing_url — §5, „Payroll error codes"), nothing is withdrawn, and the same request succeeds once an Owner or Admin has bought the slot on /billing; a termination whose day is today or later asks nothing — the person still counts.

PUT /payroll/employees/{id}/leave-opening — the unused days of each leave year on the day Autonify starts keeping the person's leave. Without it, a person brought over mid-year has no leave balance, and the чл. 224 compensation at their termination is short.

{ "as_of": "2026-10-01",
  "leave_years": [ { "year": 2025, "days": "4" }, { "year": 2026, "days": "12.5" } ] }

It replaces any earlier opening whole — the same opening again writes nothing and marks nothing stale. Employees on a трудов договор only (422 not_an_employee). 422 validation_failed names as_of when it is before the person's active_from, leave_years when the years do not include the year of as_of or include a later one, and any key an opening does not have (leave_years.0.day).

Employment records (ЕТЗ)

Since 1 June 2025 every сключване, изменение and прекратяване of a трудов договор is entered in НАП's регистър на заетостта as an електронен трудов запис (ЕТЗ) — чл. 62, ал. 3 КТ and the Наредба за вписване в регистъра на заетостта (amended ДВ бр. 54/2026): three days after the contract or the допълнително споразумение is signed (a hire's also before the first day of work), seven days after the termination. Autonify tracks each one as a record with its deadline, and prepares the file НАП takes. The file reaches НАП through its portal with a КЕП or a ПИК (the default) or, when the company's API route (automation.auto_submit_filings) is on, over НАП's declarations API, signed with the person's КЕП: POST /payroll/employment-register/{YYYY-MM}/submit (§5, below) or the app's own ЕТЗ card.

Which doors open a record. A hire with both contract dates (hire); a change of the contract's terms — the PATCH above, the app's card, the month's inputs file, a leave entitlement (change); a termination (termination). A contract brought over (existing_employment: true) owes no hire record, but its later changes and its termination are owed like any other.

GET /payroll/employment-records — ?period=YYYY-MM (the month of the event), ?employee=, ?kind=hire|change|termination|correction, ?filed=true|false, ?cursor=, ?limit=. One row per record:

{ "id": "01k…", "employee": "01k…", "external_id": "E-1001", "kind": "change",
  "document_kind": "change", "correction": null, "corrects": null,
  "event_date": "2026-10-19", "due_on": "2026-10-22", "period": "2026-10",
  "filed": false, "overdue": false,
  "signed_on": "2026-10-19", "effective_from": "2026-11-01", "changes": ["salary", "position"] }
  • due_on — the deadline. A hire's is the earlier of three days after contract_signed_on and contract_start; a change's three days after signed_on (or, while that is unknown, after the earlier of the day it takes effect and the day it was recorded — so a change dated back reads as overdue until you send its signed_on); a termination's seven days after it.
  • filed — the record went to НАП: a package that carried it was moved to submitted or accepted (POST /filings/{id}/transition). filed is read off the packages, not stored, so ?filed= filters each page after it is read: a page may hold fewer rows than limit — follow next_cursor until it is null.
  • changes (a change only) — what it changed: ground (основание), term (срок of a fixed-term contract), salary (основно трудово възнаграждение), position (the НКПД code — a new title on the same code is not a change), activity (the КИД code, т. 21), place (the place of work, т. 22), working_time, leave (уговорен платен годишен отпуск).
  • signed_on / effective_from (a change only) — т. 16, the day the допълнително споразумение was signed, and т. 16А, the day it takes effect.

PATCH /payroll/employment-records/{id} sets what only the agreement says on a change that is not yet filed: signed_on, effective_from and ground — т. 12, the code of the leading change. One agreement changing several terms is ONE record carrying the code of the change it names as leading; left unset, Autonify files 021 (срок, длъжност, отпуск, място) over 020 (работно време) over 019 (основно възнаграждение) — null puts that default back. signed_on moves the deadline with it. Unknown fields are 422 validation_failed; an unfiled hire or termination is 422 not_a_change_record (a hire's dates are the employee's contract_signed_on and contract_start, a termination's its own door).

A filed record is corrected with the same PATCH. On a record that went to НАП — a hire, a change, a termination, or one filed anew — the PATCH prepares its correction (Наредба за вписване в регистъра на заетостта, чл. 13, ал. 2 and Приложение № 1, т. 2): the record restated from the data as it now stands — a hire or a termination from the employee (send no body: the agreement fields are 422 not_a_change_record there), a change with the signed_on, effective_from and ground you send (the rest as it was filed, its terms read off the employee when it is their latest change) — and compared with what it went to НАП with. Only non-key точки differ: one record with код корекция 1, carrying every точка. A key точка differs (т. 1, 3–10, 12 or 16 — a name, the identifier or its kind, the contract date, the основание, the agreement date): a заличаване (код 2) and the record filed anew (код 0), in that order. A record whose заличаване is filed is filed anew by the same PATCH. The answer is the record with the rows prepared:

{ "data": { "id": "01k…", "kind": "change", "filed": true, "…": "…",
  "corrections": [
    { "id": "01k…", "kind": "correction", "correction": "delete", "document_kind": "change",
      "corrects": "01k…", "event_date": "2026-10-20", "due_on": "2026-10-23",
      "period": "2026-10", "filed": false, "overdue": false },
    { "id": "01k…", "kind": "correction", "correction": "refile", "…": "…" } ] } }

Each prepared row goes into the package of the day it was prepared — the month's own, or a follow-up — with its точки frozen. A correction on your own initiative has no deadline (чл. 13, ал. 2); its due_on is three days — the term when the labour inspectorate or НАП found the discrepancy (ал. 1) — and it is never overdue. Since round 7 a row prepared for a court decision is the exception: the заличаване a reinstatement or an annulment prepares (due seven days after the act) and the new termination after an annulment (seven days after its day) carry the law's deadline and are overdue once past. The contract date (т. 10) is corrected after its three days only on the inspectorate's instruction (ал. 2), which the package says. Refusals: 409 employment_record_unchanged (nothing differs — correct the employee, or send the corrected facts, first), 409 employment_record_correction_pending (details.corrections — file the one prepared, or take it back), 409 employment_record_filed_elsewhere (no package prepared here carried it, so what it was filed with is unknown: correct it in the portal), 409 employment_record_refiled (details.id — correct the record filed anew), 409 employment_record_has_later_records (below), 409 employment_record_stale_refile (details.records — a hire's key correction, while a change or termination of the same contract prepared to be filed anew still carries the contract's old т. 1, 4–10 — and т. 12, for a termination: take that one back and prepare it again, then the hire), 422 employment_record_is_correction (a prepared correction is filed as it was prepared: take it back and prepare it again).

In what order the package files them. НАП processes the file record by record, so the package puts them in the order the наредба needs, whatever day each was prepared: the заличавания of changes and terminations first, then those of hires, then hires — filed for the first time, filed anew, or with код 1 — and last changes and terminations of registered contracts, regular or filed anew. So a hire taken out and filed anew and a change of it taken out and filed anew go in one package: the change out, the hire out, the hire in, the change in.

DELETE /payroll/employment-records/{id} takes back a change that was not one — data corrected, not an agreement — or a prepared correction (with the row prepared with it: a заличаване and the record filed anew go together), or the unfiled hire or termination of an employee removed from the roster that is not owed (below), while it is not filed: 200, { "id": "01k…", "withdrawn": true }. On a filed record it prepares the record's заличаване (код 2): { "id": "01k…", "withdrawn": false, "corrections": [ … ] }. A hire is taken out only once the change and termination records of the same contract filed after it are taken out or being taken out, and none waits to be filed — a record prepared to be filed anew included, which would reach НАП about a contract taken out — 409 employment_record_has_later_records with details.records (Приложение № 1, т. 2, бележка 3) — and a hire's заличаване after its three days goes to НАП only on electronic media with the covering letter, accepted once the inspectorate or НАП found a discrepancy (чл. 13, ал. 3); the package says so. 409 employment_record_deleted for a record already taken out.

A person removed from the roster (in the app — a soft delete; the payroll history stays) still owns the records filed about them, and both verbs serve them by the record's id like anybody's: the list above keeps showing them, a correction is restated from the person as they stood when they were removed, and the package files it — the common case being the hire of somebody who never started work, taken out after they were removed. A record of theirs not yet filed is still owed — КТ чл. 62, ал. 3 and чл. 10 of the наредба tie it to the contract being made, changed or ended, not to the roster — so the month's package files it like anybody's, naming the person as removed in its caveats and in the record's data_gaps, and the deadline reminders ask for it until a package carrying it is submitted. When it is not owed — the person was entered by mistake and no contract was ever made, or the record was filed in НАП's portal — DELETE takes it back ({ "id": "01k…", "withdrawn": true }), a hire or a termination as well as a change: then neither the package nor the reminders ask for it again. For an employee still on the roster an unfiled hire or termination still follows the employee and the termination (422 not_a_change_record).

POST /payroll/employment-register/{YYYY-MM} prepares the month's package: every hire, change and termination whose event falls in the month — or, when the month's own package is already filed, a follow-up of the records it did not carry (period 2026-10-2, 2026-10-3 …). 201 the first time, 200 when the package is prepared again:

{ "data": {
  "filing": { "id": "01k…", "kind": "employment_register", "period": "2026-10",
              "status": "generated", "due_on": "2026-10-18", "ready_to_submit": true,
              "xml_file": "ETZ131063188.XML",
              "xml_url": "/api/v1/payroll/employment-register/2026-10/xml",
              "xml_blocked_by": [], "caveats": ["…"] },
  "records": [ { "id": "01k…", "employee": "01k…", "kind": "hire", "…": "…" } ] } }
  • xml_file — the file НАП takes, ETZ<ЕИК>.XML (WINDOWS-1251, checked against НАП's own XSD before it is written), and xml_url — where it is fetched with payroll:read alone (below); a key that also holds filings:read gets the same bytes as the filing's file, GET /filings/{id}/files. null when a mandatory точка is empty: xml_blocked_by names each, per person — usually contract_ground (т. 12), which Autonify never guesses, or a change's signed_on. Send what is missing and prepare the package again.
  • ready_to_submit and caveats — as on GET /filings: the generator's verdict, and every box it wants checked, in Bulgarian.
  • A month with nothing in it is 409 no_employment_records. Prepared from the app or from here alike, the payroll.employment_records.generated webhook fires (§9).

GET /payroll/employment-register/{YYYY-MM}/xml — the package's ETZ<ЕИК>.XML, as bytes (§4 „Binary answers"), for a key with payroll:read: a payroll-only contract prepares the month with the POST above and fetches its file here, without filings:read. The period is the package's own — 2026-10, or 2026-10-2 for a follow-up — as the POST answered it. Only this file is served here; the package's other files (the JSON справка, the PDF) stay behind the filings door and its two abilities. A package already moved to submitted serves the bytes that went to НАП. 404 not_found for a period with no package; 409 employment_register_xml_blocked for a package with no XML, with details.xml_blocked_by as above; 422 validation_failed for a period that is not one.

Once the file went in, move the filing to submitted with its входящ номер (POST /filings/{id}/transition): from then its records read filed: true, and a change of one of them is a correction prepared with the PATCH above.

The поименен график (summed working time)

Since round 11. An employee whose working time is summed (sirv_period_months, the company's or the person's own) works by a поименен график the employer approves for the whole period, keeps at least three years after it, and acquaints the person with before work under it starts (НРВПО чл. 9а). Each person's график is a draft — written whole, as often as you like — and approved versions: numbered, dated, never changed, never deleted. A version governs from the day it was approved; the payroll reads only approved versions. {YYYY-MM} is any month of the person's period.

GET /payroll/employees/{id}/sirv-schedule?period=YYYY-MM (this month when left out):

{ "data": {
  "employee_id": "01k…", "name": "Стоян Сменен", "position": "Охрана",
  "period": { "from": "2026-07-01", "to": "2026-08-31", "months": 2 },
  "problem": null,
  "norm_hours": "352.00",
  "scheduled_hours": "348.00", "scheduled_night_hours": "64.00", "scheduled_converted_hours": "350.29",
  "kept_until": "2029-08-31",
  "versions": [
    { "id": "01k…", "version_no": 1, "status": "approved",
      "approved_on": "2026-06-25", "approved_by": "Иван Иванов, управител",
      "change_reason": null, "change_note": null,
      "acknowledged_on": "2026-06-26", "acknowledged_how": "signature", "acknowledged_note": null,
      "findings": [] } ],
  "draft": null,
  "shifts": {
    "2026-07-01": { "date": "2026-07-01", "kind": "work", "start": "20:00", "end": "08:00",
      "break_minutes": null, "hours": "12.00", "night_hours": "8.00",
      "converted_hours": "13.14", "night_shift": true, "cell": "20:00-08:00" } } } }
  • problem — what is wrong with the person's period (length, ktd — see sirv_period_months under Payroll settings), null when it is lawful; period is null when the person does not sum the month.
  • norm_hours — the period's norm the график is held to: the working days by calendar the person is employed on, each at the contracted daily hours in force on it, less the working days of a leave already recorded (НРВПО чл. 9б, ал. 1 and 2).
  • shifts — what the график holds now: the draft when there is one, else the version last approved; one entry per day a shift starts on. hours are the clock's net of the break; night_hours those between 22:00 and 06:00 (20:00 for a person under 16); converted_hours the hours as the график is summed against the norm — a shift with 4 or more night hours has them converted ×8/7 (НРВПО чл. 9а, ал. 4), none for a contract for night work only (sirv_night_only) or a post on a reduced working time. cell is how the app's grid writes the day.
  • draft.findings — what the checks find in the draft if it were approved today; versions[].findings what they found when it was approved. Each finding: code, level (block — the approval is refused; warn — kept on the version; info), dates, params. The codes: norm_exceeded (block — the converted hours over the norm, НРВПО чл. 9а, ал. 3), shift_too_long (block — over 12 hours, or over the reduced time plus one, КТ чл. 142, ал. 6), week_too_long (block — over 56 hours in 7 days in a row), daily_rest (block — under 12 hours between two shifts with times, КТ чл. 152), weekly_rest_missing (block — 7 days in a row with no rest of 24 hours, КТ чл. 153), weekly_rest_short (warn — 24 to 36 hours, allowed on a change of shifts, ал. 3), rest_unchecked (info — shifts without times), no_free_day (warn — 7 days in a row with shifts and no times), night_minor (block — night hours under 18, КТ чл. 140, ал. 4, т. 1), night_consent (warn — a mother of a child under 6, т. 3: only with her written consent), outside_employment (block), shift_on_leave (warn — a shift on a recorded leave), approved_late (warn — the first version approved after its first shift), period_unlawful (block).

GET /payroll/sirv-schedules?period=YYYY-MM — every employee who sums the month: { "period": "2026-07", "employees": [ …each as above… ] }.

PUT /payroll/employees/{id}/sirv-schedule/{YYYY-MM}/draft — the WHOLE period's draft; a day left out has no shift:

{ "shifts": [
  { "date": "2026-07-01", "start": "20:00", "end": "08:00" },
  { "date": "2026-07-02", "start": "08:00", "end": "20:00", "break_minutes": 30 },
  { "date": "2026-07-05", "hours": 12, "night_hours": 8 },
  { "date": "2026-07-06", "kind": "on_call", "hours": 12 },
  { "date": "2026-07-07", "kind": "rest" } ] }

kind is work (the default), on_call (дежурство — working time, НРВПО чл. 13а and 13б) or rest; start and end are HH:MM, both or neither — an end at or before the start is the next day; hours is required without times and, with them, must agree with what they give; night_hours is worked out from the times when left out (send it when a break fell at night). 200 with the график as GET answers it. A day outside the person's period is 422 sirv_day_outside (details.dates); a shift it cannot read is 422 sirv_cells with details.shifts naming each (shifts.3: hours, times, hours_disagree, break_over_shift, night_over_hours, …); a person who does not sum the month is 422 sirv_not_summed, one on a period the law no longer allows 422 sirv_period_unlawful. Since round 11b a draft written for a period the setting no longer gives — the setting corrected in the month it began — is 422 sirv_period_changed: throw it away (DELETE …/draft) and write the period in force.

POST /payroll/employees/{id}/sirv-schedule/{YYYY-MM}/approve — the draft becomes the next version:

{ "approved_on": "2026-07-15", "approved_by": "Иван Иванов, управител",
  "change_reason": "headcount", "change_note": "Смяна на 17-ти поема колега" }

approved_on no later than today and no earlier than the version it changes; for a version after the first change_reason is required — headcount (промяна на числеността на заетите) or circumstances (други обстоятелства, НРВПО чл. 9а, ал. 2). A version governs from approved_on: a draft that changes a day before it is 422 sirv_past_changed (details.dates) — what was worked differently is the month's recorded hours' to say. A finding that blocks is 422 sirv_checks with details.findings. Other refusals: sirv_no_draft, sirv_reason_required, sirv_approved_in_future, sirv_approved_before_previous. Approving marks the period's computed, unposted months stale: the norm's reduction for a болничен or a parental leave, the night hours the close converts, Д1 т. 16 and приложение № 9 read the approved график.

POST /payroll/employees/{id}/sirv-schedule/{YYYY-MM}/acknowledgment — acknowledged_on (not before the approval, not after today), acknowledged_how (signature, electronic, posted, other — the manner the ПВТР sets, НРВПО чл. 4а, ал. 3), note: recorded on the version last approved; again, it is corrected. 422 sirv_acknowledgment otherwise.

DELETE /payroll/employees/{id}/sirv-schedule/{YYYY-MM}/draft — the draft thrown away; what the график held before stands. An approved version is never removed: 409 sirv_kept.

What the payroll reads from it. A month the person's график is approved for: the days of a болничен, a майчинство, a бащинство, the father's leave to the eighth year or an adoption leave come off the period's norm by their scheduled hours (НРВПО чл. 9б, ал. 3), by the version approved before the absence began (МТСП); Д1 т. 16.2, 16.3, 16.4 and 16.А count the scheduled hours of the days a болничен лист covers (Н-13, т. 16, Забележка 2); приложение № 9 states the scheduled hours of the leave (НПОПДОО чл. 34); the period's close converts the night hours of the shifts with 4 or more of them when the month's recorded night hours are the график's; and a run names a month whose recorded worked hours differ from the график. A month with no approved график keeps the calendar's working days at the contracted hours, and the run and the declarations say so.

Departments and cost centres

The company's departments — what an employee's department_id names, and what every computed month records for each person: the department's id, its name and its cost centre as they stood. The posting splits the month's expense lines by them (the journal, under Reports) and every report with a row per person reads them. The app's page is Заплати → Отдели.

GET /payroll/departments — every department, the active ones first:

{ "data": [
  { "id": "01k…", "name": "Продажби", "cost_center": "CC-110", "archived": false,
    "archived_at": null, "people": 12, "in_use": true,
    "created_at": "2026-09-29T08:00:00+00:00", "updated_at": "2026-09-29T08:00:00+00:00" } ] }

people is who is on the roster in it today; in_use, whether anything names it — a person (a removed one too) or a computed month.

POST /payroll/departments — name (required, ≤ 255, unique in the company whatever its case: 422 on name) and cost_center (≤ 64, your ERP's code). 201.

PATCH /payroll/departments/{id} — name, cost_center, archived: only what you send. archived: true keeps the department and everybody in it but offers it to nobody new; archived: false brings it back. A rename or a new cost centre changes no posted month — its ledger lines and reports keep what they recorded; a month computed and not yet posted follows. Neither marks a month stale.

DELETE /payroll/departments/{id} — only one nothing names; 409 department_in_use otherwise: archive it. 200 with deleted: true.

A key a department does not have is 422; a GET's id, people, in_use, archived_at and dates may ride along. Another company's department is 404.

Employer-wide pay acts

Since round 11. A постановление на Министерския съвет (pms — the minimum wage's included), a колективен трудов договор (ktd) or the employer's вътрешен акт (internal_act — the internal pay rules or their amendment, an order or a staff schedule across the staff) that raises salaries from a date. Applying one writes each covered person's raise through the employee PATCH's own raise path, every raise naming the act (salary_history[].pay_act_id) — and that link is what НСОРЗ чл. 21, ал. 2 turns on: the paid leave days on and after the act's date whose КТ чл. 177 base month predates it are paid a supplement at the act's percentage of the contractual gross (the leave line's details.chl21_act, Payroll settings above). An individual raise owes none. The app's place is Заплати → Настройки.

GET /payroll/pay-acts — every act, the newest date first:

{ "data": [
  { "id": "01k…", "kind": "internal_act", "ktd_level": null, "ktd_extended": false,
    "reference": "Заповед № 7 / 20.10.2026", "issuer": null,
    "issued_on": "2026-10-20", "effective_from": "2026-11-01", "effective_to": null,
    "scope": "all", "scope_departments": [], "scope_positions": [], "scope_people": [],
    "raise_kind": "percent", "raise_percent": "10.0000", "raise_amounts": [],
    "components": "basic", "note": null, "raises": 14,
    "applied_at": "2026-10-21T09:12:00+00:00",
    "created_at": "2026-10-21T09:10:00+00:00", "updated_at": "2026-10-21T09:12:00+00:00" } ],
  "meta": { "minimum_suggestion": { "effective_from": "2027-01-01", "amount": "650.00", "people": 3 } } }

raises is how many dated raises name the act. meta.minimum_suggestion is a minimum wage the payroll's legal parameters hold — in force today, else the next one dated ahead — that employees' monthly salaries in euro are below (by their working time), while no pms act to the minimum from that date is recorded; null otherwise. Record that act to lift them: the figure is the legal parameter's, never typed into the act.

Where an act stands, and the list filtered by it (since 2026-10-22). Every act read — the list, GET, POST, PATCH, apply and approve — carries status: pending (not applied, nothing holds it back), awaiting_approval (the company asks a second person to approve a pay act first and nobody has — an apply is 409 approval_required, nothing written) or applied. The list takes ?status= (one or several, comma-separated: pending,awaiting_approval is everything still to confirm), ?raise_rule_id= (the acts a raise rule prepared) and ?from= / ?to= (YYYY-MM-DD, on effective_from); another value is 422 validation_failed. status rides along on a PATCH. Skipping one occurrence of a raise rule is DELETE of the act it prepared: the occurrence is remembered and never prepared again.

POST /payroll/pay-acts — 201:

Field
kind pms, ktd or internal_act (required)
ktd_level, ktd_extended a КТД's level (branch, municipal, enterprise) and whether the minister extended it to the branch (КТ чл. 51б, ал. 4)
reference, issuer the act as written (required, ≤ 200), and who issued it or its parties
issued_on signed, adopted or promulgated (required)
effective_from the date the raise runs from (required) — it may precede issued_on: a raise dated back
effective_to an optional end: its raise reaches no leave day after it
scope all (every employee on a трудов договор), departments (scope_departments: ids), positions (scope_positions: rows of nkpd_code and/or position, the title matched without case) or people (scope_people: employee ids)
raise_kind percent (raise_percent, up to 100), amounts (raise_amounts: rows of nkpd_code and/or position with the new basic salary amount) or minimum — to the minimum wage the legal parameters hold on effective_from, by the working time; the hourly one for pay by the hour. minimum is a pms act's only (КТ чл. 244)
components basic (default — the клас and every addition computed on the basic follow it) or basic_and_permanent — the fixed permanent additions too, by the same percentage (percent only)
note ≤ 500

A КТД not extended binds the members of the unions that signed it and those who joined it (КТ чл. 57): the payroll cannot know who they are, so its scope is people. These are 422 validation_failed on the field: a ktd not extended with another scope (scope), minimum on another kind (raise_kind), a missing percentage, list or row key, an end before the start, basic_and_permanent with another raise.

GET /payroll/pay-acts/{id} — the act and its preview: everybody it covers, nothing written:

"preview": [
  { "person": { "id": "01k…", "name": "Стела Маринова", "position": "Счетоводител", "department": null },
    "status": "apply", "reason": null, "from": "2026-11-01",
    "pay_basis": "monthly", "currency": "EUR", "old": "1000.00", "new": "1100.00",
    "posted": false, "permanent": [] },
  { "person": { "…": "…" }, "status": "skip", "reason": "later_change", "…": "…" } ]

status: apply (raised from from — the act's date, or the person's start when they came later), link (the card already holds the act's terms on that date — an annex written before the act was recorded: the raise is named, not written again), applied (a raise names the act already) or skip with a reason: not_employee, ended, outside_period, hired_after (a percentage act only: the contract started on or after the act's date, after the act was issued — it was agreed with the raise in force; an amount by position or the minimum is a floor that lifts a later hire too), explicit_basic, later_change (a salary change on or after the date, which a change from the date would replace — raise by hand with pay_act_id; never the salary the person started on, which the act raises), other_act, no_salary, hourly / foreign_currency (an amount by position or the monthly minimum is a monthly salary in euro), no_amount, not_raised (already at or above it), below_minimum (still under the minimum wage — lift it first) or minimum_unknown. posted: from is in a posted month — the posted months' difference is paid in the first open one. permanent lists the fixed permanent additions basic_and_permanent raises (id, label, old, new, how: replace — the line ended the day before and a new one from the date (since 2026-10-17 a line that starts ON the date is cancelled and the raised one recorded in its place: it has no day before it to end on) — or delta, a line of the increase alone, when a posted month on or after the date paid the line).

PATCH /payroll/pay-acts/{id} — only what you send. Once a raise names the act, its kind, ktd_level, ktd_extended, issued_on, effective_from, effective_to, raise_* and components are what those raises were written by: 409 pay_act_applied. The reference, the issuer, the note and the scope still change — a КТД joined later is applied again to the newcomers.

DELETE /payroll/pay-acts/{id} — 409 pay_act_in_use while a raise names it (take the act off those raises first — the employee PATCH's pay_act_id null). 200 with deleted: true.

POST /payroll/pay-acts/{id}/apply — raises everybody the preview says apply and names link, in one write (all of it or none of it):

Field
signed_on the date of the заповед or допълнително споразумение executing the act — т. 16 of each change's ЕТЗ (код 019, т. 16А the raise's date). Left out: an internal act's own issued_on; for a pms or a ktd it is asked on the record later, never guessed. An act a raise rule prepared needs it, or order_on (its issued_on is the day the rule prepared it, no document): neither is 422 validation_failed on signed_on
exclude employee ids left out of this application

Each raise is the employee PATCH's: the months from its date go stale, a date in a posted month pays the difference in the first open month (the leave's supplement among its lines — retro), the ЕТЗ for the change is opened. The answer is the act with application (raised, linked, skipped, and retro: the carried rows — id, employee_id, for_period, settle_period) and the preview as it now stands; meta.past_deadline as on the employee PATCH. A busy company is 409 payroll_busy, nothing written.

A key an act does not have is 422; a GET's id, raises, applied_at, preview and dates may ride along. Another company's act is 404.

The order behind a raise (since 2026-10-10). POST …/apply also takes order_on (YYYY-MM-DD, not in the future) and order_number (≤ 40): the act's „Заповед за увеличение на основното трудово възнаграждение" (КТ чл. 118, ал. 3) is issued with that date — т. 16 of each change's ЕТЗ defaults to it when signed_on is not given — and each person raised has a copy naming them alone filed in their personnel file (Documents, category order). Left out, nothing is issued and the act applies exactly as before. GET /payroll/pay-acts/{id}/order.pdf returns the order (every person the act raised: name, position, the salary before and after, the date, the basis); ?employee={id} a person's copy; ?locale=en the English words. An act applied without an order — or an employee it did not raise — is 404 not_found.

Each application is its own document (since 2026-10-17). signed_on, order_on and order_number are those of the application you send — a later one (a newcomer under a КТД, the people a first one left out) may carry another date and another order, and each person's copy is filed under the order that raised them. Left out, they are what the app's own background application of the act that stopped part-way was written with (its rest is finished alike), or — for an act the app recorded from its employee list for a second person's approval — the date and the order given there; otherwise as before. The act's order_on / order_number are the first order issued with it and are never written over. order.pdf?employee={id} is the order of the application that raised that employee — the copy filed in their personnel file — and 404 not_found when that application issued none; order.pdf alone is each order issued with the act, by date, one after the other, each naming the people it raised (an act applied once: the one order, as before). An act is not applied while the app is applying another act in the background to some of the same people: 409 pay_act_overlap — the two would split the people between them. A person whose raise a writer refuses (a standing line it will not end, a card that no longer passes its own rules) is 409 pay_act_person_refused, the person named in the message, nothing applied: correct the card, or exclude them.

An act a raise rule prepared (Raise rules) is an ordinary act with source rule, raise_rule_id, rule_occurrence, raise_rule_terms (its own copy of the rule's raise: raise_method, raise_value, components, rounding, max_step_percent, salary_cap, min_service_months, name, cadence, alignment), since 2026-10-14 excluded_people (read-only: the people its rule left out of an all, departments or positions scope — by the rule or by their own opt-out; [] when nobody — a person hired before the act's date is raised with the rest) and raise_kind rule; kind may then be contract — a raise under a clause of the individual contracts, which owes the leave no НСОРЗ чл. 21, ал. 2 supplement (МТСП, ID 2140). auto_applied_at is set when the rule applied it on its own; order_on / order_number when an order was issued; order_suggested says the rule issues one. Two more skip reasons come with it: below_service (fewer months here than the rule asks) and cap_reached (the salary is at the rule's cap) — and, since 2026-10-14, on_probation (the rule skips probation and the person's runs on the act's date). These keys ride along on a PATCH — a GET sent back as it came is 200; contract and rule cannot be set by hand, and a rule's act keeps the kind and raise_kind it was prepared with (another value is 422). With basic_and_permanent the fixed permanent additions are raised by the rule's percentage held by the same max_step_percent and salary_cap that held the basic.

Seniority rates and the „Стаж и клас" report

Since 2026-10-10. The company's own клас percent per year of стаж from a date — a КТД's, the internal pay rules' or the contracts' (НСОРЗ чл. 12, ал. 1 and 3). No rate is the payroll as it was: the person's own class_percent_override, else the legal minimum. With a rate: the person's own still wins; else the company's rate in force on the month's last day, held at the legal minimum of that day (a minimum that later rises past it is paid instead). The app's place is Заплати → Настройки → „Клас за трудов стаж".

GET /payroll/seniority-rates — the rates, the newest first, and in meta what a person with no percent of their own is paid today (today: percent, source company or legal) and the legal_minimum.

POST /payroll/seniority-rates — 201:

Field
effective_from the first day of a month (required) — the rate is the whole month's
percent_per_year up to four decimals, above 0 and below 100, never below the legal minimum on that date (required)
basis ktd, internal_act or contract (required)
reference the document — number, date, article (required, ≤ 200)

A date off the first of a month, a percent under the minimum or a second rate on one date is 422 validation_failed on the field. The computed months from the date go stale; the months before it do not move. A date in or before a posted month is 409 period_posted (the клас of a posted month never moves).

DELETE /payroll/seniority-rates/{id} — 200 with deleted: true; 409 period_posted when a posted month was computed on it.

GET /payroll/seniority — every employee on a трудов договор not gone before ?as_of= (Sofia's today by default), one row each: employee_id, external_id, name, position, department, contract_start, recognised_months, months_here, service_years, service_months, class_percent_per_year, class_percent_source (person, company, legal, explicit), class_percent, next_step_on, next_class_percent, basic_salary and class_amount (money) — the rows of the employee's seniority object. GET /payroll/seniority.csv is the same as the house CSV (?columns=, ?header=, ?locale= as the other reports).

Hours rates — overtime, night and holiday

Since 2026-10-22. The company's own rate for each kind of hours from a date — a КТД's, the internal pay rules' or the contracts': КТ чл. 261, 262, ал. 1 and 264 each say „уговорено …, но не по-малко от", and НСОРЗ чл. 14 lets a КТД, the internal rules or the contract set higher amounts. No rate is the payroll as it was: the statutory minimum. With a rate, every hour of its kind in the months from its date until the next is priced at it, held at the statutory minimum of the month (a minimum that later rises past it is paid instead). Only the rate is the company's: the hours, their kind and the base of the increase — the pay the employment contract sets (КТ чл. 262, ал. 2) — stay as before, and so do Д1/Д6, the leave base and the reports, which read the lines' amounts. The rate is the company's alone: per employee or per template it is not set. The app's place is Заплати → Настройки → „Извънреден, нощен и празничен труд".

kind value Statutory minimum
overtime_workday the increase, % 50 — КТ чл. 262, ал. 1, т. 1
overtime_weekly_rest the increase, % 75 — т. 2
overtime_holiday the increase, % 100 — т. 3; the hour also takes holiday_work (чл. 264), the two added on the same base
overtime_sirv the increase, % 50 — т. 4, summed working time: the over-norm hours priced at the rate of the month that closes the period
night euro per night hour 0,15 % of the minimum wage a night hour (НСОРЗ чл. 8) — 0.9303 in 2026
holiday_work the increase, % 100 — the double of КТ чл. 264

GET /payroll/hours-rates — the rates, the newest first, and in meta what each kind is paid at today (today: value, unit, source company or legal, legal_minimum, held, rate_id, effective_from — as resolved.hours_rates of GET /payroll/settings).

POST /payroll/hours-rates — 201:

Field
kind one of the six above (required)
effective_from the first day of a month (required) — the rate is the whole month's, until the next; a night rate runs from 2026-01-01 at the earliest (it is euro)
value up to four decimals, above 0, never below the statutory minimum on that date — or null, which ends the company's rate: the statutory minimum again from the date (required, null included)
basis ktd, internal_act or contract (optional)
reference the document — number, date, article (optional, ≤ 200)

A date off the first of a month, a value under the minimum (the message names the minimum and its article), a second rate of the kind on one date, or an end with no company rate in force before it is 422 validation_failed on the field. The computed months from the date go stale; the months before it do not move. A date in or before a posted month is 409 period_posted — a posted month's lines never move; to stop paying a rate a posted month was priced on, end it from a later month.

DELETE /payroll/hours-rates/{id} — 200 with deleted: true; 409 period_posted when any posted month falls on or after its date (even one a later rate priced — to stop a rate from a later month, end it instead).

On the run. Every overtime, night and чл. 264 line of a computed month carries details.hours_rates — a list of the rates it was priced at (the holiday overtime has two: overtime_holiday and holiday_work), each with kind, value, unit, source (employee, template, company or legal), minimum, held and rate — the row it was priced at (id, from, value, basis, reference) or null. Since 2026-10-23 a row of the employee or of a template adds level (employee or template — whose row it is, the rate paid or the one a higher minimum held) and, for a template, template (id, code, name); a company's or the law's line is said as before.

An employee's own rates and a template's (since 2026-10-23). The same six kinds, the same body and the same refusals at two more levels. For a person's month the first level with a rate in force on the date pays it: the employee's own → the template the person is on → the company's → the statutory minimum — and whichever it is, never below the minimum on the date (held, as above). A null value ends that level's rate from its date: the next level's applies again. None of them set, the payroll is priced exactly as before.

  • GET /payroll/employees/{id}/hours-rates — the person's own rates, the newest first; meta.today — what each kind is paid at today and from which level: today's keys above plus level (whose row: employee, template, company — or null), rate_value (that row's value) and template (id, code, name — or null). POST records one (an employee only — anybody else is 422 on kind); DELETE …/{rate_id} removes one no posted month was computed on. The person's computed months from the date go stale.
  • GET /payroll/templates/{id}/hours-rates — the template's own rates, the newest first; meta.on_template_today — how many of this company's people are on it today. POST and DELETE …/{rate_id} as above, for the company's own templates only — an account-wide one is read here and changed in the app (403 template_account_wide). A template's rate reaches the people on the template in every entity: a date in or before a month posted by any entity with somebody on it is 409 period_posted, and those entities' computed months from the date go stale.

Who is on a template, and from when. A person is on a template from the first day of a hire from it, or from the date it was applied to them (POST /payroll/templates/{id}/applications — their first day when they joined later), until another template is applied to them. A month is priced at the rates of the template the person was on in it — a posted month priced again (a raise dated back, a late sick note) included — so applying a template moves no month before its date. A template's rates reach the people on it as they are: a rate added to a template later reaches them from its own date, with no application. Copying a template to another entity takes its rates with it; an employee's own rates are never copied.

Raise rules

Since 2026-10-10. A raise the employer gives again and again — every year, half-year or quarter, every month, or on each person's work anniversary — set once. None exists by default, and with none nothing happens. A rule never writes a salary itself: every day the payroll prepares each occurrence due within the rule's lead_days as an ordinary pay act in its not-yet-applied state (Employer-wide pay acts — raise_rule_id names the rule) and notifies the company's payroll team; you apply it like any act. Only a rule in auto_apply applies its act itself on its date, with т. 16 (signed_on) the act's date and its order issued when issue_order says so — and the readiness check's upcoming and the run say so. It applies only the acts dated on or after the day it was put in auto_apply (auto_apply_since, read-only) and at most three days late (a sweep that missed its morning, while the change's ЕТЗ can still be sent on time); a proposal left unapplied before the switch, or past those days, stays for you to apply or delete. Deleting a prepared act skips that occurrence for good.

POST /payroll/raise-rules — 201:

Field
name ≤ 120 (required)
basis internal_act, ktd (with ktd_level, ktd_extended as on a pay act) or contract — a clause of the individual contracts, which owes the leave no чл. 21, ал. 2 supplement (required)
reference the document (required, ≤ 200)
raise_method, raise_value percent (≤ 100) or amount — euro a month on a monthly salary in euro; a rate by the hour or another currency is skipped (hourly, foreign_currency) (required)
components basic (default) or basic_and_permanent (percent only)
cadence annual, semiannual, quarterly (with anchor_month 1–12 and anchor_day 1–28), monthly (anchor_day) or anniversary of the contract's start (with alignment: exact, first_of_month, first_of_next_month — one act per date, naming the people whose anniversary falls on it) (required)
scope as a pay act's: all, departments, positions, people — or template: the employees given one of scope_templates (ids of this company's employee templates or the account's shared ones, archived ones included), read on the day each occurrence is prepared; the act it prepares names them (scope people) — or (since 2026-10-14) combined: every filter given must hold — scope_departments AND scope_positions AND scope_templates AND scope_pay_bases (monthly, hourly) AND scope_contract_kinds (indefinite, fixed_term — by the contract's т. 12 ground, a blank ground counting as indefinite), any value within one filter; at least one filter (422 on scope otherwise); its act names its people
excluded_people since 2026-10-14: everyone in scope except these employee ids (any scope but people — with people it is 422: such a rule names whom it covers); the people left out here, or on their own page (/payroll/employees/{id}/raise-settings, below), are left out of its acts: an act by all, departments or positions keeps its scope and lists them in its excluded_people, one by template or combined names the people it raises
skip_probation since 2026-10-14: true — a person whose probation (probation_until, below) runs on the raise's date is not raised (on_probation); default false
min_service_months months here on the raise's date before it applies (0) — for an anniversary aligned first_of_month, on the person's anniversary itself, later in that month
rounding the new monthly figure to the cent (default), up to ten_cents (since 2026-10-14), euro_up, euro_nearest, up to five or ten — never past a cap; a rate by the hour keeps four decimals
max_step_percent, salary_cap an optional cap on one step, and a salary the raise never takes anybody past (cap_reached for one already at it)
lead_days 0–120 days before its date the act is prepared (30)
mode propose (default) or auto_apply
issue_order issue the act's order when it is applied (default true)
active_from, active_to the window its occurrences fall in (active_from required)
note ≤ 500

A monthly cadence means an ЕТЗ record per person per month. A ktd not extended names its people (scope people) whatever the cadence — an anniversary rule under it takes those people's anniversaries only (КТ чл. 57). components, min_service_months, rounding, lead_days and mode sent as null take their defaults. A missing anchor or alignment, a percentage over 100, basic_and_permanent with an amount, an end before the start are 422 validation_failed on the field. A rule never lowers pay: a raise that does not raise is not_raised.

GET /payroll/raise-rules — the rules, the newest first, each with its last prepared acts (id, effective_from, applied_at, auto_applied_at).

GET /payroll/raise-rules/{id} — the rule and its next: the next occurrence within two years (occurrence: key, date), every person it covers as a pay act's preview shows them (rows), and totals (people, raised, monthly_increase — the euro a month it adds to the salaries it raises, before the employer's contributions — and other_currencies).

PATCH /payroll/raise-rules/{id} — only what you send; the occurrences prepared from then on follow, an act already prepared keeps its own copy. DELETE /payroll/raise-rules/{id} — the acts it prepared stay. A key a rule does not have is 422; a GET's id, acts, next, copied_from_id, auto_apply_since, account_rule, account_held, account_paused and dates may ride along. Another company's rule is 404. Copying a rule to other entities is the app's (a key is one company's) — never into an entity that is read-only for the user.

One rule for the account's entities (since 2026-10-14) is set in the app (Payroll → Settings → Raise rules, „Applies to"), over every entity of the account or chosen ones — over every entity only on an account whose entities are its own; an accountant's or a firm's account chooses its entities. Each entity holds its own copy as an ordinary rule here, prepared, confirmed and ordered per entity. A copy carries account_rule — id, entity_scope all/chosen and entities (how many entities run it now); never another entity's ids, departments or people, and its own excluded_people are this company's — null on a rule of the company's own. It is changed or deleted with its account rule: PATCH and DELETE on it are 409 account_rule_managed. Read-only beside it:

  • account_held — true on a copy made when this company joined the rule later: it only proposes (mode propose, whatever the rule's) until somebody of this company lets it follow the rule — in the app, or (since 2026-10-22) POST /payroll/raise-rules/{id}/follow-account-rule with this company's key (no body): the copy then takes the rule's mode, auto_apply included (auto_apply_since today). A rule that is not held — the company's own, or a copy that already follows — is 409 not_held;
  • account_paused — null, or {reason, at} when the copy is paused and kept (it prepares and applies nothing): removed (the company was taken off the rule), no_departments / no_templates (none of its departments or shared templates any more). Put back, or matching again, the same copy runs on with its history. A copy paused as removed may be deleted here (DELETE answers as for a rule of the company's own).

One person's raises (since 2026-10-14):

  • GET /payroll/employees/{id}/raises — settings (probation_until, opt_out_all, opted_out_rules, note) and rules: every rule whose scope reaches the person and runs (a paused copy is not listed; id, name, the raise and cadence, scope, mode, skip_probation, own — a rule over this person alone, account_rule as above, account_held), left_out_by (null, rule — the rule's excluded_people, opted_out — this rule, opted_out_all — every rule) and next: the next raise it gives them (on, status, reason, old, new, …), null when left out or none within two years.
  • PATCH /payroll/employees/{id}/raise-settings — any of probation_until (YYYY-MM-DD or null: the last day of the срок за изпитване, КТ чл. 70), opt_out_all, opted_out_rules (rule ids of this company) and note; a field left out keeps what is stored, any other key is 422. Answers with the same body as the GET and meta.changed. Leaving a person out reaches the acts prepared from then on; an act already prepared names its people and is changed on the act.
  • A rule of the person's own — „raise this person by 5 % every year" — is an ordinary rule over them alone: POST /payroll/raise-rules with scope people and scope_people [id].

A raise's lifecycle, pushed (since 2026-10-22): payroll.pay_act.prepared when a rule prepares an occurrence, payroll.pay_act.held_for_approval when an act waits for its second person, payroll.pay_act.applied when it is applied — §9, Events.

Account-wide raise rules (payroll:account)

Since 2026-10-22. The account's raise rules over its entities — what the app sets under „Applies to" — and every pending occurrence of one confirmed across the entities in one call, for a key holding payroll:account: the one permission that reaches past the key's company. Who may hold it is narrow on purpose (§1, Permissions): a live key on a company your enterprise contract covers, under a contract that names payroll:account, created or rotated by the account's owner or an admin with two-factor authentication. It acts on the account that owns the key's company, and of its entities only those the contract covers.

Refused before anything else, 403: ability_missing / ability_not_in_contract as for any permission; account_scope_sandbox — a sandbox key (an account rule is synced into the account's real entities); and account_scope_not_permitted — the person the key belongs to is no longer the account's owner or an admin with 2FA (their keys keep every other permission on their own company; an owner or admin creates a new one).

Each entity still holds its own copy (Raise rules above): its raise is prepared there, approved where the entity asks for a second person, applied, filed in the ЕТЗ and ordered per entity, as an employer's own. Through this door you change the account rule; its copies follow.

GET /payroll/account-raise-rules — the account's rules, the newest first; GET /payroll/account-raise-rules/{id} — one:

{ "data": {
  "id": "01k…", "name": "Годишно увеличение", "basis": "internal_act", "reference": "ВПРЗ, чл. 12",
  "raise_method": "percent", "raise_value": "3.0000", "cadence": "annual", "anchor_month": 11, "anchor_day": 1,
  "scope": "departments", "scope_departments": ["Склад"], "…": "…", "mode": "propose", "lead_days": 30,
  "entity_scope": "chosen", "company_ids": ["01k…", "01k…"], "excluded_people": [],
  "outside_contract": false,
  "entities": [
    { "company_id": "01k…", "name": "Ентитет 1 ЕООД", "rule_id": "01k…", "status": "synced",
      "paused_reason": null, "mode": "propose", "pending": 1 } ],
  "source": "api", "created_at": "…", "updated_at": "…" } }

The terms are a raise rule's, under the same names, but for departments by name (each entity has its own ids — matched by name in each) and no scope by people (a person is one entity's). entities are the covered entities holding a copy: rule_id is the copy (/payroll/raise-rules/{id} with that entity's key, and the raise_rule_id of the acts it prepares), status synced, held (the entity joined later; it proposes only until it lets it follow) or paused (with paused_reason), and pending how many acts it prepared wait to be applied. company_ids and excluded_people list only what the contract covers. outside_contract: true — the rule reaches an entity the contract does not cover (set in the app), or every entity under a contract that lists its companies: it is read here, and a write is 409 outside_contract.

POST /payroll/account-raise-rules — 201, with results: what the save did in each entity (company_id, name, status synced / held / paused / skipped, reason — read_only, no_departments, no_templates — and rule_id):

Field
a raise rule's fields as POST /payroll/raise-rules — scope all, departments (scope_departments: names), positions, template (scope_templates: the account's shared templates) or combined
entity_scope chosen (with company_ids) or all — every entity of the account, those added later too: only on an account whose entities are its own, and only under a contract over every one of them (a contract that lists its companies is 422 on entity_scope)
company_ids the entities, of those the contract covers (another is 422 on company_ids)
excluded_people employee ids, of any covered entity, left out

PATCH /payroll/account-raise-rules/{id} — only what you send, on the rule as it stands (a whole GET rides back); every copy follows, an entity taken off has its copy paused and kept. DELETE …/{id} — the rule and every copy; the acts they prepared stay. Another account's rule is 404.

GET /payroll/account-raise-rules/{id}/preview — nothing written: per entity (company_id, name, rule_id) its copy's next occurrence as GET /payroll/raise-rules/{id} shows it (occurrence, rows, totals), and totals across them. Priced as a write.

POST /payroll/account-raise-rules/{id}/apply — every pending act the rule's copies prepared, across the covered entities it reaches, each entity in one transaction: all its pending acts applied (the earliest first) or none of them — and one entity's refusal never touches another's.

Field
signed_on or order_on the date of the document executing the raises — т. 16 of each change's ЕТЗ (required: a rule's act is never dated by the day it was prepared — 422 on signed_on)
order_number the order's number in every entity, or order_numbers: { "company id": "number" } — each entity is an employer with its own register of orders
exclude employee ids, of any entity, left out
companies only these entities (of those the rule reaches — another is 422)
until only the acts dated up to this day (YYYY-MM-DD)

200, with the report — refusals and all:

{ "data": { "rule_id": "01k…",
  "entities": [
    { "company_id": "01k…", "name": "Ентитет 1 ЕООД", "rule_id": "01k…", "held": false,
      "status": "applied", "reason": null, "acts": ["01k…"], "raised": 14, "linked": 0, "skipped": 1, "error": null },
    { "company_id": "01k…", "status": "awaiting_approval", "acts": ["01k…"], "…": "…" },
    { "company_id": "01k…", "status": "refused", "acts": ["01k…"],
      "error": { "code": "payroll_busy", "message": "…" }, "…": "…" } ],
  "totals": { "applied": 1, "awaiting_approval": 1, "refused": 1, "nothing_pending": 0, "skipped": 0, "deferred": 0 } } }

status: applied (acts the acts applied; raised, linked, skipped summed over them as on a pay act's apply), awaiting_approval (the entity asks a second person to approve a pay act first and one of acts has none — nothing applied there; approve them — POST /payroll/pay-acts/{id}/approve — and call again), refused (nothing applied there; error is the refusal the pay act's own apply would answer — payroll_busy, pay_act_overlap, pay_act_person_refused, … — or subscription_read_only for an entity whose plan lapsed or that is archived, or apply_failed), nothing_pending (reason no_copy for an entity holding none), skipped (reason paused) or deferred (reason time_budget: the call had worked for 45 seconds before the entity's turn — nothing was tried there). A held copy's acts are applied (held: true): holding stops the rule applying on its own in an entity that joined later, and this is a person's confirmation.

One call never stays open for minutes. The entities are worked one after the other, each whole; once 45 seconds are spent no further entity is started, and the rest answer deferred — every call applies at least one entity that has work, and never cuts one. Call again (a new Idempotency-Key) until totals.deferred is 0: the entities already applied answer nothing_pending.

The report is the answer: a retry with the same Idempotency-Key replays it. To try the refused entities again send a new key — companies naming them; an entity already applied answers nothing_pending. Each applied act is announced once (payroll.pay_act.applied, source api); an entity rolled back announces nothing.

Metering. An account-scope call is metered like any other, against the key's own company: its units (a write is 10 units — the apply included, however many entities it reaches; the preview is priced as a write), its row in the request log, and the contract's usage under the ability payroll:account.

Bonus rules

Since 2026-10-22. A bonus the employer pays again and again — every month, quarter, half-year or year, or in chosen months — set once, as an amount or a percentage of the basic monthly salary. None exists by default, and with none nothing happens. A rule keeps no money of its own: each month it occurs in, the month's computation writes its one-off line for every employee it covers (rule naming it on the line — PUT …/inputs' answer and the run carry it), beside any line of the same code you send yourself — two lines, each written once, however often the month is computed. A month the rule has written keeps its people: computed again, each line is written again (its amount, a percentage's base, the months it is placed in), but a card moved since — another department, position or template — takes no line away and adds none; a change to the rule (any PATCH that moves it) reads the month again as the cards then stand, and a person no longer employed in the month loses the line. A posted month keeps what it paid.

POST /payroll/bonus-rules — 201:

Field
name ≤ 120 (required) — the line's name on the run and the payslip
code a bonus code of the company (category bonus — bonus or its own) (required)
amount or percent_of_basic exactly one: euro, or a percentage (> 0, ≤ 1000, 4 decimals) of the basic monthly salary in force on the month's last day — resolved when the month is computed, not prorated for absences; a person paid by the hour on that day is skipped (hourly)
amount_basis gross (default) or net — an amount for the month itself (rewards paying_month) only
cadence monthly, quarterly, semiannual, annual (with anchor_month 1–12: the month counted from — quarterly from 1 is January, April, July, October) or months (with months: [6, 12]) (required)
rewards paying_month — the month's own pay (default for monthly); previous_period — the months since the previous occurrence (default for the others): the line is placed in those of them that hold the person's posted payslip (Pay for labour done in earlier months), so it is insured there (КСО чл. 6, ал. 2) and its share goes into the leave base of those months (НСОРЗ чл. 17, ал. 2 — leave already paid is priced again). Months not yet posted: paid as the month's own pay, and placed when the month is computed again after they are posted
scope all, departments, positions, people or template, with scope_departments, scope_positions (position, nkpd_code), scope_people, scope_templates as a raise rule's
excluded_people everyone in scope except these employee ids (not with people)
starts, ends the window of months it occurs in, YYYY-MM (starts required)
note ≤ 500

A rule's line is not of a permanent character (НСОРЗ чл. 15, ал. 2 — a bonus is not paid by the time worked): out of the leave base of НСОРЗ чл. 17, ал. 1, the contract's wage and the employer's sick-day rate, as a bonus sent by hand is.

GET /payroll/bonus-rules — the rules, the newest first. GET /payroll/bonus-rules/{id} — the rule and its next: the next month it occurs in from this one on. GET /payroll/bonus-rules/{id}/preview (?period=YYYY-MM, else the next month) — who gets what, nothing written: period, rows (employee {id, name, external_id}, status pay / removed / skipped, reason — hourly, no_base, joined_after (employed only after the months it rewards) — amount, amount_basis, percent_of_basic, basic, earned_from, earned_to, placed) and totals (people, paid, removed, skipped, gross, net).

PATCH /payroll/bonus-rules/{id} — only what you send (an amount replaces a stored percentage and the other way round); the computed months of its window not yet posted go stale, and computed again they follow. DELETE /payroll/bonus-rules/{id} — its lines of months not yet posted go with it. A key a rule does not have is 422; a GET's id, type_name, source, next, account_rule, account_paused and dates may ride along. Another company's rule is 404.

One rule for the account's entities (since 2026-10-23) is set in the app (Payroll → Bonus rules, „Applies to") or through /payroll/account-bonus-rules below, over every entity of the account or chosen ones. Each entity holds its own copy as an ordinary rule here — its lines written by this company's own month, frozen, skipped and posted as any rule's. A copy carries account_rule (id, entity_scope all/chosen, entities — how many entities run it now; never another entity's ids, departments or people; null on a rule of the company's own) and is changed or deleted with its account rule: PATCH and DELETE on it are 409 account_rule_managed. A copy made when this company joined the rule later — added to or moved into the account under an all rule, or a chosen company that first matches — pays from the first month this company computes inside the rule's window, on the rule's schedule, with nobody confirming it (since 2026-10-23): there is no step for this company to take and no endpoint for one. The months of the window already computed and not yet posted go stale and, computed again, carry the bonus; a posted month keeps what it paid. The company's payroll team is told when the copy is made. Read-only beside account_rule:

  • account_paused — null, or {reason, at} when the copy is paused and kept (it writes no line, and the lines it wrote into months not yet posted go when those months are computed again): removed (the company was taken off the rule), no_departments / no_templates (none of its departments or shared templates any more), type_missing (no bonus type of the rule's code). Put back, or matching again, the same copy runs on — the person-months removed by hand and the months it wrote kept. A copy paused as removed may be deleted here.

One person, one month. PUT /payroll/periods/{YYYY-MM}/inputs with {"code": "bonus", "rule": "<id>", "amount": null} removes the rule's line for that employee and month — and the rule never writes it again for that month (a line removed in the app is remembered the same way). Sent before the month is computed it is remembered all the same (result removed; unchanged when it already was). A row naming rule with an amount is 422, as is a rule the company does not have or one that pays another code (rule): the rule writes its own line. Off-cycle, a code alone never pays a rule's line — name it with key rule:<id> (Off-cycle payments).

Account-wide bonus rules (payroll:account)

Since 2026-10-23. The account's bonus rules over its entities — what the app sets under „Applies to" — for a key holding payroll:account, with the same conditions as the account raise rules above: a live key on a company the enterprise contract covers, under a contract that names the permission, created by the account's owner or an admin with two-factor authentication; it acts on the account that owns the key's company and, of its entities, only those the contract covers. The refusals are the same (403 ability_missing / ability_not_in_contract, account_scope_sandbox, account_scope_not_permitted).

Each entity still holds its own copy (Bonus rules above): its lines are written when that company's month is computed, under its own payroll lock, and it is frozen, skipped and posted per entity. Through this door you change the account rule; its copies follow — and each moves its revision, so the months it reaches that are not yet posted go stale and, computed again, follow. There is no apply: a bonus rule's lines are never confirmed from outside the entity's own computation.

GET /payroll/account-bonus-rules — the account's rules, the newest first; GET /payroll/account-bonus-rules/{id} — one:

{ "data": {
  "id": "01k…", "name": "Тримесечна премия", "code": "bonus", "type_name": "Премия",
  "amount": null, "percent_of_basic": "10", "amount_basis": "gross",
  "cadence": "quarterly", "anchor_month": 1, "months": [], "rewards": "previous_period",
  "scope": "departments", "scope_departments": ["Склад"], "scope_positions": [], "scope_templates": [],
  "excluded_people": [], "starts": "2026-01", "ends": null, "note": null,
  "entity_scope": "chosen", "company_ids": ["01k…", "01k…"], "outside_contract": false,
  "entities": [
    { "company_id": "01k…", "name": "Ентитет 1 ЕООД", "rule_id": "01k…", "status": "synced",
      "paused_reason": null } ],
  "source": "api", "created_at": "…", "updated_at": "…" } }

The terms are a bonus rule's, under the same names, but for departments by name (each entity has its own ids — matched by name in each), no scope by people (a person is one entity's; scope is all, departments, positions or template, the templates the account's shared ones), and a code of a bonus type every entity has — one of the global bonus types, not a company's own (422 on code otherwise). A raise rule's combined scope is not offered: a bonus rule has none. entities are the covered entities holding a copy: rule_id is the copy (/payroll/bonus-rules/{id} with that entity's key, and the rule of the lines it writes) and status synced or paused (with paused_reason). company_ids and excluded_people list only what the contract covers. outside_contract: true — the rule reaches an entity the contract does not cover (set in the app), or every entity under a contract that lists its companies: it is read here, and a write is 409 outside_contract.

POST /payroll/account-bonus-rules — 201, with results: what the save did in each entity (company_id, name, status synced / paused / skipped, reason and rule_id):

Field
a bonus rule's fields as POST /payroll/bonus-rules (name, code, amount or percent_of_basic, amount_basis, cadence, anchor_month, months, rewards, starts, ends, note) — scope all, departments (scope_departments: names), positions or template (scope_templates: the account's shared templates)
entity_scope chosen (with company_ids) or all — every entity of the account, those added later too: only on an account whose entities are its own, and only under a contract over every one of them (a contract that lists its companies is 422 on entity_scope)
company_ids the entities, of those the contract covers (another is 422 on company_ids)
excluded_people employee ids, of any covered entity, left out

A skipped entity says why (reason): read_only (its plan lapsed or it is archived), no_departments / no_templates / type_missing (it has none of them — no copy is made), busy (another payroll write holds that entity — a computation, say: the others are done, this one is brought into step by the next save or the morning's sweep; send the same body again) or failed (reported to us; the next save or the sweep tries again). An entity added to the account later gets its copy of an all rule the moment it is added — through the app's single or bulk add or POST /companies (one started from another's setup, departments included, right after that copy) — or the moment it is moved into the account by an ownership transfer, when the copy it held of the account it left is taken off that rule too (paused and kept). One that first matches later (a chosen entity that gets the department the rule names), or whose payroll was busy at its add or its move, gets its copy at the next morning's sweep. Every copy, made by a save or by either, pays the same way: in each month its entity computes inside the rule's window, on the rule's schedule, nobody confirming it (since 2026-10-23).

PATCH /payroll/account-bonus-rules/{id} — only what you send, on the rule as it stands (a whole GET rides back; an amount sent replaces a stored percentage and the other way round); every copy follows, an entity taken off has its copy paused and kept. A save that moves nothing writes nothing and makes no month stale. DELETE …/{id} — the rule and every copy, one entity at a time: their lines in months not yet posted go with them, a posted month keeps what it paid. If an entity's payroll is busy it answers 409 payroll_busy — the copies deleted before it stay deleted and the rule stays; call again. Another account's rule is 404.

GET /payroll/account-bonus-rules/{id}/preview — nothing written: per entity (company_id, name, rule_id) its copy's next month the rule occurs in, as GET /payroll/bonus-rules/{id} shows it (period, rows, totals), and totals across them (people, paid, removed, skipped, gross, net). ?period=YYYY-MM asks every entity about that month. A paused copy is left out. Priced as a write.

Metering. As the account raise rules': against the key's own company — its units (a write is 10 units; the preview is priced as a write), its row in the request log, and the contract's usage under the ability payroll:account.

Employee templates

Since the 2026-10 round. A template is the terms a group of employees share — the position, НКПД code, qualification group, labour category, department, the contract's ground and length, the working time, the pay, the клас %, the food vouchers, the КИД and ЕКАТТЕ codes, standing allowances and the leave entitlement — held once and copied onto a person: when they are hired (template on POST /payroll/employees, above) or, from a date, onto people already employed (…/applications). It is never inherited: a template changed later changes nobody until it is applied to them, and every change of agreed terms goes through the same writers as the employee PATCH — dated salary and working time, the ЕТЗ for a change, standing allowances, the leave entitlement. The app's place is Заплати → Шаблони.

A template is the company's (scope: company) or every entity's of the account (scope: account — its КИД and ЕКАТТЕ left blank mean each entity's own, and its department is named by name and found, or created, in the entity a person is hired in). A key reads and uses both; it creates and changes only its company's: an account-wide template is created and changed in the app by somebody who works for every entity — 403 template_account_wide.

GET /payroll/templates — the company's templates and its account's account-wide ones (?archived=true adds the archived ones), cursor-paginated:

{ "data": [
  { "id": "01k…", "code": "ENG", "name": "Инженер", "description": null,
    "scope": "company", "company_id": "01k…", "version": 2, "archived": false, "archived_at": null,
    "terms": { "position": "Инженер", "nkpd_code": "21441001", "qualification_group": 2,
               "department_name": "Инженеринг", "pay_basis": "monthly",
               "basic_monthly_salary": "2800.00", "class_percent_override": "1.0000" },
    "allowances": [ { "label": "за квалификация", "amount": "200.00", "permanent": true } ],
    "leave": { "basic_days": 20, "extended_days": null, "extended_category": null,
               "additional_hazard_days": 0, "additional_irregular_days": 0, "contractual_days": 4 },
    "used_by": 14, "outdated": 3,
    "created_at": "…", "updated_at": "…" } ],
  "meta": { "next_cursor": null, "limit": 50 } }

used_by is how many of the company's people were given the template, outdated how many of them are on an earlier version than version. A term the template leaves blank is absent from terms.

POST /payroll/templates — 201. Every term is optional and validated with the rule POST /payroll/employees gives the same field:

Field
code required, ≤ 40, letters, digits, ., _, - — the name the import file and the create's template use; one per account, whatever its case (409 template_code_taken)
name, description required (≤ 120) and optional (≤ 1000)
scope company (the default); account is refused here (403 template_account_wide)
terms position, nkpd_code, qualification_group, labour_category, is_teacher, department_name, contract_ground, contract_months (a fixed-term ground's length — the end is worked out from the start at the hire), weekly_hours, fte_fraction, sirv_period_months, sirv_night_only, pay_basis, basic_monthly_salary (monthly) or hourly_rate (hourly), contract_currency (then the amount is in it), class_percent_override, food_voucher_monthly, kid_code, work_ekatte
allowances up to 20 standing allowances: label, amount (> 0), permanent (НСОРЗ чл. 15, ал. 2) — one name once: they are matched to a person's by name
leave basic_days (at least the statutory 20 — КТ чл. 155, ал. 4), extended_days + extended_category, additional_hazard_days, additional_irregular_days (each 0 or at least 5), contractual_days

A template's salary is a default — confirm it per person; a body that sends a salary of its own replaces it whole at the hire.

GET /payroll/templates/{id} — the template and its versions (version, name, created_at, newest first) and, since 2026-10-23, its own hours_rates (read-only — Hours rates — overtime, night and holiday). GET /payroll/templates/{id}/versions — each version as it was saved (code, name, description, terms, allowances, leave).

PATCH /payroll/templates/{id} — only what you send, and terms and leave key by key: {"terms": {"basic_monthly_salary": "1600"}} changes the salary and keeps every other term; a key sent as null clears it (terms: null clears every term, leave: null removes the leave entitlement). allowances is a list and is replaced whole — send the lines that stay ([] for none). What the template then holds is validated together: an hourly pay_basis beside the monthly salary still stored is refused — send basic_monthly_salary: null with it. A change of the name, the description, the terms, the allowances or the leave is a new version (the earlier ones are kept); the code and archived (true / false) are not. A read-back may ride along.

DELETE /payroll/templates/{id} — a template nobody was given and never applied; otherwise 409 template_in_use — archive it instead (archived: true): the people keep what they were given.

GET /payroll/templates/{id}/outdated — the company's people on an earlier version: employee_id, external_id, name, version; meta.current_version.

POST /payroll/templates/{id}/applications/preview — what applying the template would do, person by person; nothing is written (payroll:read):

Field
employee_ids the company's employees (≤ 2000); left out with mode: changes, everybody on an earlier version
effective_from the day the change takes effect (ЕТЗ т. 16А) — in a month not yet posted (409 template_effective_posted, details none); a person who joined later gets it from their own first day
mode fill_blanks (the default — only what the person has no value for: a blank field, no salary, no leave entitlement, an allowance they do not have), overwrite (every term the template sets) or changes (only what the template changed since the version the person was given, and only where the person still holds what that version gave them, or nothing — a value of their own, the one their hire sent included, is kept)
sections any of terms (the job and its classification — not dated: written now, they re-price every month not yet posted, so they are written only when from is the first day not yet posted or the person's own first day, and otherwise left out as undated_before_date; the position, which moves no figure, is always written), salary, working_time (dated from the person's from), allowances, leave; all by default
{ "data": [
  { "person": { "id": "01k…", "name": "Иван Петров", "position": null, "department": null, "template_version": null },
    "status": "apply", "reason": null, "from": "2026-11-01",
    "changes": [
      { "field": "position", "section": "terms", "old": null, "new": "Инженер", "dated": false },
      { "field": "salary", "section": "salary", "dated": true,
        "old": { "amount": "2500.00", "currency": "EUR", "pay_basis": "monthly" },
        "new": { "amount": "2800.00", "currency": "EUR", "pay_basis": "monthly" } } ],
    "skipped": [ { "field": "leave", "reason": "lower_leave" } ],
    "reprices_unposted": true,
    "employment_record": { "code": "019", "changes": ["salary"] },
    "allowances": { "start": [ { "label": "за квалификация", "amount": "200.00", "permanent": true } ], "end": [] },
    "leave": null,
    "department_created": "Инженеринг" } ] }

status: apply, unchanged (nothing to change — applying stamps the person with the version) or skip with a reason: not_employee (a template holds an employment contract's terms), ended, not_on_template (changes only). skipped names the parts left out and why: kept (the person's own value — fill_blanks, and changes where it is not their version's), later_change (a salary or working time already dated after from — it stays), explicit_basic, lower_salary, other_basis (another pay basis or currency), lower_amount, lower_term (a клас % — a person with none of their own is paid the legal minimum a year, НСОРЗ чл. 12 — food vouchers, fewer hours a week or a smaller share of full time), lower_leave, below_leave_minimum (26 days under a ТЕЛК decision of 50%+, КТ чл. 319), undated_before_date (see sections), sirv_ktd (12 months of СИРВ where the company's settings name no branch КТД, КТ чл. 142, ал. 4), department_archived, department_refused (the department to create was refused when the application came to it — the person keeps theirs), line_starts_later. A template never lowers pay, working time or leave — a cut of agreed pay is an agreement of its own — and never takes anything away: a term it leaves blank, or an allowance it does not name, stays as it is. A running contract's ground and length are not changed by it. employment_record is the ЕТЗ for a change the application would open — the terms that change value to value and the code of the leading one (т. 12: 019 salary, 020 working time, 021 the rest); a first value is completion, not a change (null). An allowance under the same name with another amount is ended the day before (end[].how: end, or cancel for one starting on the date) and started again.

A preview prepared in the background (since build round 2026-10-11). A preview is answered 200 in the request, as before, up to 2,000 people (the most employee_ids may name; counted as an application counts them below). Past that — a changes preview of everybody on an earlier version can reach more — or past 100 people when you ask for it with the header Prefer: respond-async (answered with Preference-Applied: respond-async), it is not worked through inside the request: the answer is 202 with the preview — id, template_id, version, mode, sections, effective_from, status: "queued", total, processed: 0, error_code, created_at, finished_at, expires_at — and no rows, and a Location header naming GET /payroll/templates/{id}/previews/{preview_id}. It is prepared in the background, 100 people at a time, through the very same preview, and moves to running, then done; read it there — the same object, with rows (exactly the rows a preview answered in the request carries, in the same order) once it is done, and without rows until then (an empty list would read as „nobody changes"). Nothing is written to anybody: it is still a read. A preview whose template is edited or archived while it is prepared stops as failed with error_code: template_changed (preview the new version); template_gone (the template or company no longer exists) and preview_failed (the background work gave up — ask again) are the others. Asking again for the same preview while it is queued or running answers 202 with that same one. A preview is kept for a day (expires_at), then 404 not_found. Since it is read person by person over a few seconds, a card changed meanwhile may or may not be in its row — the application reads everybody again when it writes them.

POST /payroll/templates/{id}/applications — 201, the preview written, all of it or none of it — the same body, plus signed_on: the date the additional agreement or order was signed (ЕТЗ т. 16; the three days run from it — left out, each record asks for it later). The answer is the application (id, template_id, version, mode, sections, effective_from, signed_on, applied, unchanged, skipped, created_at) and people — the preview's rows, status: applied for those written. A busy company is 409 payroll_busy; an archived template 409 template_archived.

More than 100 people (the people named, or for changes with none named, everybody on an earlier version) are not written inside the request: the answer is 202 with the application status: "queued", total and processed: 0, and people: []. It is written in the background through the same writers, 25 people at a time under the company's payroll lock — so every other payroll write gets its turn between them — and moves to running, then done. Each group is written whole or not at all; should one be refused, the application stops as failed and the people before it keep what was written. Why it stopped is error_code: template_effective_posted (a month from effective_from on was posted since), template_changed (the template was edited or archived since — apply the new version), template_gone (the template or company no longer exists), read_only (the company became read-only since — its subscription lapsed, an upgrade went unpaid or the account was suspended), gone (the key's person can no longer write to the company as the key's account — removed from the account, unassigned from the company, or the company no longer reached) or application_failed (the background work gave up; apply again to the people left) — whether the company is still writable and the person still reaches it is asked again before each group, as a request is asked at the door. Somebody removed from the roster between the asking and their group is not written and is listed in people with status: skip and reason: person_removed. One application of a template runs at a time in a company: asking again for the same people while it is queued or running answers 202 with that same application; other people are 409 template_application_running, with the running one's id in details.application_id — poll it, and ask again once it is done or failed. Up to 100 people the answer is 201 as before.

GET /payroll/templates/{id}/applications — the template's applications in the company, newest first; each carries status, total, processed, error_code and finished_at (an application written in its request is done). error is the sentence the app shows, as a content key — branch on error_code.

GET /payroll/templates/{id}/applications/{application_id} — one application, and people: who it reached and how — each person's person_id, name, status (applied, unchanged or skip), the reason a skipped person was left out, and the changes and skipped parts as in the preview. Poll it for a queued application's progress.

POST /payroll/employees/{id}/template — 201, a template made from an employee: their terms in force today, their department's name, a fixed-term contract's length in whole months, their standing allowances live today and their leave entitlement. code, name, description as above; with_salary: true copies their salary too (a salary is the person's own). The employee is not given the template.

Leave entitlements and postponements

PUT /payroll/employees/{id}/leave-entitlements/{effective_from} — the paid annual leave the person is entitled to from a date, by the article that grants each part: the employee page's „Задаване на числа" in the app, which writes through the same rules. One row per date, in force until the next row's date; before the first row, and for a person with none, the statutory minimum applies.

{ "basic_days": 20, "additional_irregular_days": 5, "contractual_days": 2,
  "note": "Допълнително споразумение № 4" }
  • basic_days (required) — the основен отпуск, КТ чл. 155, ал. 4: at least 20 working days, or 26 when a ТЕЛК/НЕЛК decision of 50% or more is in force on any day of the month of the row's date (КТ чл. 319) — the decision is read by the month, as the monthly ЗДДФЛ чл. 18 relief reads it.
  • extended_days and extended_category — the удължен отпуск of КТ чл. 155, ал. 5 for the categories НРВПО чл. 24–31 name. It INCLUDES the basic leave, so it stands in its place and is never less than it; the category is required with it ("учител — чл. 24 НРВПО").
  • additional_hazard_days and additional_irregular_days — КТ чл. 156, ал. 1, т. 1 (специфични условия и рискове) and т. 2 (ненормиран работен ден): at least 5 working days each where it applies, 0 where it does not.
  • contractual_days — more by the contract or a КТД (КТ чл. 156а).
  • Whole working days, 0–366; note ≤ 500.
  • For a part-timer (since round 11b) the figures are the FULL-TIME ones the трудов договор states: the statutory part — the 20 (or 26) days, or the удължен отпуск — is counted at the share of трудов стаж each day is worth (НРВПО чл. 23, ал. 2; КТ чл. 355, ал. 2: a whole day at half the statutory day or more, pro rata below half — the 2027 rule that would have prorated every part-time day was struck down by the Constitutional Court), and the days above the statutory minimum (a higher basic_days, the чл. 156 lines, contractual_days) stay whole. Two hours of eight with basic_days 25 and additional_irregular_days 5 is 15 days a year: 5 + 5 + 5. The company's part_time_stazh setting (Payroll settings) may count every day as a full one. ЕТЗ т. 24 states the row's figure as agreed.

201 with the row the first time, 200 after — a PUT replaces the row for its date whole, and the same body again writes nothing and marks nothing stale. The balance of every year from the row's year on is restated, and every computed month from 1 January of that year turns stale: the accrual and a leaver's чл. 224 compensation read the figure. No month is refused for being posted — this restates balances, it does not reprice a posted фиш.

{ "data": {
  "employee": "01k…", "effective_from": "2026-01-01",
  "basic_days": 20, "extended_days": null, "extended_category": null,
  "additional_hazard_days": 0, "additional_irregular_days": 5, "contractual_days": 2,
  "total_days": 27, "note": "Допълнително споразумение № 4",
  "created_at": "…", "updated_at": "…" } }

422 validation_failed names every short field at once, with the minimum and the article (details.basic_days: „Basic paid annual leave is at least 20 working days (КТ чл. 155, ал. 4) …"), a key the row does not have, and effective_from when the date in the path is not YYYY-MM-DD between 2000 and 2099. GET /payroll/employees/{id}/leave-entitlements lists the rows, oldest first; DELETE /payroll/employees/{id}/leave-entitlements/{effective_from} removes one ("removed": false when there was none) and restates the same way.

PUT /payroll/employees/{id}/leave-postponements/{year} — one year of leave postponed under КТ чл. 176, ал. 1: the one fact that moves its давност. Ordinarily a year's leave is extinguished two years after the end of the year it is for (чл. 176а, ал. 1); postponed, two years after the end of the year the reason ceased (ал. 2; НРВПО чл. 38а).

{ "ground": "employee_other_leave", "postponed_on": "2025-11-20",
  "reason_ceased_on": null }
  • ground — employer_production (чл. 176, ал. 1, т. 1 — important production reasons), employee_other_leave (т. 2 — while on another statutory leave) or employee_request (т. 2 — at the person's written request).
  • postponed_on — the date of the written postponement; never before 1 January of the year it postpones.
  • reason_ceased_on — when the reason stopped: the return to work, the end of the production reasons. null while it lasts — and then the давност has not started. Never before postponed_on.

One postponement per person per year; a PUT replaces it (201 the first time, 200 after, the same body again is nothing). The answer carries expires_on, the last day that year's leave may be used — null while the reason lasts. It restates the balances and marks computed months stale as an entitlement does. GET /payroll/employees/{id}/leave-postponements lists them, oldest year first; DELETE /payroll/employees/{id}/leave-postponements/{year} withdraws one. 422 validation_failed names postponed_on before the year, a ground outside the three, a reason_ceased_on before postponed_on, and vintage_year when the year in the path is not YYYY between 2000 and 2099.

Both are for employees on a трудов договор only — a ДУК, a граждански договор and a самоосигуряващо се лице have no paid leave under the КТ (422 not_an_employee, details.type).

GET /payroll/employees/{id}/leave-time-without-work — on an employee continued after a reinstatement (reinstates, POST …/reinstatement): the time without work after the dismissal found unlawful and the paid annual leave it gives. That time is трудов стаж (КТ чл. 354, ал. 1, т. 1) and earns leave as if worked (Court of Justice of the EU, joined cases C‑762/18 and C‑37/19); the days are already inside the employee's leave balance by year, and a later termination's чл. 224 compensation pays what is unused.

{ "employee": "01J…", "dismissed": "01J…", "terminated_on": "2026-08-31",
  "from": "2026-09-01", "to": "2026-10-11", "return_on": "2026-10-12",
  "annual_days": 20, "left_out_days": 0, "working_days": 27,
  "other_employment_working_days": 0, "days": "2.20",
  "years": [{ "year": 2026, "days": "2.20", "working_days": 27 }],
  "other_employment": [],
  "compensated_at_dismissal": { "days": "8.33", "amount": { "amount": "793.33", "currency": "EUR" }, "period": "2026-08" } }
  • from / to — the day after the dismissal to the day before the return: the whole of it, as КТ чл. 354 counts it.
  • annual_days — the leave a year it is counted at: the employment's основен or удължен and contractual leave at the dismissal, never under the statutory minimum. left_out_days — the чл. 156 additional leave (ненормиран работен ден, специфични условия) the employment had, which the time without work does not earn: it is for work actually done under those conditions.
  • days, years — the leave the time gives, in total and per calendar year (each year's figure ÷ 12 by the working days of the time in each month, as the accrual counts every month). A year that ended before the return expires no earlier than two years after the end of the year of return.
  • other_employment — the periods the person worked for another employer in that time: their leave is that employer's (C‑37/19; КТ чл. 355, ал. 6), so their working days (other_employment_working_days) give nothing here.
  • compensated_at_dismissal — the чл. 224 compensation the dismissed employee's final pay paid (days null when it was confirmed as a sum): it stays the person's — not returned, not set off — and the days it paid for are not restored (ВКС, решение № 18/08.02.2013 по гр. д. № 1211/2012; определение № 60759/10.11.2021 по гр. д. № 2520/2021). null when there was none.

A dismissal annulled with no reinstatement (since round 8) — the dismissed employee whose employment was ended anew (POST …/annulment) answers too: the time runs from the day after the dismissal to the new day (ended_on; to the same day, return_on null), counted by the same rules — the person never came back to use it, so its days join no balance and the new termination compensates them (КТ чл. 224): compensated_at_termination — days, rate (the чл. 177 rate to the new day), amount, the settle_period that pays it and whether it is paid (null with nothing to compensate). Its PUT prices that compensation again, refused once it is paid (409 annulment_compensation_paid).

422 no_time_without_work (details.reinstates) for any other employee — a dismissed employee included, unless ended anew as above.

PUT /payroll/employees/{id}/leave-time-without-work — the periods the person worked for another employer during the time without work, replaced whole ([] clears them); answered as the GET.

{ "other_employment": [
  { "starts_on": "2026-09-01", "ends_on": "2026-09-30", "employer": "Друга фирма ООД" } ] }

Each period lies inside the time without work (422 validation_failed on other_employment.N.starts_on), ends_on not before starts_on, employer optional (up to 160 characters), at most 20 periods; a key a period does not have is refused by name. The same body again writes nothing; a change restates the leave balances from the first year of the time and marks computed months from 1 January of it stale. The keys the GET answers with ride along when sent back.

GET /payroll/employees/{id}/unpaid-leave-elsewhere (since round 10) — the unpaid leave the employee took with another employer, by year, as they stated it: statements, the latest year first, each with id, year, working_days, used_until (the last day of that leave, or null), document (certificate — an удостоверение from the other employer — or declaration — the employee's own), document_reference, document_date and employer. КСО чл. 9, ал. 2, т. 3 counts 30 working days of unpaid leave a year as осигурителен стаж — the person's year, whatever the employer (МТСП, „Въпроси и отговори", ID 4400) — so these days count towards the 30 before the unpaid leave recorded here: the 31st working day comes sooner, Д1 т. 16.5 holds fewer days, the interruption of the insurance (т. 14/15) and its record with вид осигурен 28 come earlier, and the run's unpaid_leave.elsewhere_days says how many the month's count read. An undated statement counts before every unpaid leave of the year recorded here (a former employer's — the usual case); a dated one before the leave here that begins after used_until (a second employment's). The трудов стаж of КТ чл. 160, ал. 3 is each employment's own: the ЕТЗ's т. 31 does not read them. 422 not_an_employee for anybody but an employee.

PUT /payroll/employees/{id}/unpaid-leave-elsewhere — one year's statements, replaced whole ([] clears the year); answered as the GET, with posted_months_moved: the posted months of the year whose split of the unpaid days — т. 16.5, the interruption, the вид осигурен 28 record — now differs from what they last declared (their newest correction already paid, else as posted). Since round 11 those months are corrected on the late-correction rail, as a late неплатен отпуск corrects its own: correction is null, or settle_period — the first open month, whose Д1/Д6 package carries each month's corrective record (код 1), its вид осигурен 28 record filed (код 0), corrected (код 1) or deleted (код 8), and its Д6 column — with months (each for_period and the amount the line pays, usually "0.00": one health contribution moves between the two records, a cent at most from their separate rounding) and past_deadline (as on PUT …/inputs: the months past their 30 April, whose records go on the носител). A month whose correction is still waiting is priced again; a statement changed after a correction was paid corrects the month again, back to as posted if need be. Each correction is a sick_correction carry-forward with sick.unpaid_elsewhere (below). onsets_moved lists a болничен, майчинство or бащинство whose first day the statements moved into or out of the interrupted insurance (absence_id, kind, onset, insured — as the statements now count — and the posted months its days reach): its right to НОИ's обезщетение and to the employer's two days is NOT moved — the corrections keep its days and pay as posted; decide with НОИ and the employee (КСО чл. 114, ал. 2, т. 2; КТ чл. 271–272). A posted month of a closed year (the employee's чл. 49 ЗДДФЛ recalculation of it settled): 409 unpaid_elsewhere_year_closed, nothing written.

{ "year": 2026, "statements": [
  { "working_days": 12, "document": "certificate", "document_reference": "У-7",
    "document_date": "2026-03-02", "employer": "Предишен ЕООД" },
  { "working_days": 3, "used_until": "2026-05-29", "document": "declaration" } ] }

working_days 1–262, used_until inside year (422 validation_failed on statements.N.used_until), document_date not after today, employer up to 160 characters, at most 20 statements; a key a statement does not have is refused by name. The same body again writes nothing; a change marks the computed months of the year stale.

PUT /payroll/employees/{id}/year-openings/{year} — the year so far: what your previous payroll system paid the person at this employer, from January through through_month, before Autonify took over. Send it for every person you bring over mid-year, and the annual steps read it beside the months computed here — the служебна бележка по чл. 45 ЗДДФЛ (код 101 columns 5, 6 and 9; codes 104 and 107), the чл. 49 recalculation and the справка по чл. 73, ал. 6. A person you hire later needs none.

{ "through_month": 8, "months": 8,
  "gross": "24000.00",
  "taxable_income": "24000.00", "contributions": "3307.20", "advance_tax": "2069.28",
  "food_vouchers": "0.00", "sick_pay_employer": "0.00", "disability_relief": "0.00",
  "base_month": "2026-08", "base_gross": "3000.00", "base_worked_days": "21" }
  • The figures are the old system's own totals for those months, as its служебна бележка or ведомости state them: taxable_income (column 5), contributions (the employee's own, column 6), advance_tax (column 9). months is how many of them carried pay (default: all of them). gross, disability_relief, food_vouchers (код 104) and sick_pay_employer (код 107, the employer-paid first sick days) are optional.
  • base_month, base_gross and base_worked_days — optional, all three or none — are the last month with at least 10 worked days (КТ чл. 177). Until a month computed here has 10, paid leave is priced on it instead of the contractual wage. It must be one of the months the opening covers.
  • One opening per person per year; a PUT replaces it whole. Nothing is recomputed from it: the months stay the old system's, and their payslips, ведомости and monthly declarations stay there.
  • 409 opening_overlaps_payroll when the months would reach a month computed here for the person (details.months) — the opening ends before the first month computed here. It holds the other way too: once the opening is saved, computing a month it covers is refused with the same code (Runs below). 409 period_in_future when through_month has not happened yet (details.current) — a 409 because the same body passes once the month has come, and a 422 would be replayed against its Idempotency-Key. 422 not_employment_income for anyone but an employee or a ДУК. 422 validation_failed names months when it exceeds through_month, base_month when it is outside the months covered, and any key an opening does not have (a misspelt food_voucher would otherwise be a бележка short by the whole код 104; the keys GET returns may ride along). Once the year's чл. 49 difference is settled in a posted month, the opening can no longer change (409 period_posted).
  • A write marks every computed month after the opening stale (its leave base may move): compute them again before posting.

GET /payroll/employees/{id}/year-openings lists the person's openings, newest year first, in the same shape with the money as money objects. DELETE /payroll/employees/{id}/year-openings/{year} removes one ("removed": false when there was none).

Running deductions

POST /payroll/employees/{id}/deductions — one запор, издръжка, advance or other удръжка the person carries from month to month: the deduction form on the employee's page in the app, with the type named by its code.

{ "external_id": "ZAP-2026-17", "type": "garnishment", "mode": "recurring",
  "amount": "200.00", "total_owed": "300.00", "start_on": "2026-10-01",
  "garnishment": { "authority": "private_bailiff", "case_number": "20268840400123",
                   "creditor_name": "ЧСИ Мария Иванова", "served_on": "2026-03-10",
                   "remit_iban": "BG80BNBG96611020345678" } }
  • type — garnishment (запор), alimony (издръжка — the current one), alimony_arrears (издръжка за минало време, since round 8), advance (the month's own advance), earlier_advance (an advance received in an earlier month, since round 8), overpayment, union_dues, voluntary, or a code of the company's own. Income tax and personal contributions are computed, never entered.
  • mode — recurring (every month from start_on, through end_on if given) or one_off (the month of start_on only).
  • Exactly one of amount (a month's figure) and percent_of_net (a percentage of the net pay). total_owed makes it a fixed total: the withholding stops, and the deduction turns settled, once the months computed here have collected it. Every amount is above zero.
  • A debt taken over mid-way goes in with what is LEFT of it. The running total counts only what the months computed HERE withhold — it starts at zero and is never sent. A запор of 2 000.00 of which the previous payroll already collected 1 700.00 goes in as "total_owed": "300.00"; sent as 2 000.00, the whole debt would be seized again. A create carrying collected_to_date, remaining or status is refused rather than half-honoured.
  • garnishment — the запорно съобщение behind a garnishment, an alimony or an alimony_arrears deduction (never another type): case_number and creditor_name, both required whenever it is sent — "garnishment": {} included (null sends no order); authority — private_bailiff (the default), state_bailiff, nra (НАП's публичен изпълнител) or municipality (a municipality's, since round 8); served_on — the day the запорно съобщение was served on the employer, the order the запори are withheld in since round 8 (today by default — the employer's чл. 508 ГПК reply is due a week later, reply_due_on — a публичен изпълнител's order, НАП's or a municipality's, keeps three days, the ДОПК setting no reply term); principal (by default total_owed); and remit_iban, the account the withheld money is remitted to — without it, register.csv carries the remittance row with no pay_amount. An издръжка — current or past — is a bailiff's: its order naming nra or municipality is 422 validation_failed on garnishment.authority (the state's claim for an издръжка it paid in the debtor's place is a public receivable — send it as type: garnishment).
  • is_alimony follows the type. An издръжка is withheld first and never capped (чл. 446, ал. 4 ГПК); a запор is capped under чл. 446 and withheld after it — and the payroll decides that by the TYPE. So a запор for издръжка is sent as type: alimony, and its order reads is_alimony: true by itself; so does an alimony_arrears order — the arrears are „по вземане за издръжка" too, and the ЕТЗ's т. 33 reports them; is_alimony you send must agree with the type (true on a garnishment, or false on an alimony or alimony_arrears, is 422 validation_failed on garnishment.is_alimony).
  • What limits a запор (since round 7). A private_bailiff's or state_bailiff's (and an overpayment) is limited by ГПК чл. 446: one ceiling for all of them, the band's fraction of the net less the издръжка withheld that month (ал. 4 — „удръжките … за другите задължения … се правят върху остатъка"), never leaving less than the minimum wage (ал. 3). An nra order — НАП's публичен изпълнител — or, since round 8, a municipality one — a municipality's, whose employees impose a запор for the local taxes and fees as публични изпълнители (ЗМДТ чл. 4, ал. 3; ДОПК чл. 198, ал. 3) — is limited by ДОПК чл. 213, ал. 1, т. 5 instead: no band and no fraction; the person keeps the minimum wage and half of what НСИ's average gross monthly wage of the latest quarter published by the month's end exceeds it (payroll.nsi_average_gross_wage on /payroll/legal-parameters — 620.20 + (1 444.00 − 620.20) ÷ 2 = 1 032.10 from 12.08.2026), measured on the net left at its turn (after the издръжка and any запор recorded before it, of both employees of a reinstatement), and what it takes counts against the ceiling of a ГПК запор after it (КТ чл. 272, ал. 2). A municipal claim handed to a ЧСИ is collected under the ГПК — send it as the private_bailiff's. Запори are withheld in the order they were served on the employer (served_on, since round 8 — „Запорът … се смята за наложен спрямо третото задължено лице от деня, в който му е връчено запорното съобщение", ГПК чл. 450, ал. 3; ДОПК чл. 202, ал. 3 the same), on one day in the order recorded; until round 8 the order recorded alone decided, so one typed in late was withheld after one served later. Arrears of издръжка (издръжка за минало време) are, since round 8, type: alimony_arrears: limited like a запор, on what the current издръжка leaves (ГПК чл. 446, ал. 4), and withheld with the запори in the order served — not first and whole like the current издръжка, which stays first whatever its day.
  • The two advances (since round 8). advance is the month's own — the salary paid early (КТ чл. 270, ал. 2), not a deduction from it: outside the ceiling, taken from what the издръжка and the запори leave, and counted as the person's for the minimum wage the ceiling leaves. earlier_advance is an advance received in an earlier month (on future pay, a month that did not earn it, an expense advance not accounted for): a deduction without consent (КТ чл. 272, ал. 1, т. 1), held with the запори, the overpaid sums and the takebacks within one ceiling for the month (ал. 2), after the запори; with a total_owed the rest goes on into the next months. A run item's deduction says which law limited it (limit, GET /payroll/runs/{YYYY-MM}). What the month's pay cannot take back of the month's own advance — the издръжка and the запори went first, or the month paid too little — is carried, since round 8, into the next month the person is paid as an earlier_advance line (capped with the запори, the minimum wage left; what that cannot take is carried again): carried_forward on the advance's line, carried_from on the carried one (Payroll runs, deductions). Until round 8 it was dropped. A recurring advance with a total_owed is paid early month after month until the total is paid: since round 9 a month asks back, as its own, the total less what the earlier months paid of it — taken back or carried in — so its own line and the remainder carried beside it never pass the total (until then the month asked the total less its own lines alone).
  • end_on, consent_reference (≤ 120) and note (≤ 255), as in the app. Dates are YYYY-MM-DD, amounts at most two decimals, percent_of_net at most four and below 100 (at most 99.9999).
  • The deduction marks stale every computed month it can reach — a one_off its own month, a recurring one its window (with a total_owed, every month from start_on): compute them again before posting. A posted month is no reason to refuse while the deduction still has an open month to be taken in: a posted month keeps what it withheld, and the deduction applies from the next month computed. A deduction no open month can take — a one_off dated in a posted month, or a recurring one whose whole start_on–end_on window is posted, a fixed total_owed included (nothing is withheld after end_on, whatever is still owed) — is 409 period_posted (details.months) rather than accepted and never withheld. So is one whose window ends before the first month this company's payroll was computed here — those months were the previous system's: 422 validation_failed on end_on (start_on for a one_off). Date it in the month it is to be taken from.

201 with the deduction. Safe to send again, with a new Idempotency-Key: the same external_id (unique per employee) with identical data → 200 and the deduction that exists, nothing written; with different data → 409 deduction_exists, details.id. The external_id stays with its deduction for good — cancelled or settled — so a corrected deduction is a new one under a new id. Without an external_id every create is a new deduction, and a deduction a person entered in the app carries none and is never matched by one: read the person's list first, and do not send it again — two rows are the same debt withheld twice.

  • 422 not_employment_income — deductions are withheld from an employee's or a ДУК's pay only; a граждански договор's fee is garnished under a procedure the payroll does not apply, and a self_insured person is paid nothing here. details.type.
  • 422 validation_failed names the field: a key a deduction does not have (collected_to_date, remaining and status included), a type no catalogue has or one the payroll computes, garnishment on another type, both or neither of amount and percent_of_net, a zero, a percent_of_net of 100 or more, an end_on before start_on, an order without its case number or creditor, an is_alimony against the type, an издръжка's order naming a публичен изпълнител, an authority not listed above, an IBAN a bank would refuse, and — since round 8 — a garnishment.lifted_on or garnishment.lifted_reference (since round 9 a garnishment.lifted_from) that is not null (an order is recorded standing; record its lifting with PATCH). The keys GET returns that change nothing (id, employee, category, created_at, updated_at, garnishment.reply_due_on, a null garnishment.lifted_on, lifted_reference and lifted_from) may ride along.
  • 409 payroll_busy, as for every payroll write; 404 not_found for an employee of another company.

GET /payroll/employees/{id}/deductions — the person's deductions, oldest first, whatever their status:

{ "data": [ {
  "id": "01k…", "external_id": "ZAP-2026-17", "employee": "01k…",
  "type": "garnishment", "category": "garnishment", "mode": "recurring",
  "amount": { "amount": "200.00", "currency": "EUR" }, "percent_of_net": null,
  "total_owed": { "amount": "300.00", "currency": "EUR" },
  "collected_to_date": { "amount": "200.00", "currency": "EUR" },
  "remaining": { "amount": "100.00", "currency": "EUR" },
  "repaid_in_cash": null, "repayments": null, "carried_remainder": null,
  "status": "active", "start_on": "2026-10-01", "end_on": null,
  "consent_reference": null, "note": null,
  "garnishment": { "authority": "private_bailiff", "case_number": "20268840400123",
                   "creditor_name": "ЧСИ Мария Иванова", "is_alimony": false,
                   "principal": { "amount": "300.00", "currency": "EUR" },
                   "served_on": "2026-03-10", "reply_due_on": "2026-03-17",
                   "lifted_on": null, "lifted_reference": null, "lifted_from": null,
                   "remit_iban": "BG80 •••• 5678" },
  "created_at": "…", "updated_at": "…" } ] }

collected_to_date and remaining move when a month is computed (a recompute restates them), not when it is posted. status is active, paused, cancelled, or settled once the total is collected. Since round 9 an advance's collected_to_date counts what later months took back of its remainder too (the earlier_advance rows carried from it), so it settles once its total_owed is reached; and the remainder follows the advance — a cancelled advance carries nothing more, a paused one is carried on with nothing taken. Since round 9's follow-up an advance also carries repaid_in_cash — what was paid back of it in cash or by a transfer — and repayments (each as POST …/repayments answers it; both null on any other deduction), and its remaining is total_owed less collected_to_date and repaid_in_cash; and carried_remainder — what the latest month computed here left to take back of it, as the advance now stands and less what was paid back since: what the next month the person is paid asks of it, with or without a total_owed (null when it carries nothing; until then a read of an advance without a total said nothing of it). They are a read's: a create or a PATCH sending them is 422 validation_failed naming where each comes from. The order's account comes back masked, like the employee's IBAN. An order's case_number or creditor_name may be null (since round 8): a запор entered in the app keeps its order with what was known — a case number, a creditor, an account, or a публичен изпълнител as who served it, which decides the law that limits it from the first month — and the missing particulars are added later, in the app or with PATCH below. An order this API records always has both. lifted_on (since round 8) is the day the employer received the enforcer's lifting of the запор (ГПК чл. 433, ал. 3; ДОПК чл. 225, ал. 2) and lifted_reference its letter. lifted_from (since round 9, YYYY-MM) is the first month whose pay the lifting reaches: that month and every later one withhold nothing, the months before keep what they withheld. A month's pay is paid after it ends, and pay paid after the lifting is paid whole (ГПК чл. 507, ал. 2 and чл. 512, ал. 4; ДОПК чл. 206, ал. 2 and чл. 211, ал. 1): with the lifting the payroll records the month before lifted_on's while that month is not posted — no door of the app pays a month before it is posted — else lifted_on's own month (the rule until round 9); correct it with PATCH. All three null while the order stands.

After a reinstatement (POST /payroll/employees/{id}/reinstatement) the dismissed employee and the one the employment goes on in are one employment with two employee ids: a deduction recorded on either binds the pay booked on both — a запор extends to „всяко друго възнаграждение на длъжника … при същия работодател" (ГПК чл. 512, ал. 1) — and each employee's list carries both. On each row employee is the employee it was recorded on and carried is true when that is the other one (false everywhere else). Nothing is copied: one queue (издръжка first, then the type's order, then the order recorded), each deduction against its own total_owed and what both employees' months withheld of it. In a month both employees are paid (the чл. 225 обезщетение and the salary from the day of return), the чл. 446 ceiling is measured on the pay of both and the minimum wage is left of the whole (ал. 3), and a monthly amount is withheld once. A POST for the continued employee with the external_id of a deduction the dismissed one carries is that deduction (200, carried: true) — never a second one. A reinstatement taken back moves the deductions recorded on the continued employee to the dismissed one. Since round 9 an advance's remainder is the employment's too: what a month of the dismissed employee left of an advance (carried_forward on a run item's deduction) is taken back from the continued employee's pay as an earlier_advance — once in a month both are paid.

PATCH /payroll/deductions/{id} — what the app lets a person change once a deduction exists, and nothing else: status (active, paused or cancelled; settled is the payroll's to set), garnishment.remit_iban (null clears it), and — since round 8 — garnishment.case_number and garnishment.creditor_name, which an order recorded in the app without them takes: added, never changed; and the order's days: garnishment.served_on (corrected — a day left out was the day the order was recorded, and the запори are withheld in the order served; the reply's due day moves with it while the reply is pending), garnishment.lifted_on (the day the lifting was received; null takes a lifting recorded by mistake back), garnishment.lifted_reference (≤ 120, the letter) and — since round 9 — garnishment.lifted_from (YYYY-MM, the first month whose pay the lifting reaches; null for the payroll's month).

{ "status": "paused", "garnishment": { "remit_iban": "BG25UBBS80021234567890" } }

For an order whose case_number and creditor_name read null:

{ "garnishment": { "case_number": "С260024-119-0021907", "creditor_name": "ТД на НАП София" } }

A запор lifted (since round 8):

{ "garnishment": { "lifted_on": "2026-10-12", "lifted_reference": "Изх. № 12345/11.10.2026" } }

September not posted, the payroll records lifted_from: "2026-09" with it — September's pay is paid after the lifting. Paid before it after all (outside the app), say so (since round 9):

{ "garnishment": { "lifted_from": "2026-10" } }

A status change marks the computed months the deduction reaches stale, and so does a day served or lifted; the account and the particulars alone mark nothing. A day after today, a lifted_on before served_on — or a served_on moved after the lifting — is 422 validation_failed on it; a day for a deduction with no order, likewise; and so is a lifted_from with no lifting, after lifted_on's month, before the deduction's start_on, or naming a posted month (it withheld and keeps it — if its pay was still unpaid when the lifting arrived, pay the employee what it withheld and do not remit it). An издръжка's order received or lifted (alimony, alimony_arrears) prepares the ЕТЗ's код 1 record of the contract's latest filed record with т. 33 — 1 after the receipt, 0 after the lifting — due three days from the day served or lifted (Наредба за вписване в регистъра на заетостта, чл. 10, ал. 1, т. 6; Приложение № 1, т. 2, Забележка 1): it goes with the register's next package (GET /payroll/employment-records). Nothing is prepared while the latest record waits for its own package (it files т. 33 as the data stand), after the employment ended, or for a record filed outside the app. They are written together or not at all. A case number or a creditor the order holds already, sent as it stands, changes nothing; sent otherwise it is 422 validation_failed on it — an order's particulars are what the запорно съобщение says; an empty one is refused too. Any other field — the amounts, the dates, the order's other facts (authority among them) — is 422 validation_failed naming it: cancel the deduction and record a new one. An account, a case number or a creditor for a deduction with no order behind it is 422 validation_failed on its field. A settled deduction's status no longer changes (422 validation_failed on status): the months computed here collected its whole total_owed, and set back to active it would withhold nothing while reading as a debt still running — its account still changes. A body that is not JSON is 400 invalid_json. A deduction of another company, or of a person removed from the roster, is 404 not_found; a busy payroll, 409 payroll_busy, with nothing written. There is no DELETE, here or in the app: a deduction that should stop is cancelled, and the months that withheld it keep pointing at it.

POST /payroll/deductions/{id}/repayments (since round 9) — part of an advance (advance or earlier_advance) the person paid back in cash or by a transfer. The payroll withholds it no more: performance to the creditor extinguishes the debt that far (ЗЗД чл. 75), and without the person's consent only advances received and still owed are withheld (КТ чл. 272, ал. 1, т. 1). Until round 9 a remainder carried on could be stopped only whole, by cancelling the advance.

{ "amount": "100.00", "repaid_on": "2026-08-05", "note": "ПКО № 17" }

repaid_on is the day the money was received — not after today, not before the advance's start_on; note is optional (≤ 255). The repayment applies from applies_period, the first month whose pay takes it into account: the month before repaid_on's while that month is not posted (its pay is paid after the repayment, through the app), else repaid_on's own — never a posted month (then the next one that is not) nor one before the advance. In that month the remainder carried in is asked less first — the oldest of the debt (ЗЗД чл. 76) — then the month's own advance. An earlier_advance typed by hand (a debt by instalments, with a total_owed) owes that much less, so its instalments end sooner. An advance with a total_owed counts what was paid back as paid: it is settled once what the months took back and what was paid back reach the total. 201:

{ "data": {
  "repayment": { "id": "01k…", "amount": { "amount": "100.00", "currency": "EUR" },
                 "repaid_on": "2026-08-05", "applies_period": "2026-08", "note": "ПКО № 17",
                 "source": "api", "created_at": "…" },
  "deduction": { "…": "the deduction, as GET reads it" } } }

The computed months from applies_period on go stale. Nothing is posted: it is booked Дт 501/503, Кт 421. Refused: 422 validation_failed on amount past what the payroll still withholds of the advance from applies_period on (the message names it), and on repaid_on after today or before the advance; 422 not_an_advance for another kind of deduction (a запор's money goes to its enforcer); 422 no_total_owed for an earlier_advance with no total_owed; 409 deduction_cancelled for a cancelled advance (record the repayment before cancelling it); 409 nothing_owed when nothing of it is withheld from that month on (details.period); 409 employment_ended when the employment has no month from applies_period on (details.period) — what is owed is then the leaver's open claim, and the repayment is recorded there (POST /payroll/employees/{id}/open-claim/settlements, part: advance, outcome: collected).

The month, named (since round 10, 2026-10-07). The body may carry applies_period (YYYY-MM) when the payroll's own month would be wrong — the month before was paid outside the app before it was posted, the advance withheld in full (name repaid_on's own month), or an earlier month's pay is still unpaid (name it). Left out or null, the payroll picks it as above. The lifting's refusals, 422 validation_failed under applies_period: a month after the first one whose pay is paid after the repayment — repaid_on's own, or the first not posted after it — (that pay, and every later one's, is paid once the money is back); one before the advance; a posted month (it withheld the advance and keeps it); not a month.

PATCH /payroll/deductions/{id}/repayments/{repayment} (since round 10) — a recorded repayment's applies_period corrected, the only field it changes:

{ "applies_period": "2026-09" }

A month, or null for the payroll's own again. 200 with repayment and deduction; the computed months from the earlier of the two go stale. Refused as POST's applies_period is, and 409 repayment_applied while the month it applies in now is posted (details.period — that month withheld less for it, and keeps it), 409 employment_ended for a month the employment does not reach. Moved to an EARLIER month, the sum is measured again against what the payroll withholds of the advance from that month on, the repayment itself left out (422 validation_failed under applies_period, naming it); moved to a later one it keeps the measure it was recorded against — the months between are computed again, and what they take of the advance is theirs.

DELETE /payroll/deductions/{id}/repayments/{repayment} (since round 9) — a repayment recorded by mistake, taken back: 200 with deduction; the computed months from its applies_period on go stale. Once that month is posted it stays — that month withheld less for it: 409 repayment_applied (details.period); if the money was never received, record what is still owed as an earlier_advance.

Standing allowances

POST /payroll/employees/{id}/allowances — one allowance the person is paid every month from a date, instead of a one-off line sent every month: the „Постоянни добавки" section of the employee page in the app, which writes through the same rules.

{ "external_id": "ALW-1001-RESP", "permanent": true,
  "label": "за отговорност", "amount": "150.00",
  "starts_on": "2026-10-01", "ends_on": null }
  • permanent (required) — is the allowance of a permanent character? НСОРЗ чл. 15, ал. 2: paid „постоянно заедно с полагащото се за съответния период основно възнаграждение" and dependent „единствено от отработеното време". It decides two things:

    • true — paid as standing_allowance, for the days worked inside its window, like the basic salary (a month of unpaid leave pays none of it), and inside the bases built from permanent pay: the paid-leave base (КТ чл. 177; НСОРЗ чл. 17, ал. 1, т. 3), the contract's wage the overtime uplift (чл. 262, ал. 2) and the termination compensations (чл. 228) are priced on;
    • false — paid as allowance, whole in every month its window reaches, whatever the days worked, and outside those bases. End it for a long leave if it should not be paid through it.

    Both are in the sick-pay base (КСО чл. 40, ал. 5 — the month's gross, one-off lines aside), both are taxable and insurable.

  • amount (required) — a month's figure, above zero, at most two decimals.

  • starts_on (required) and ends_on — the first and the last day it is paid for, YYYY-MM-DD; no ends_on is no end. A window that begins or ends mid-month pays a permanent allowance for the days worked inside it and a non-permanent one whole.

  • label (≤ 120) — the employer's name for it, printed on the фиш and returned on the run's components as label; without one the фиш prints the kind. note (≤ 255).

  • external_id — your id for the allowance (≤ 64 printable characters), unique per employee.

201 with the allowance. Safe to send again, with a new Idempotency-Key: the same external_id with identical data → 200 and the allowance that exists, nothing written — a cancelled one included, so a re-sync never revives it; with different data → 409 allowance_exists, details.id. Without an external_id every create is a new allowance: read the person's list first.

Every computed month the window reaches turns stale. A posted month is no reason to refuse while the allowance still has an open month to be paid in: a posted month keeps what it paid, and the allowance is paid from the next month computed. One no open month can take — a window wholly inside posted months — is 409 period_posted (details.months). With "retro": "pay_in_open_month" what the posted months of the window owe is paid in the first open month as a retro_pay line, priced as the month it is for (Corrections).

{ "data": {
  "id": "01k…", "external_id": "ALW-1001-RESP", "employee": "01k…",
  "code": "standing_allowance", "permanent": true, "label": "за отговорност",
  "amount": { "amount": "150.00", "currency": "EUR" },
  "starts_on": "2026-10-01", "ends_on": null, "status": "active",
  "posted_months": [], "note": null, "created_at": "…", "updated_at": "…" } }

posted_months are the posted months whose payroll paid it. status is active or cancelled.

  • 422 not_an_employee — standing allowances are paid under a трудов договор only: НСОРЗ governs the pay of a трудово правоотношение, and a ДУК manager's pay is the contract's (PATCH the employee's gross_monthly_salary). details.type.
  • 422 validation_failed names the field: permanent missing, a zero amount, an ends_on before starts_on, a window that lies wholly outside the employment, a key an allowance does not have — status included, which a create does not set. The keys GET returns that change nothing (id, employee, code, posted_months, created_at, updated_at) may ride along.
  • 409 payroll_busy, as for every payroll write; 404 not_found for an employee of another company.

GET /payroll/employees/{id}/allowances — the person's allowances, oldest first, cancelled ones included.

PATCH /payroll/allowances/{id} — what the app lets a person change once an allowance exists, and nothing else: ends_on (a date ends it, null reopens it) or status: "cancelled" — one of the two, never both.

{ "ends_on": "2026-12-31" }

The amount, the label, the start and the character never change: a new amount is the old allowance ended the day before and a new one recorded, so every posted month keeps pointing at the allowance that paid it. Any other field is 422 validation_failed naming it. A posted month that paid the allowance is never taken away from it: an ends_on before the end of such a month, or a cancellation once one exists, is 409 period_posted naming the months — end it on or after the last day of the last of them. A cancelled allowance is final (422 validation_failed). The months the change moves turn stale. An allowance of another company, or of a person removed from the roster, is 404 not_found; a busy payroll, 409 payroll_busy, with nothing written; a body that is not JSON, 400 invalid_json. There is no DELETE, here or in the app.

Personnel documents

The person's personnel file — contracts, annexes, orders, ID documents, medical papers, certificates — kept in the vault (Сейф): encrypted at rest before it touches the disk, one stored document per paper (metered as documents are), and every read recorded in the audit log with the key's person as the one who opened it. The same file as the „Документи" section of the employee's card.

POST /payroll/employees/{id}/documents — multipart/form-data, with an Idempotency-Key like every write:

Field
file required. pdf, jpg, jpeg, png, doc, docx, xlsx or txt, at most 25 MB. Judged by its content, not its name: a text file named .docx is refused.
personnel_category required. contract, annex, order, id_document, medical, certificate, termination or other.
title ≤ 200. Without one, the file's own name.
document_date YYYY-MM-DD — the paper's own date (signed, issued), not the upload's.
notes ≤ 2000.

Any other field is 422 validation_failed naming it. 201 with the document:

{ "data": {
  "id": "01k…", "title": "Трудов договор № 12", "category": "contract",
  "filename": "trudov-dogovor.pdf", "mime": "application/pdf", "size_bytes": 184233,
  "document_date": "2026-01-02", "notes": null, "uploaded_by": "Мария Иванова",
  "uploaded_at": "2026-09-28T09:14:03+00:00", "employee": "01k…", "carried": false,
  "download_url": "/api/v1/payroll/employees/01k…/documents/01k…" } }

GET /payroll/employees/{id}/documents — the person's papers, newest first; meta.categories lists the categories. After a reinstatement (since round 8) the dismissed employee and the one the employment goes on in have one file: either's list holds the papers filed on both — employee is the employee a paper was filed on, carried is true when that is the other one — and either's path downloads them.

GET /payroll/employees/{id}/documents/{document} — the file itself, as bytes (§4 „Binary answers"), with an ASCII filename. The read is recorded before the bytes leave. A paper of another employee under this path is 404 not_found, as is another company's employee; a stored file that no longer reads back as it was filed is 409 document_unreadable — nothing wrong with the request, contact support.

There is no DELETE: a paper removed in the app goes to its bin, which only a person empties. How long papers are kept: until somebody removes them in the app; nothing deletes one on a date, and the bin never empties itself.

Legal parameters in force

GET /payroll/legal-parameters?date=YYYY-MM-DD — the payroll law as the engine reads it on that date (today on the Sofia calendar without one): every payroll parameter with its value, the period of the row in force (effective_from, effective_to), its legal source and its confidence (settled, evolving, contested), grouped as the app's page groups them.

{ "data": {
  "date": "2026-09-28",
  "groups": [ { "group": "wages", "parameters": [
    { "key": "payroll.minimum_wage_monthly", "kind": "money", "status": "in_force",
      "value": "620.20", "currency": "EUR", "effective_from": "2026-01-01",
      "effective_to": null, "legal_source": "…", "confidence": "settled",
      "carried_forward": false, "cadence": "annual" } ] } ],
  "upcoming": [],
  "mod_table": { "in_force": true, "from": "2026-08-01", "to": "2026-12-31",
                 "cells": 1152, "last_ended_on": null, "next_from": null },
  "company": { "activity": { "code": "62.01", "follows_company": true },
               "tzpb": { "rate": "0.40", "source": "division", "division": "62" },
               "mod": [ { "qualification_group": 1, "floor": "936.00", "source": "mod" } ],
               "sirv": null },
  "mod_gap": null } }
  • kind says how to read value: money (with currency), percent, fraction (0.70 = 70 %), days, years, hours, months; rates is a list of {part, value} percentages (the funds of a contribution split); tzpb and garnishment summarise their tables.
  • status: missing — no row for the date: the engine would refuse a month that needs it.
  • status: ended (since 2026-10-28) — a value the law no longer sets: the parameter's last row ended before the date with nothing after it, and the engine computes without it. The row is the last one in force (value, effective_to its last day, legal_source saying what ended it) — e.g. payroll.night_work_supplement_min_hourly, the 0,51 € a night hour floor that ПМС № 201/14.10.2026 deleted from НСОРЗ чл. 8 from 23.10.2026, after which a night hour is priced at 0,15 % of the minimum wage alone. Only a value set by an act ends this way, and only once the registry records that the act ended it; any other row that lapsed with nothing after it — one set every year or quarter (cadence) above all — is missing.
  • carried_forward: true — a value set every year (the minimum wage, the insurable-income caps, the ТЗПБ table) still standing on an earlier year's row: right only if nothing new was enacted. cadence (since round 7) says how often a new value is due — annual, quarterly or null (set by an act, whenever it is amended): a quarterly value is carried_forward once its row is more than four months old.
  • payroll.nsi_average_gross_wage (since round 7, pay, quarterly) — НСИ's average gross monthly wage of the latest quarter published by the date, one row per release dated from the day it was published: what a запор of a публичен изпълнител leaves the person above the minimum wage (ДОПК чл. 213, ал. 1, т. 5 — see „Running deductions").
  • upcoming — rows already loaded that start after the date; the payroll applies them by itself from their day.
  • company — the key's company's own reading: the activity code it is priced by (activity.code — the company's own КИД, or one the payroll settings set apart: follows_company: false), the ТЗПБ that code reaches (source: default is the top band, no code at all) and the МОД floor of each qualification group (mod, mod_half, exempt, or mrz — the minimum wage fallback).
  • mod_gap — not null when no МОД table is loaded for the date after one has ended: every group's floor falls back to the minimum wage, which understates contributions wherever the new table stands higher. The app warns on the run of such a month; recompute it once the table is loaded.

A date that is not YYYY-MM-DD between 2020 and 2100 is 422 validation_failed.

Readiness

GET /payroll/readiness — what is missing before the company's payroll and filings come out right, for the company and for every active person: the „Готовност на данните" card on /payroll. Hold a migration until it is clean.

{ "data": {
  "as_of": "2026-09-28",
  "summary": { "people": 42, "people_with_gaps": 3, "company_gaps": 1,
               "by_severity": { "blocks_compute": 1, "blocks_filing": 4,
                                "blocks_payment": 1, "degrades": 2, "optional": 6 } },
  "company": [ { "check": "company.nkid_code", "severity": "blocks_filing",
                 "field": "nkid_code", "message": "…" } ],
  "employees": [ { "id": "01k…", "external_id": "E-1001", "name": "…", "type": "employee",
                   "items": [ { "check": "person.contract_ground", "severity": "blocks_filing",
                                "field": "contract_ground", "message": "…" } ] } ] } }

Severities, gravest first: blocks_compute (the month cannot come out right: no pay, no declared income), blocks_filing (the ЕТЗ's т. 10, 12, 14, 19 or the company's т. 21; a sick absence this month or last without its bolnichen_number, which приложение № 9 cannot carry; since round 11c person.first_name_cyrillic, person.middle_name_cyrillic and person.last_name_cyrillic — a name typed in Latin letters with no Cyrillic form, which the filings carry as a proposal, Employees), blocks_payment (no IBAN: left out of the bank file; since 2026-10-22 also person.iban_invalid — an IBAN on the card that is no IBAN, a wrong check digit or a wrong length: the bank file leaves such a person out as invalid_iban, and this names them before the month is paid, among the people saved before the card checked what it was given), degrades (computed on a fallback: the ТЗПБ top band, the МОД at the minimum wage; since round 11 also person.below_minimum_wage — a salary under the minimum wage the legal parameters hold for the day, by the working time, or a rate by the hour under the hourly one: record the decree as a pay act to the minimum, Employer-wide pay acts; since 2026-10-10 person.class_percent_below_minimum — the card's own клас percent under the legal minimum of the day, paid as entered and never clamped — and person.class_percent_below_company_rate — under the company's own rate in force by a КТД or the internal pay rules, likewise paid as entered; since 2026-10-22 person.lnch_check_digit — a ЛНЧ, declared or read off a number that fails the ЕГН check, whose tenth digit is not the control digit of the weights 21, 19, 17, 13, 11, 9, 7, 3, 1 modulo 10: a WARNING only, never a refusal — the number is filed as entered, because a служебен номер from НАП is filed under the same code and is not shown to follow that digit, and no Bulgarian act we could find states it), optional (a default is assumed). field is the employee or settings field that fixes it; message is in English.

upcoming (since 2026-10-10) lists what is coming — never a gap, never in summary, and nobody is notified of it: seniority_step (an employee whose клас steps up next month: id, name, on, years, percent), raise_proposed (a pay act a raise rule prepared that is not applied yet: id — the act's —, name — the rule's —, on, reference) and raise_auto_applied (an act a rule in auto_apply applied on its own in the last 31 days, with raised).

A company of more than 5,000 people (since build round 2026-10-12): the check reads every active person — about 4 seconds at 5,000 — so past that line it is prepared in the background and answered 202 with where it is and a Location:

{ "data": { "report": { "id": "01k…", "status": "queued", "processed": 0, "total": 12000,
                        "error_code": null, "created_at": "…", "finished_at": null,
                        "expires_at": "…" } } }

GET /payroll/readiness/reports/{id} reads it back: status is queued, running, done or failed (error_code readiness_failed), processed of total say how far it is, and once done the answer carries as_of, summary, company, employees and upcoming exactly as above, beside report. A finished check answers again — 200, whole — for the same day while nothing it reads has moved (a card, an absence, a salary or working-time row, a pay act or raise rule, the company's клас rates) and for at most 30 minutes; asking again while one is being prepared answers that one. Kept for a day, then 404. Under the line it is answered in the request as before; send Prefer: respond-async to have a company of more than 1,000 people prepared in the background too.

A month's inputs

PUT /payroll/periods/{YYYY-MM}/inputs — one month, up to 1,000 employees a call, one transaction: it all goes in, or none of it does.

{ "employees": [
  { "external_id": "E-1001",
    "hours": { "overtime_workday_hours": "4", "night_hours": "8" },
    "components": [ { "code": "bonus", "amount": "300.00", "note": "Q3" } ] },
  { "employee": "01k…",
    "absences": [ { "external_id": "SICK-2026-118", "kind": "sick",
                    "start_date": "2026-10-12", "end_date": "2026-10-14",
                    "bolnichen_number": "E20260012345",
                    "bolnichen_issued_on": "2026-10-12", "presented_on": "2026-10-15" } ] }
] }

Name each employee by employee (our id), external_id (yours — the employment active in the month), or both. An entry may carry three sections; a section left out is not touched, a section sent is the truth:

  • hours — the month's hours, whole: night_hours, overtime_workday_hours, overtime_weekly_rest_hours, overtime_holiday_hours, holiday_worked_hours, worked_hours, note. A bucket left out is zero; worked_hours left out is the month's норма — so "hours": {} clears the month's extra hours. Only for a трудов договор (422 hours_not_applicable). For an employee paid by the hour, worked_hours is what the rate pays: left out, the month is refused (409 salary_inputs_missing) — see The salary above.
  • components — one-off pay lines, one per code per month; sending a code again corrects its amount, and "amount": null removes the month's line of that code. Codes you do not name are left alone. Only what is ADDED pay: bonus, allowance, and other-category codes, global or the company's own. Also the kinds below — a reimbursement, a recovery, equity income, and a bonus or allowance sent as a net amount (Kinds of one-off line). Everything the payroll derives itself — basic, seniority_class, night, overtime, holiday_work, food_voucher, every chl* обезщетение and the чл. 49 settlement — is 422 component_not_allowed: a one-off basic would replace the salary, and a typed chl224_unused_leave beside the one a termination generates would pay it twice. So is standing_allowance, which is a standing line (Standing allowances above): a permanent allowance paid once would lift the leave base of the months after it. Employees and ДУК only (422 components_not_applicable).
  • absences — keyed by your external_id. The same absence again is nothing; a changed one is replaced; an absence this API wrote (it carries an external_id) that starts in this month and is missing from the list is deleted — so "absences": [] clears the month's. An absence a person entered in the app has no external_id and is never touched — it can only refuse a new one that overlaps it (409 absence_overlaps). An absence belongs to the month it starts in: a sick leave from 28 September to 6 October is sent with September. Kinds: paid_annual, additional_annual, unpaid, sick, maternity, paternity, childcare, father_childcare (since 2026-10-04), adoption, adoption_paternity (since round 11), the leaves of КТ чл. 157 and 159 the employer pays at the чл. 177 rate (since round 11b): chl157_marriage (ал. 1, т. 1), chl157_blood_donation (т. 2), chl157_bereavement (т. 3) — these three when a КТД or an agreement pays them, otherwise an unpaid leave with their unpaid_ground — chl157_workers_body (т. 5а), chl157_prenatal and chl157_ivf (ал. 2 — a pregnant worker's, an in-vitro treatment's examinations), chl159_union (чл. 159); and other. The child fields of the app's form apply to maternity, paternity, childcare, father_childcare, adoption and adoption_paternity. Paid leave is recorded as granted leave — a заповед already signed — and is not refused for the balance. A leave of чл. 157 is priced as the paid leave (the chl177_paid_leave line, its НСОРЗ чл. 21 supplements, days.paid_leave, Д1 т. 16.1) and never draws on the annual balance. One longer than the law gives it is refused 422 absence_invalid, details.reason absence_civic_too_long: two working days a row for т. 1–3 (as a kind or an unpaid_ground), twenty for chl157_ivf. A sick absence needs its bolnichen_number — the е-болничен's twelve characters (a letter, the year, seven digits): приложение № 9 is keyed on it. One sent without it is still recorded and still priced, and is not refused — but it is left out of приложение № 9, the filing's caveats name it and GET /payroll/readiness reports person.bolnichen_number until it is sent. A leading Cyrillic „Е" or „Р" — the same glyph as НОИ's Latin E and P, typed on a Bulgarian keyboard — is stored as the Latin letter. presented_on is the day the paper reached you — the болничен of a sick or maternity row, and (since 2026-10-03) the заявление-декларация of a paternity, childcare or a maternity row without a болничен (НПОПДОО чл. 4) — and of a father_childcare row (приложение № 7а, since 2026-10-04) and of an adoption (№ 5 or № 6) or adoption_paternity (№ 3) row (since round 11): НОИ's приложение № 9 or № 10 is due by the 10th of the month after it (чл. 12, т. 1), and without it the package assumes its own month. It may not precede bolnichen_issued_on where there is one. The inputs file's sick_note_presented_on column is the same field for every one of those kinds. Each paper goes to НОИ once (since 2026-10-03; НПОПДОО чл. 8, ал. 1 and чл. 9, ал. 1): in the prilozhenie_9 package of the month it was handed in — for a self-insured person the month the болничен was issued or the leave begins (чл. 12, т. 2) — never before the month the absence starts, and the month it starts when the day is not known. A package already marked submitted keeps the papers it sent, whatever is edited afterwards. Until then a package listed every absence overlapping its month, so a long maternity appeared in each one. remainder_taker (since 2026-10-04, maternity only) says who takes the remainder of the 410 days instead of the mother: father, grandmother or grandfather (КТ чл. 163, ал. 10 — „от бащата или от един от родителите на майката или на бащата"), foster_spouse (ал. 12 — the spouse of a person the child is placed with under чл. 26 ЗЗДет); null — the mother's own leave. The same leave and the same days on Д1, but the обезщетение is КСО чл. 50, ал. 7, so НОИ's приложение № 10 certifies заявление-декларация № 4, обезщетение 3, in the taker's качество (2 баща, 3 баба, 4 дядо, 12 съпруг) and on its КТ ground (4 the father, 16 the spouse) — not the mother's № 2 / обезщетение 1. remainder_ground (a grandparent only) is father_unknown or father_deceased: НОИ's code list still splits the grandparent's ground by the sentences of ал. 10 before 2023 (22, 23); since 01.01.2023 the КТ lets a grandparent take it in other cases too, which have no code — since round 11 send consent_since_2023 (the mother's consent, the father neither unknown nor dead): the certificate files НОИ's 23, whose persons are the law's words, and the package's caveat says why. Left out, the certificate goes out „не е избрано" with the gap named. remainder_by_father (since 2026-10-03) still works: true is remainder_taker: "father" when no taker is sent. The remainder carries no болничен (422 absence_invalid, details.reason absence_father_remainder_bolnichen) and may not start before the youngest child named on it is six months old (absence_father_remainder_too_early) — the reasons keep their first names whoever takes it. Ignored on any other kind. The inputs file has no column for them. childcare_taker (since round 11) says who takes a childcare leave — mother, adoptive_mother, single_adopter (a man who adopted the child alone) — КТ чл. 164, ал. 1, НОИ's ground 5; father, adoptive_father, grandmother, grandfather — ал. 3, ground 6; placed_with (the person the child is placed with under чл. 26 ЗЗДет), placed_with_spouse — чл. 164а, ground 7 — and, on a father_childcare leave, father (качество 13) or adoptive_father (14). НОИ's certificate carries that качество and ground; null — not said: they go out „не е избрано", which НОИ refuses, with the gap named. A taker the kind has not is dropped; one the API does not know is 422 validation_failed. The inputs file's leave_taker column is the same field. maternity_taker (since round 11b) says who takes a maternity absence of their own — not a remainder taken by another, which remainder_taker says (the field is dropped there): mother (НОИ's качество 1, ground 1 — КТ чл. 163, ал. 1), placed_with (the person the child is placed with under чл. 26 ЗЗДет — 7, ground 13, ал. 7), father (on the mother's death or serious illness — 2, ground 11, чл. 167, ал. 1), guardian (8, ground 12, чл. 167, ал. 5), grandmother / grandfather (3 / 4 — the ground turns on the circumstance of чл. 167 and goes out 0, named). Заявление-декларация № 2's certificate (обезщетение 1) carries that качество and ground; null — not said: they go out unselected, which НОИ refuses (10082), with the gap named. Never inferred. The inputs file's leave_taker column takes it on a maternity row. adoption and adoption_paternity (since round 11) are the leaves of КТ чл. 164б: adoption — the 365 days from the day the child was handed over for adoption, to its fifth birthday at the latest (ал. 1 and 5), and the rest of them taken instead after six months (ал. 2, 3, 5); adoption_paternity — the adoptive father's 15 days (ал. 8). The employer pays nothing for their days; НОИ pays the обезщетение of КСО чл. 53в. For the payroll an adoption is a майчинство (days.maternity, Д1 т. 16.2, т. 17 the ЗЗО base) and an adoption_paternity a бащинство (days.paternity, т. 16.2) without the ЗЗО base — ЗЗО чл. 40, ал. 1, т. 5 names the adoption leave of ал. 1 and 5 only. Fields: adoption_handed_over_on (required on both — what the 365 days, the six months and the 15 days run from; т. 11 of приложение № 10), adoption_decision_final_on (the day the court's decision became final, т. 12), adoption_taker on adoption (adoptive_mother, single_adopter — заявление-декларация № 5, качество 10 / 11, ground 8 / 10; adoptive_father, grandmother, grandfather — instead of the adopter, № 6, качество 9 / 3 / 4, ground 9 for the adoptive father), adopted_by for a grandparent (spouses — ground 24, filed with a caveat: НОИ's label still says „когато осиновителят е починал", which КТ чл. 164б, ал. 2 has not asked since 2023; woman_alone — 20; man_alone — 21), adopter_consent (a leave taken instead: the adopter's written consent) and adopters_married (adoption_paternity — № 3, обезщетение 2, качество 9, ground 14). A missing taker, ground, consent, marriage or date is named on the certificate, not refused. Refused (422 absence_invalid, details.reason, the message naming the day): a start before the handing over (absence_adoption_before_handover — also a father_childcare with childcare_taker: "adoptive_father", which takes the two dates too); a leave taken instead before six months from it (absence_adoption_instead_too_early); one past its 365th day or the fifth birthday (absence_adoption_too_late); the 15 days past the 15th calendar day from it or the fifth birthday (absence_adoption_paternity_too_late). lacks_benefit_stazh / benefit_stazh_from work on both — 12 months (КСО чл. 53а) on adoption, т. 3; 6 months (чл. 53в, ал. 2) on adoption_paternity, т. 3а — the days up to the date in т. 16.3. A childcare whose childcare_taker is an adopter or a grandparent takes the two dates as well. The inputs file takes the kinds as осиновяване / чл. 164б and чл. 164б ал. 8, without the dates (warning adoption_on_card). lacks_benefit_stazh (since 2026-10-03, maternity only) says the person has not the 12 months of insurance the обезщетение needs (КСО чл. 48а; чл. 50, ал. 7 for the father's remainder): the days stay maternity days — nothing paid, the ЗЗО share and the стаж без вноски as before — but Д1 declares them in т. 16.3, „дни без право на обезщетение", not 16.2 (Н-13), and НОИ's certificate marks т. 3 (0). benefit_stazh_from is the day the 12 months are reached inside the leave — their last day, the date НОИ's certificate carries („последният ден, с който се придобива необходимият осигурителен стаж", НПОПДОО's указания) — any day of the leave, its first included (422 validation_failed outside it): the days after it carry the right and go to 16.2, and the certificate carries the date. Since 2026-10-04 (round 5) the day itself is a day without the right — it counted with the right before, a day out of step with НОИ — and the certificate's per-month working days (т. 9 of приложение № 9, т. 13 of № 10) count only the days with the right, 0 on a row without one, where every working day was counted. Tick it only when you know the insurance falls short — НОИ checks the whole record itself. The inputs file has no column for either. On a paternity absence (since 2026-10-03) the same two fields say the father has not the 6 months КСО чл. 50, ал. 6 asks of the 15 days (ал. 9 for a самоосигуряващ се): those days go to т. 16.3 too — the leave is one of КТ чл. 163, „отпуск поради бременност и раждане" — and приложение № 10 marks т. 3а (0; т. 2а on № 11), with the day in its own date. On a childcare absence (since 2026-10-04) they say the person has not the 12 months КСО чл. 52а asks of the обезщетение за отглеждане на дете: Д1 does not change — т. 16.3 takes those days with the right or without it — and приложение № 10 marks т. 3 (0; т. 2 on № 11), with the day. On a father_childcare absence (since 2026-10-04) the same, on the 12 months of КСО чл. 53д. On a sick absence (since 2026-10-04, round 5) they say the person has not the 6 months КСО чл. 40, ал. 1 asks of the обезщетение (not asked of a person under 18, nor of a трудова злополука or професионална болест — do not mark those): the days up to and including benefit_stazh_from are „неплатен отпуск за временна неработоспособност" — days.sick_no_benefit, Д1 т. 16.4 instead of 16.2, стаж without contributions, the ЗЗО share as for any НОИ day — and the employer's чл. 40, ал. 5 days are not paid unless the company says so (pays_employer_days_without_stazh, Payroll settings); приложение № 9 marks т. 2 (0) with the date, and its т. 9 counts the чл. 40, ал. 5 days and the days after the date, as НОИ asks. Ignored on any other kind. father_childcare (since 2026-10-04) is the father's (adoptive father's) leave to raise a child until it turns eight — КТ чл. 164в: two months, at once or in parts, less what he used of the leaves its ал. 2 lists. The employer pays nothing for its days; НОИ pays the обезщетение of КСО чл. 53ж. For the payroll it is an отглеждане на дете: its days are days.childcare (Д1 т. 16.3 — стаж without contributions, КСО чл. 9, ал. 2, т. 1 — and т. 17 the ЗЗО base, ЗЗО чл. 40, ал. 1, т. 5), and the package's приложение № 10 certifies заявление-декларация № 7а, обезщетение 10, КТ ground 26, with т. 13's working days per month; the качество (13 баща, 14 осиновител) is childcare_taker since round 11 (above), an adoptive father's adoption dates adoption_handed_over_on and adoption_decision_final_on. It may not end after the youngest child's eighth birthday (422 absence_invalid, details.reason absence_father_childcare_too_late; the message names the birthday). Since 2026-10-04 (round 5) it may not start before the youngest child's second birthday, nor before 1 August 2022 (absence_father_childcare_too_early — НОИ and МТСП: the father's own right arises at two; before it he takes the mother's leaves with her consent, sent as maternity or childcare), and it is held to two months per child, in calendar days (НРВПО чл. 46ж, ал. 2): a part may run to the day before the same date two months after its first day, less the calendar days of the other parts and of the maternity and childcare absences recorded on the same employee for the same child (КТ чл. 164в, ал. 1 and 2) — absence_father_childcare_too_long names the last day it may run to, absence_father_childcare_exhausted says none is left. A child is the same child by its ЕГН, or by birth date and first name where neither row has one. Since round 10 the periods another employer's удостоверение по приложение № 16 НРВПО states count too (POST /payroll/employees/{id}/father-leave/elsewhere, below), and a circumstance of НРВПО чл. 46ж, ал. 5 ends the right: a part starting on or after its day is absence_father_childcare_ended, one running into it absence_father_childcare_ends (the message names the last day it may run to). Since round 11 an adoption absence on the father's own record counts against the two months too (КТ чл. 164в, ал. 1: „чл. 164б, ал. 2 и 5"). The inputs file takes it as отглеждане на дете до 8 години or чл. 164в.

The father's leave used elsewhere, and what ends it (since round 10). GET /payroll/employees/{id}/father-leave answers, for the employee: children — per child the calendar days counted against the two months (used_here, used_elsewhere, used), ended_on (the day a circumstance ended the right, or null) and over (a father_childcare absence recorded here that now runs past the two months: absence, start_date, end_date, last_day, used); elsewhere — the periods of another employer's удостоверение по приложение № 16 НРВПО (id, child, child_birth_date, child_identifier masked, employer_name, employer_eik, leave father_childcare or counted_leave, start_date, end_date, days, certificate); circumstances — those of НРВПО чл. 46ж, ал. 5 (id, child, circumstance, occurred_on, declared_on, note, leaves_to_end — each absence recorded here that runs on to the day: last_day the day before, or null when it starts on or after it and is not granted at all, and posted when its days past it are in a posted month — and noi_deadline, the day НОИ is to have the new приложение № 10 with the change: since round 11 the THIRD WORKING DAY after declared_on, the day the declaration was received (НПОПДОО чл. 13, т. 1; ЗЗД чл. 72) — until then the 10th of the month after it, which is чл. 12's for a first claim — and Autonify prepares it: declaration_number (the входящ номер you gave the father's declaration, т. 24 of the certificate), noi_package_period (the month whose НОИ package — the prilozhenie_9 filing — carries it: the month of declared_on, or the first open month when that one is posted) and noi_changes (the certificates it changes, frozen when the circumstance was recorded: absence, start_date, end_date, capacity, filed_in — each a certificate of the child's father_childcare leave running on or past the day and filed in an earlier package; empty when there is none). The package's prilozhenie-10-promeni-{YYYY-MM}.xml holds one document per certificate — CodeOperation 0, FlagCertificate 2, раздел II with the circumstance's point and date; a death ends the leave from the NEXT day, every other circumstance from its own. POST /payroll/employees/{id}/father-leave/elsewhere records a period: child_first_name, child_family_name, child_personal_identifier and/or child_birth_date (an identifier that is no ЕГН needs the date; a date the ЕГН contradicts is refused), employer_name, employer_eik, leave_kind (father_childcare — a part of the КТ чл. 164в leave — or counted_leave — a leave of чл. 163, ал. 10, чл. 164, ал. 3, чл. 164б, ал. 2 и 5 or чл. 167, ал. 1), start_date, end_date, certificate_number. POST /payroll/employees/{id}/father-leave/circumstances records a circumstance: the child as above, circumstance (child_died, parental_rights_removed, parental_rights_restricted, adopted, adoption_terminated, institution, placed_out — ЗЗДет чл. 26 — or maternity_programme), circumstance_on (the death, or the day the change runs from), declared_on, declaration_number (since round 11, up to 15 characters), note. Both answer 201 with the new row's id and the whole section. DELETE /payroll/father-leave/elsewhere/{id} and /payroll/father-leave/circumstances/{id} take a row back. A child that cannot be linked is 422 father_leave_child_needs_identity, father_leave_child_needs_date or father_leave_child_date_mismatch.

A sick absence for a POSTED month is recorded, not refused — the paper reaches the office after the ведомост, and refusing it left the employee paid salary for days of incapacity and НОИ without its приложение № 9. For an employee or a ДУК manager, send it with the posted month it starts in (absences only: hours and one-off lines for a posted month are still 409 period_posted). The posted month is not recomputed. The correction is carried into the first open month as a sick_correction line: the employer's first two working days paid at 70 % of the month's average daily gross (КСО чл. 40, ал. 5), and that month's contributions and tax priced again on the corrected base, as the month they are for. Its приложение № 9 goes into the open month's НОИ package straight away.

The salary the posted month paid for the sick days is owed for nothing (the benefit is paid instead of it — КСО чл. 40, ал. 1), but it was paid, and the company decides what happens to it in its payroll settings (late_sick_recovery, Payroll settings):

  • consent — the default. It is only proposed for recovery: a carry-forward of kind recovery with cause: "sick", withheld once you confirm the employee's written consent (PATCH /payroll/carry-forwards/{id} with consent: true, Corrections below) — КТ чл. 271, ал. 1 spares the employee returning pay received in good faith, and чл. 272 forbids withholding it without consent. Confirmed, the month's sick_correction takes it back, priced as the month: the contributions and the tax on it are returned and its corrective Д1 lowers т. 21. Until then — and for good if it is refused — it stays income the month paid, declared as such; the days are declared as sick days either way.
  • net — taken back in the same sick_correction line straight away, for a company that already holds the employee's written consent (a clause of the contract).

A month keeps the choice it was first corrected under; a change applies to the months corrected after it. The open month's Д1/Д6 carry a corrective Д1 record for the month (код корекция 1: the days move from т. 16.1 to 16.А and 16.2, т. 21 rises by the чл. 40, ал. 5 pay and drops by any salary taken back) and, in NRA62007.TXT, a corrective код 5 column for it where a fund falls (флаг 1, Н-13 чл. 9, ал. 12) and a new код 5 column where one rises (ал. 11). Lowered contributions are not taken off the open month's payment: the posted month's were paid, and НАП returns or offsets the overpayment on request (ДОПК чл. 129); risen ones are paid with the open month. The absence's row in the answer carries correction — here a 2 000.00 salary, sick Monday 14 to Friday 18 September (20 working days), under consent: 140.00 for the employer's two days paid, the five days' salary, 500.00, proposed:

{ "external_id": "SICK-2026-131", "id": "01k…", "result": "created",
  "correction": { "settle_period": "2026-10",
    "months": [ { "for_period": "2026-09",
      "amount": { "amount": "140.00", "currency": "EUR" },
      "employee_contributions": { "amount": "19.29", "currency": "EUR" },
      "employer_contributions": { "amount": "31.94", "currency": "EUR" },
      "income_tax": { "amount": "-1.93", "currency": "EUR" },
      "net_pay": { "amount": "122.64", "currency": "EUR" },
      "recovery": "consent",
      "proposed_recovery": { "amount": "500.00", "currency": "EUR" },
      "proposal": "01k…" } ],
    "onset_uninsured": null } }

Confirmed with consent, that month's line becomes −360.00 — the 500.00 taken back, the contributions (−49.61), the employer's side (−66.16) and the tax (−45.04) with it, −265.35 net; under net it is that from the start, with recovery: "net" and no proposal.

months has one entry per posted month the absence moves — its own, and a posted month after it whose episode it continues (the чл. 40, ал. 5 days are spent once per episode); a negative figure goes back to the employee. proposal is the carry-forward to decide on, null when nothing is proposed — always for a shadow payroll month (payroll_mode: shadow), whose salary the foreign employer paid: nothing of it is taken back or proposed here, under either choice (sick.paid_abroad on the carry-forwards read, Corrections below); a month whose correction is already all settled and only proposes has null money fields. On the open month's computed run the item carries it in retro with kind: "sick" (a raise's difference is kind: "retro"). While the open month is open the absence can still be corrected or deleted, and its correction goes with it — a decision on its proposal stays while the month still has a late болничен, and goes with the last one. Every other kind for a posted month was 409 period_posted — the leaves НОИ pays are recorded since 2026-10-03, and a paid or unpaid leave and other since 2026-10-04, below. A month of a closed year is 409 sick_year_closed (details.period, details.reason): recalculated — the person's чл. 49 ЗДДФЛ recalculation for that year is settled in a posted month. A month past 30 April of the next year is no longer refused (deadline was returned until round 9): it is carried like any other, its corrective records go on the носител НАП or НОИ permit (Н-13 чл. 9, ал. 5; d1d6-nositel-{year}.zip), and its correction.past_deadline says so (A month past its deadline).

Over an absence already recorded on the posted month. The late болничен supersedes a recorded paid annual (or additional paid) leave — КТ чл. 175, ал. 1 interrupts the leave when another leave is granted during it — and a day of kind other: the days it covers become sick days, go back to the leave balance, and the leave pay (or salary) the month gave for them is treated like the salary for the sick days above (proposed under consent, taken back under net); the leave's own row stays as recorded. Unless the employee keeps the leave: send "keeps_paid_leave": true on the sick absence (КТ чл. 175, ал. 1 interrupts the leave only at the employee's request; the Наредба за медицинската експертиза, чл. 9, ал. 3, lets the employee use the paid leave for the certificate's days instead), with the leave's заповед in paid_leave_order_number (up to 15 characters) and paid_leave_order_date (YYYY-MM-DD). Then the shared days stay leave days — paid as leave, nothing of it taken back or proposed, still used from the balance, no чл. 40, ал. 5 pay and no НОИ benefit for them — the employer's two days are the first two of the certificate's other working days, and приложение № 9 marks т. 12 with those leave days and the заповед (a missing заповед is named among its gaps). Default false. Over an unpaid leave (since 2026-10-03) it is recorded and runs over it without superseding it: a day of unpaid leave is not a day the employee was due to work, so those days stay unpaid — no employer чл. 40, ал. 5 pay, no НОИ benefit — and the days around the leave are the sick days, the employer's two being the first two the employee was due to work; the приложение № 9 counts those days only. When the incapacity began inside an unpaid leave past the year's 30 working days that count as insurance (КСО чл. 9, ал. 2, т. 3 — the insurance is interrupted, чл. 10, ал. 2) it is recorded too (since 2026-10-04; until then 409 sick_onset_uninsured, no longer answered): the person was not insured on the day of the risk, so neither the employer's чл. 40, ал. 5 days nor the НОИ benefit is owed for any of its days (чл. 40, ал. 1 and 5) — those after the unpaid leave are an unpaid incapacity, стаж without contributions (чл. 9, ал. 2, т. 2), Д1 т. 16.4 (sick.sick_no_benefit_days on the carry-forwards read, days.sick_no_benefit on a run's item). The corrective Д1 declares the interruption in т. 14/15, and приложение № 9 marks т. 1 „не е осигурено" with its first day in т. 8 (НПОПДОО, указания т. 1 and т. 8). The answer's correction.onset_uninsured says so — onset, interrupted_from and unpaid_days (the unpaid working days recorded for the year up to that day) — and is null otherwise. The count is the unpaid leave recorded in the payroll from 1 January and, since round 10, the unpaid leave the employee took with another employer that year as stated through …/unpaid-leave-elsewhere (above); a leave of КТ чл. 167а is not in it. Over another sick, maternity, paternity, childcare or father_childcare row it is 409 absence_overlaps with details.overlap (kind, start_date, end_date).

unpaid_ground (since round 10; an unpaid absence only, default request) — the ground of the unpaid leave, which decides whose its health contribution is (ЗЗО чл. 40, ал. 1, т. 1, б. „б"): request — at the employee's request (КТ чл. 160, ал. 1), theirs, withheld from the pay; chl167a — the leave to raise a child to its eighth year (КТ чл. 167а), the employer's, and стаж whole (КСО чл. 9, ал. 2, т. 1): never among the year's 30 unpaid working days nor an interruption of the insurance, its days in Д1 т. 16.3, its base in т. 27 of the month's own record; production — production necessity and престой, the employer's, its days otherwise as a request leave's (the same 30, the same вид осигурен 28 record past them). The employer's share is in the run's employer_contributions_total and health_unpaid_leave.employer (below), never withheld nor off the tax base. Since round 11b also the leaves of КТ чл. 157 the employer does not pay, each read as a request leave's (the person's health, the year's 30): chl157_marriage, chl157_blood_donation, chl157_bereavement (т. 1–3 when nothing pays them), chl157_summons (т. 4 — summoned as a party, witness or expert), chl157_public_office (т. 5 — a representative state body, a съдебен заседател) — and chl157_disaster_volunteer (т. 7), whose days carry no unpaid-leave health: the state insures the volunteer (ЗЗБ чл. 43; ЗЗО чл. 40, ал. 1, т. 1, б. „б"), the run's unpaid_leave.insured_elsewhere_days counting them and its health_unpaid_leave priced without them. Any other kind carries none (null on it); a value outside these is 422 validation_failed. Sent again unchanged, the row is unchanged.

interrupts_unpaid_leave (since 2026-10-04; default false) — the employee interrupts the unpaid leave with the болничен. The КТ has no rule on ending an unpaid leave early; НОИ answers that a болничен interrupts an unpaid leave during which the person is insured (of the КТ чл. 167а leave), and the labour press that a чл. 160 leave ends when the employee hands the болничен in — whether it did is a fact of the employee's request, so it is sent, never assumed. The shared days are then the certificate's days: the employer's two its first two working days, НОИ's the rest, приложение № 9 counting all of them; the unpaid row stays as granted, only its other days stay unpaid, and the interrupted days no longer count towards the year's 30. It is allowed only while the unpaid leave still counted as insurance on the day the incapacity began — an insurance interrupted and not resumed before the risk gives no right (НПОПДОО, указания т. 8), and ending the leave that day cannot reach back before it: 409 interruption_uninsured with details.onset, details.interrupted_from and details.unpaid; send it without the flag. Taken on a sick, maternity, paternity, childcare or father_childcare absence (stored on any of them; it matters only over an unpaid leave of a posted month) and ignored on the other kinds. The inputs file has no column for it.

A maternity, paternity or childcare absence for a POSTED month is recorded too (since 2026-10-03), through the same door and the same correction: these are the leaves НОИ pays instead of the salary (КСО чл. 48а; КТ чл. 163, ал. 14 and чл. 164, ал. 4), so no salary was owed for their days — and so is a father_childcare one since 2026-10-04 (КТ чл. 164в, ал. 6), as an отглеждане. What differs from a sick one:

  • No employer days — КСО чл. 40, ал. 5 is incapacity alone. The sick_correction row is the salary the month paid for the days and the days themselves; its amount is 0.00 until that salary is taken back, and sick.absence_kinds on the carry-forwards read names the leave.
  • The days move on the corrective Д1 from т. 16.1 to т. 16.2 (maternity, paternity) or т. 16.3 (childcare, father_childcare) — стаж without contributions (КСО чл. 9, ал. 2) — and т. 17 takes the ЗЗО base for them (ЗЗО чл. 40, ал. 1, т. 5: the МОД for the self-insured, the employer's share) — on no more than the month's corrected base leaves of the maximum insurable income (ал. 7 and 8, since 2026-10-03: while the salary for the days is only proposed, the month still declares it). That health share is what every such correction moves at once (employer_contributions), paid with the open month in a new код 5 column.
  • The salary for the days follows late_sick_recovery exactly as a болничен's does: proposed under consent (a recovery with cause: "sick" and absence_kinds), taken back under net. What is taken back of the cash is capped (since 2026-10-03; the month was refused with recovery_exceeds_pay before): the takeback is a deduction from pay, taken after the employee's own deductions within the чл. 446 ГПК ceiling, never leaving less than one minimum wage — since round 8 the company's default consented_recovery_pace rather than the law: a takeback confirmed with consent is outside КТ чл. 272, ал. 2, and at net it is taken from whatever the pay leaves (Payroll settings). Someone still on the leave in the open month has nothing it may come from: the month is computed, the corrections are whole (the posted month priced again, its contributions and tax returned, the corrective Д1 and Д6), and the takeback is carried and withheld from the months the person is paid again, within the same ceiling, until recovered — late_recovery on the run's item (debt, carried_in, withheld, outstanding, deferred). The same holds for a sick one and for a confirmed proposal.
  • НОИ's certificate goes into the open month's package at once: приложение № 9 for a maternity row that carries its болничен (НПОПДОО чл. 3, ал. 1 — the first 135 days), приложение № 10 for the rest of the 410 days, for paternity, for childcare and for father_childcare (НПОПДОО чл. 4 and 9).
  • A leave that runs on into open months corrects only the months that were posted when it was recorded; the open months simply compute with it.
  • Over a recorded paid annual leave or other it supersedes it (КТ чл. 175, ал. 1 names any other kind of leave); keeps_paid_leave is a sick absence's alone. Over an unpaid leave it is recorded and runs over it as a sick one does: those days stay unpaid days and the leave's days are its other days — НОИ pays the майчинство and the father's days, like a болничен, for the working days the employee was due to work (НПОПДОО чл. 33, 35), and the КТ ends no unpaid leave on its own — interrupts_unpaid_leave ends it at the employee's request, as for a sick one. A leave that began inside an unpaid leave past the year's 30 working days that count as insurance is recorded (since 2026-10-04; until then 409 absence_onset_uninsured, no longer answered) with no benefit for any of its days — the benefit is an insured person's (КСО чл. 48а, чл. 50, ал. 6 and 7, чл. 52а, чл. 53д): a maternity's or paternity's days go to т. 16.3, „без право на обезщетение", and correction.onset_uninsured says so. Over another record of incapacity or of a parental leave it is 409 absence_overlaps with details.overlap.
  • A month of a closed year is 409 absence_year_closed (details.period, details.reason as above) — nothing is written; the part from 1 January of the next year can be sent on its own.

Here the father's 15 days, Monday 14 to Monday 28 September (ten working days of September's 20), under consent:

{ "external_id": "PAT-2026-7", "id": "01k…", "result": "created",
  "correction": { "settle_period": "2026-10",
    "months": [ { "for_period": "2026-09",
      "amount": { "amount": "0.00", "currency": "EUR" },
      "employee_contributions": { "amount": "0.00", "currency": "EUR" },
      "employer_contributions": { "amount": "14.88", "currency": "EUR" },
      "income_tax": { "amount": "0.00", "currency": "EUR" },
      "net_pay": { "amount": "0.00", "currency": "EUR" },
      "recovery": "consent",
      "proposed_recovery": { "amount": "1000.00", "currency": "EUR" },
      "proposal": "01k…" } ],
    "onset_uninsured": null } }

A paid_annual, additional_annual or unpaid absence for a POSTED month is recorded too (since 2026-10-04; 409 period_posted before) — the заповед was signed, the payroll never heard of it, and the month paid salary for days the person was not at work. Through the same door and the same sick_correction row, the month priced again with the leave as the payroll prices it today:

  • An unpaid leave: the salary the month paid for its days was not owed. The corrective Д1 declares the days as a month computed on time does (health_unpaid_leave on a run's items, below): out of т. 16.1, into т. 16.5 within the year's 30 unpaid working days that count as insurance (КСО чл. 9, ал. 2, т. 3), and past them the insurance interrupted in т. 14/15 (чл. 10, ал. 2) with their health on a вид осигурен 28 record; т. 21 drops once the salary is taken back. The health contribution on the unpaid days (ЗЗО чл. 40, ал. 1, т. 1, б. „б" — the employee's, 8 % of half the self-insured МОД over the days) is withheld with the correction whatever late_leave_recovery says — a statutory contribution — and lowers the month's tax base: it is in the line's employee_contributions, income_tax and net_pay, its base in т. 27/28. A late row that interrupts an unpaid leave returns what the days it took no longer owe.
  • A paid leave: its days are paid as leave — the КТ чл. 177 pay on the company's leave_pay_basis, the НСОРЗ чл. 21 supplement with it — in place of the salary they were paid, and are used from the balance. What the leave pay exceeds that salary by is owed to the employee and paid in the open month at once (amount); what the salary paid beyond the leave pay was not owed. sick.leave_pay on the carry-forwards read is that pay, and sick.taken_back includes the salary set against it.
  • What was paid and not owed follows the company's late_leave_recovery (Payroll settings), not late_sick_recovery: under consent (the default) it is proposed — a recovery with cause: "granted_leave" and absence_kinds — and withheld once you confirm the employee's written consent, within the чл. 446 ГПК ceiling, as for a болничен; under net it is taken back at once. A month that also has a late болничен keeps one proposal for each, under its own setting.
  • other is recorded on the posted month and moves nothing: the payroll prices no „друго" day, so the month's figures stand — no correction and no corrective Д1.
  • Over a row already recorded on the posted month it is 409 absence_overlaps with details.overlap — a late leave supersedes nothing; a month of a closed year is 409 absence_year_closed, as for the leaves НОИ pays.

Here an unpaid leave, Monday 14 to Friday 18 September (five working days of September's 20, a 2 000.00 salary), under consent — the five days' salary proposed, and the health on them (310.10 × 5 / 20 = 77.53, 8 %: 6.20) withheld, the tax on it (0.62) returned:

{ "external_id": "UNP-2026-9", "id": "01k…", "result": "created",
  "correction": { "settle_period": "2026-10",
    "months": [ { "for_period": "2026-09",
      "amount": { "amount": "0.00", "currency": "EUR" },
      "employee_contributions": { "amount": "6.20", "currency": "EUR" },
      "employer_contributions": { "amount": "0.00", "currency": "EUR" },
      "income_tax": { "amount": "-0.62", "currency": "EUR" },
      "net_pay": { "amount": "-5.58", "currency": "EUR" },
      "recovery": "consent",
      "proposed_recovery": { "amount": "500.00", "currency": "EUR" },
      "proposal": "01k…" } ],
    "onset_uninsured": null } }

Confirmed with consent, that month's line becomes −500.00, the month's contributions and tax priced again with it; under net it is that from the start, with recovery: "net" and no proposal.

The same PUT sent twice is nothing the second time, and a computed month it matches stays current.

{ "data": { "period": "2026-10", "employees": [
  { "employee": "01k…", "external_id": "E-1001", "hours": "created",
    "components": [ { "code": "bonus", "result": "created" } ],
    "absences": [], "absences_removed": [] },
  { "employee": "01k…", "external_id": "E-1002", "hours": null, "components": [],
    "absences": [ { "external_id": "SICK-2026-118", "id": "01k…", "result": "created" } ],
    "absences_removed": [] } ] } }

Results are created, updated, replaced, removed or unchanged. A refusal names where it happened: details.index is the employee's position in your list, details.section and details.row the line within it.

  • 409 unknown_employee — no such employee on this company (create it, then send again); 409 employee_not_active — not employed in that month; 409 ambiguous_employee — two employments under the external_id are active in the month (name it by employee).
  • 409 period_posted — the month, or a month an absence reaches, is posted; details.months lists them. Not for an absence of an employee or a ДУК (above), which is 409 sick_year_closed (409 absence_year_closed for the other kinds) only for a closed year, and 409 interruption_uninsured when interrupts_unpaid_leave asks to interrupt an unpaid leave that no longer counted as insurance.
  • 422 unknown_component, 422 absence_invalid (a child's identity contradicts itself, a remainder of the 410 days taken instead of the mother — remainder_taker, remainder_by_father — on a болничен or before the sixth month, or a father_childcare past the child's eighth birthday, before its second, or past its two months — round 5; details.reason), and 422 validation_failed for an absence starting outside the month, an employee listed twice, an external_id repeated, or a key no section has — at any depth, by its path (employees.0.hours.overtime_hours, employees.2.absences.0.bolnichen_no): dropped silently, it would be overtime nobody pays or a болничен НОИ never hears of.

DELETE /payroll/absences/{id} — any absence of the company, whoever entered it, unless its dates touch a posted month (409 period_posted). An absence recorded for a posted month (above) can go while the open month that settles it is open; its correction goes with it.

POST /payroll/absences/{id}/return (since round 10) — an unpaid absence ended early: the employee is back at work before the leave granted ends. Body: returned_on (required, YYYY-MM-DD — the first day back: after the leave's first day and no later than its last), basis (required — order, the employer's order, as a leave of КТ чл. 160 is ended at the employee's request; notice, the employee's written notice, as a leave of чл. 167а is theirs to use and to end, ал. 6–7), reference and reference_date (optional — the paper's number and its date, not after today). The row is shortened to the day before returned_on — end_date and working_days answer it — and keeps the day it was granted to (return.granted_end_date). The days from the return on are worked days: their salary is owed (КТ чл. 242) and the unpaid-leave health contribution of ЗЗО чл. 40, ал. 1, т. 1, б. „б" is not, nor do they count among the year's 30 unpaid working days. A computed month it touches is stale. When the leave reached a POSTED month, that month is corrected in the first open month, as a late absence's is (A month's inputs): return.settle_period, and correction — settle_period, months (for_period; amount, the salary for the days worked, gross; employee_contributions, employer_contributions, income_tax, net_pay — what the month's figures move by) and past_deadline. The salary is paid whole whatever the company's late_leave_recovery says — that setting answers for salary paid and not owed, never for salary owed. The run's item carries the correction as a retro entry with returned_ids; its corrective Д1 and its Д6 difference are in that month's package. correction is null when every month the leave reached was open. A leave already ended early (since round 11): an EARLIER day ends the same leave earlier still — the parties agreed again, or a parent of a leave of чл. 167а gave a new notice — the row shortened again, the return it held moved to return.earlier (oldest first: returned_on, basis, reference, reference_date, settle_period), and the posted months corrected as the first return's were, each from the end it was posted with (a month posted between the two returns was posted with the first); the same day again corrects the paper and re-prices nothing; a LATER day is 409 return_already_recorded — no return: withdraw it while its correction is open, or record the days the employee stayed away as a leave. Going back on leave after a return is a new leave (a new absence). 422 return_outside_leave for a day outside the leave; 422 return_not_unpaid for another kind (a paid leave is interrupted, КТ чл. 175); a posted month of a closed year is 409 absence_year_closed (details.period, details.reason; since round 10b its sentence is a return's: nothing was written, the salary for the days worked after the return is owed and settled outside the payroll). The integration may keep sending the leave through PUT …/inputs with the day it was granted to, or with the shortened end: the row is unchanged and the return stays.

{
  "data": {
    "id": "01J…", "external_id": "U-1", "kind": "unpaid", "unpaid_ground": "request",
    "start_date": "2026-08-10", "end_date": "2026-08-16", "working_days": "5.00",
    "return": {
      "returned_on": "2026-08-17", "granted_end_date": "2026-08-21", "basis": "order",
      "reference": "12", "reference_date": "2026-08-14", "settle_period": "2026-09",
      "earlier": []
    },
    "correction": {
      "settle_period": "2026-09",
      "months": [{ "for_period": "2026-08", "amount": { "amount": "476.19", "currency": "EUR" }, "employee_contributions": { "amount": "59.72", "currency": "EUR" }, "employer_contributions": { "amount": "93.43", "currency": "EUR" }, "income_tax": { "amount": "41.64", "currency": "EUR" }, "net_pay": { "amount": "374.83", "currency": "EUR" } }],
      "past_deadline": null
    }
  }
}

DELETE /payroll/absences/{id}/return — the return withdrawn: the leave back to the day it was granted to, and the posted months its correction priced planned again without it (their correction goes). Only while the month that settles the correction is open and no month posted since reaches the days it gave back — else 409 return_final. Nothing to withdraw is 409 return_not_recorded; another absence recorded since in those days is 409 absence_overlaps. The answer is the absence, return null — since round 11, a leave ended earlier again goes back to the return before it instead (the last of return.earlier, with its paper and settle month).

Kinds of one-off line

A components row can be more than a gross earning. Beside code, amount and note it may carry the fields of its kind:

Code Fields What it is
bonus, allowance, an other code amount_basis: gross (the default) or net With net, amount is what the person is to receive. When the month is computed we solve the gross, to the cent, against the month's other pay, the insurance floor and the cap, so the net rises by exactly that much. The run answers the solved gross as the line's amount and the target as net_target.
reimbursement exemption_basis (required): business_expense, travel_costs or per_diem; note (what was paid back, and the document — asked for, not required) Paid with the wage but not pay: inside amount_payable (and register.csv's pay_amount), never in gross, net_pay, the tax, the contributions or Д1. business_expense is the employer's own expense the employee paid; travel_costs is командировъчни — travel and accommodation, documented (ЗДДФЛ чл. 24, ал. 2, т. 5, б. „а"); per_diem is дневни командировъчни, sent with its trips in per_diem (below): what was paid within twice the наредби's amount for each trip stays out of both bases and is reported under код 110; what was paid above it is taxable and insurable (ЗДДФЛ чл. 24, ал. 2, т. 5, б. „б"; НЕВДПОВ чл. 1, ал. 8, т. 1) while all of it is still paid as a reimbursement. A flat allowance is taxable pay — send it as allowance. One line per basis a month, plus a business trip's own lines (below).
recovery amount negative; recovers_period (required, YYYY-MM, before the month); note (required — the reason) Takes back pay overpaid in an earlier month before tax: it lowers the month's gross and both bases. One line per month recovered. Since round 8 it is an overpaid sum withheld without consent (КТ чл. 272, ал. 1, т. 2): taken within the чл. 446 ГПК ceiling with the month's deductions, never leaving less than one minimum wage, and what the limit refuses is carried into the next month the person is paid (termination_recovery on the run's item, its line consented: false) — until round 8 a recovery past the month's gross refused the month (recovery_exceeds_pay). Since round 9 consented_on (YYYY-MM-DD, optional) is the day the person consented in writing to the sum being withheld — not after today, not before recovers_period began: the line is then a deduction made with consent (consented: true), taken after those without consent at the company's consented_recovery_pace. Without it the line is КТ чл. 272, ал. 1, т. 2 — a slip in computing or recording the sum (МТСП ID 6861); a sum paid without a legal ground and received in good faith is not returned without consent (КТ чл. 271, ал. 1).
equity_income equity: instrument (rsu, option, espp, other), shares, fmv_per_share, price_per_share, event_date (in or before the month), reference (the grant), insurable (default false), employer_bears_tax (default false). amount = shares × (fmv − price), to the cent — checked Taxed — and insured only where insurable — but never paid: its tax comes out of the month's cash, and amount_payable never includes the shares. With employer_bears_tax we add a cash line equity_tax_cover, grossed up so the person's net is what it would have been without the event. One line per grant a month. Prices in euro, at the БНБ rate of the event date.

A line of the last three kinds is told apart by its key — the basis, the month recovered, the grant — and its result carries it: {"code": "reimbursement", "key": "per_diem", "result": "created"}. Since round 9's second follow-up a recovery's result also says consented_on — the day recorded, or null for one withheld without consent (or removed): {"code": "recovery", "key": "2026-09", "result": "created", "consented_on": "2026-10-02"}. "amount": null with the key removes that line ("equity": {"reference": "…"} for equity); without it, every line of the code in the month. equity_tax_cover is ours alone (422 component_not_allowed).

A business trip's lines (since 2026-11-13). A business trip settled with the payroll in the app (/trips) writes its own reimbursement lines into the month chosen for it, keyed by the trip: trip:<trip id>:per_diem — its per diem, with its parts — and trip:<trip id>:travel_costs — its documented travel and accommodation. So a person-month may hold, beside the one line per basis you send, one line per basis for each trip; each is priced, reported (код 110 included) and paid in amount_payable like any line of its basis. They are written and removed by the app's business trips alone. A row of PUT …/inputs cannot name them — its exemption_basis names the hand line of that basis, the one keyed per_diem or travel_costs — and "amount": null without a basis, which removes every line of the code (above), now leaves a trip's lines in place. Off-cycle, a trip's line is paid only when named by its key (Off-cycle payments).

A percentage of the basic monthly salary (since 2026-10-22). A bonus, allowance (or a company code of those categories) may send percent_of_basic (> 0, ≤ 1000, 4 decimals) instead of amount: the line is that percentage of the basic monthly salary in force on the month's last day — a raise dated into the month counts; a salary agreed in another currency at its euro value for the month; not prorated for absences — worked out when the line is saved and again every time the month is computed. Gross only (net is 422), never beside an amount (422), and for a person paid by the hour on that day 422 (percent_of_basic — there is no monthly salary to take it of). The run's line carries details.percent_of_basic and details.basic („10 % of 3 000.00 = 300.00"). A month in which such a person turned hourly after the line was saved is refused when computed (409 percent_without_base). A line a bonus rule wrote is keyed rule:<id>: sending the code again corrects your own line, never the rule's; {"code": …, "rule": "<id>", "amount": null} removes the rule's (Bonus rules).

Pay for labour done in earlier months (since 2026-10-06). A gross bonus, allowance or other line that is insurable may carry earned_from and earned_to (YYYY-MM, earned_to defaults to earned_from, both before the month in the path): the months the work it rewards was done in. The law spreads such pay over the days worked then — „Възнагражденията, отнасящи се за положен труд за минало време, се разпределят за отработените дни, през които трудът е положен" (КСО чл. 6, ал. 2; НЕВДПОВ чл. 3, ал. 1) — with the contributions those months' (чл. 7, ал. 2). So the line is paid in the month in the path, but in neither of its bases: its amount is shared out over the months by the days worked in each (to the cent, the rest on the last; a month with no worked day gets nothing), each share priced as its month — that month's rates, maximum and tax base, on top of every correction of it — and the month's Д1/Д6 package carries a corrective record of each month (код корекция 1) and a код 6 column for it, the tax in its own код 8 column. A month with no insured day of its own (an unpaid leave past the year's 30) files its income-only record, or none when it has no taxable income of its own. The shares show on the employee's carry-forwards (kind retro_pay, cause earned) and on the run as retro_pay lines whose details.earned names the line. Each month must be posted and hold the employee's payslip: otherwise 409 earned_months_unposted (send the line without the months, or once they are posted). A line of another kind, a net one, a span ending before it starts or not before the month is 422 validation_failed on the field. Sent again without the months, the line is the month's own pay again.

A bonus paid after a leave (since round 10). A bonus placed so is a periodic or annual remuneration (НСОРЗ чл. 17, ал. 2 — „…се включва съответната пропорционална част от допълнителните периодични или годишни възнаграждения, изплатени след ползването на платения отпуск, като за целта се преизчисляват изплатените възнаграждения за платен отпуск"): its share of a month goes into that month's gross pay for the КТ чл. 177 leave priced on it — in the month that pays it, and in every month after. A posted month whose paid leave was priced on such a base month is priced again: the difference is a retro_pay row of the first open month (cause periodic_bonus, with leave_basis on the carry-forwards read), declared as that month's correction. An allowance or other line placed in earlier months, and a bonus that names no months, lift no leave.

"components": [
  { "code": "bonus", "amount": "500.00", "amount_basis": "net" },
  { "code": "reimbursement", "amount": "150.00", "exemption_basis": "per_diem", "note": "Varna 14–16.10",
    "per_diem": { "parts": [ { "destination": "BG", "kind": "full", "days": 3, "amount": "150.00" } ] } },
  { "code": "recovery", "amount": "-100.00", "recovers_period": "2026-09", "note": "Overtime paid twice in September" },
  { "code": "equity_income", "amount": "2550.00",
    "equity": { "instrument": "rsu", "shares": "100", "fmv_per_share": "25.50", "price_per_share": "0",
                "event_date": "2026-10-15", "reference": "G-2024-17", "insurable": false, "employer_bears_tax": false } }
]

Per diems (since 2026-10-04). A per_diem reimbursement carries per_diem.parts — 1 to 20 trips, each {"destination", "kind", "days", "amount"}; the line's amount is their sum, to the cent (checked):

Field Values
destination BG for a trip at home; a country of Приложение № 2 of the Наредба за служебните командировки и специализации в чужбина by its ISO 3166-1 code (DE, GR, US, XK for Kosovo); a country the table does not name by its region's „Други страни" row: other_eu, other_europe, other_asia, other_africa, other_north_america, other_latin_america, other_oceania
kind full (default — a day with an overnight stay at home, a full day abroad); day_trip (at home without an overnight stay, 50 %); abroad: after_30 (past the 30th consecutive day, 75 %), neighbour_short (under a day in GR, MK, RO, RS or TR, 35 %), one_meal (lunch or dinner provided, 65 %), full_board (30 %)
days whole days, 1–366
amount what was paid for those days

Each trip's limit is days × 2 × the day's amount × the kind's percentage, as the legal parameters hold them for the month (22.00 a day at home from 01.01.2026; the country table from 01.02.2025 — GET /payroll/legal-parameters, group travel). Trips are never pooled: one under its limit does not shelter another over it. A destination the table does not hold, a kind that is not the destination's, a month the registry has no amounts for, or a per diem sent without its trips is 422 — never let through as tax-free. The run answers each trip back in the line's details.parts with daily, percent, limit and taxable, and the line's details.limit and details.taxable; the line's taxable_amount and insurable_amount are the excess.

A line whose facts do not fit its kind is 422 validation_failed, keyed by the row's field (employees.0.components.1.exemption_basis, employees.0.components.1.per_diem.parts.0.destination). The run reads every line back with cash, net_target and details (the kind's facts); each row carries reimbursements and non_cash_income, and the totals reimbursements, non_cash_income, per_diem_taxable (of the reimbursements, the per diems above their limits — inside the taxed and insured bases), per_diem_unchecked (per-diem lines entered before 2026-10-04 without their trips: nothing checked them and the whole amount was left tax-free — enter them again with their trips), recovery_floor_lifted (a recovery the insurance floor lifted back up — the tax fell, the contributions did not) and equity_cash_shortfall (equity tax the month's cash could not carry: posting is 409 post_refused until the employer bears the tax or the line moves).

Confirm with an adviser: whether share income is insurable under КСО is contested (hence the per-line choice, default no); a foreign parent's grant with no recharge is usually declared by the employee in the annual return, not withheld here; contributions belong to the month the pay was for, and correcting a posted month's Д1 needs a corrective Д1, which a recovery does not file; withholding from pay is limited by КТ чл. 272.

A month's inputs as a file

The same month as a spreadsheet the payroll team fills in — the file the app's /payroll → „Monthly inputs from a file" card downloads and takes, read by the same code and written by the same writer as the PUT above.

GET /payroll/periods/{YYYY-MM}/inputs/template.{format} — template.csv or template.xlsx: one row per person active in the month — employee_id (ours), external_id, name, identifier (the ЕГН masked), type — and every input column empty. The workbook opens as columns in an Excel of any locale and carries a second sheet naming every column in ?locale=bg|en; the CSV is the house format (UTF-8 with a BOM, ;).

POST /payroll/periods/{YYYY-MM}/inputs/file — multipart/form-data with file (a .csv or an .xlsx, up to 16 MB — told apart by its bytes) and dry_run, required: true carries out the whole write and rolls it back, so the answer is exactly what the write would do and nothing is kept; false writes it. All or nothing: one error anywhere and nothing is written.

A row names one employee — by employee_id, or external_id (the employment active in the month), or a full ЕГН/ЛНЧ in identifier; two of them given must agree — and may carry any of these groups. The same employee may appear on more rows (a second absence, a second reimbursement basis). A row with only its names is skipped.

Group Columns What it writes
hours worked_hours, overtime_workday_hours, overtime_weekly_rest_hours, overtime_holiday_hours, night_hours, holiday_worked_hours, hours_note The month's hours as a whole, as hours in the PUT: a bucket left empty is zero, worked_hours empty is the норма. One row per employee. Employment contracts only.
bonus / allowance bonus, bonus_basis, bonus_note, bonus_percent; allowance, allowance_basis, allowance_note, allowance_percent A one-off line; the basis gross (default) or net. Since 2026-10-22 bonus_percent / allowance_percent instead of the amount: a percentage of the basic monthly salary, gross (percent_of_basic on PUT …/inputs) — never both (percent_with_amount). Sent again, it corrects the month's line.
reimbursement reimbursement, reimbursement_basis (required: business_expense, travel_costs, per_diem), reimbursement_note; for per_diem also per_diem_destination and per_diem_days (required) and per_diem_kind (full when empty) Paid with the wage, not pay (Kinds of one-off line). A per diem row is one trip; its amount is the trip's.
recovery recovery (the amount taken back — the minus sign is optional), recovers_period (YYYY-MM, before the month), recovery_reason (required), recovery_consented_on (optional, since round 9) Overpaid pay taken back before tax. recovery_consented_on is the day the person consented in writing to the sum being withheld — consented_on on PUT …/inputs, refused the same way (consented_on_after_today, consented_on_before_month, under this column; not_a_date): the line is then a deduction made with consent, taken at the company's consented_recovery_pace. Empty, it is КТ чл. 272, ал. 1, т. 2 — withheld within the ГПК чл. 446 ceiling.
equity equity_instrument, equity_shares, equity_fmv_per_share, equity_price_per_share (empty = 0), equity_event_date, equity_reference, equity_insurable, equity_employer_bears_tax (yes/no) An equity event; its amount is derived — shares × (market value − price). Shares and prices take six decimals, and one separator in them is always the decimal mark.
line line_code, line_amount, line_basis, line_note Any other one-off code of the company of the bonus kind.
earned (since 2026-10-06) earned_from, earned_to (YYYY-MM, or MM.YYYY; earned_to empty = earned_from alone) The months the row's pay for labour was earned in — its bonus, allowance and line_code line carry them, exactly as earned_from / earned_to on PUT …/inputs (Pay for labour done in earlier months): the line is paid in the month in the path and placed in those months by the days worked in each. Refused on a row with no such line (earned_without_line), on a line that is not pay for labour — a line_code that is not insurable (earned_kind) — on a net line (earned_net, under its _basis), with earned_to alone (earned_from_required), a span ending before it starts (earned_order) or not before the month (earned_earlier), and — 409 — when a month is not posted or holds no payslip of the employee (earned_months_unposted, under earned_from, naming them). A line sent again without them is the month's own pay again; each component of the answer carries its earned_from and earned_to (null for the month's own).
absence absence_kind, absence_from (in the month), absence_to, unpaid_ground (an unpaid row only, since round 10b), leave_taker (a childcare, father_childcare or adoption row only, since round 11; a maternity row too since round 11b), sick_note_number (required for sick), sick_note_issued_on, sick_note_presented_on, absence_note One absence per row, added: known by its kind and first day, so the same file again is nothing and a corrected end date replaces it. An absence entered in the app or sent with the PUT is never touched — one the row overlaps is an error. A maternity, paternity, childcare, father_childcare, adoption or adoption_paternity row is written with a warning: the child is entered on the employee's page — and an adoption leave's dates too (adoption_on_card, since round 11: the file has no column for them, so the leave is recorded without the check of the days КТ чл. 164б gives). leave_taker is childcare_taker on PUT …/inputs (adoption_taker on an adoption row, maternity_taker on a maternity one — guardian, настойник, among its codes) — the code or the employee page's words (майка, осиновителка, баба, …): a taker the file does not know is bad_leave_taker, one the kind has not taker_not_for_kind; a corrected taker replaces the absence. unpaid_ground is unpaid_ground on PUT …/inputs — request (empty: the default), chl167a or production, since round 11b the grounds of КТ чл. 157 (chl157_summons, …), or the employee page's words for them (чл. 167а, производствена необходимост, свидетел, съдебен заседател, доброволец, …): a ground the file does not know is bad_unpaid_ground, one on another kind ground_not_for_kind; a corrected ground replaces the absence. An early return is not the file's: it changes an absence already recorded, often of a posted month, and rests on its own paper — POST /payroll/absences/{id}/return; a file sending the leave again as it was granted leaves the return in place (unchanged).
return returned_on (in the month), return_basis, return_reference, return_reference_date Since round 11: an unpaid leave ended early — the first day back, in the file's month (a return belongs to the month its day back is in), and the paper that ended it: order (the employer's order) or notice (the employee's written notice), or the employee page's words for them (заповед, уведомление); empty is the page's default — notice for a leave of КТ чл. 167а, order for any other — with its number and date (not after today). The leave is the employee's unpaid leave the day falls in — after its first day, no later than the day it was granted to — recorded before the file or by the file itself (an absence row of the same file), whichever month it began in; written as POST /payroll/absences/{id}/return writes it: the row shortened, a posted month it reaches corrected in the first open month (the row warns return_past_deadline for months past their deadline). The same return again is unchanged, its paper changed updated, an earlier day ends the leave earlier still (recorded). Refused: return_outside_month, bad_return_basis, return_reference_after_today, return_no_leave (no unpaid leave the day falls in), return_twice (one leave twice in the file), and the return's own refusals under returned_on — return_already_recorded (a later day than one recorded), absence_year_closed, … — in its own sentence.
salary new_salary or new_hourly_rate, new_currency (empty = the one the person is paid in now), salary_effective_from (required), change_signed_on (optional) A change of the salary from its date, through the employee's own writer (as PATCH …/employees/{id} with salary_effective_from): the months from that date go stale; a date in a posted month is refused. change_signed_on is the day the допълнително споразумение was signed — т. 16 of the change's ЕТЗ, the day its three days run from, as change_signed_on on the PATCH; left empty, it is told on the record later (PATCH /payroll/employment-records/{id}).

Amounts and hours take a point or a comma, dates YYYY-MM-DD or DD.MM.YYYY (a workbook's own dates are read as dates). Nothing is removed because a file leaves it out.

{ "data": { "period": "2026-10", "format": "xlsx", "dry_run": true, "ok": true, "written": false,
  "rows": 48, "rows_with_inputs": 12, "employees": 11,
  "counts": { "hours": 9, "components": 4, "absences": 2, "salary_changes": 1, "returns": 0 },
  "people": [ { "employee_id": "01k…", "external_id": "E-1001", "name": "…", "lines": [3, 40],
    "hours": { "line": 3, "values": { "night_hours": "8.00" }, "note": null, "result": "created" },
    "components": [ { "line": 3, "code": "bonus", "key": "", "amount": "250.00", "amount_basis": "gross", "earned_from": null, "earned_to": null, "consented_on": null, "result": "created" } ],
    "absences": [ { "line": 40, "kind": "sick", "from": "2026-10-05", "to": "2026-10-07", "unpaid_ground": null, "childcare_taker": null, "result": "created" } ],
    "returns": [],
    "salary": null } ],
  "stale_months": ["2026-10"], "errors": [], "warnings": [], "not_found": [] } }

Results are created, updated, replaced, unchanged, and changed or unchanged for a salary — and recorded, updated or unchanged for an early return (since round 11: each of returns — line, leave_from, leave_to (the leave as granted), returned_on, basis, reference, reference_date, result; counts.returns); stale_months are the computed months the file moves. Each absence carries unpaid_ground (since round 10b): an unpaid row's ground as it is written — request when the row leaves it empty — and null for every other kind; and childcare_taker (since round 11): who takes the leave as the row writes it (leave_taker), null when it does not say. Each component carries consented_on (since round 9's second follow-up): the recovery_consented_on day of a recovery, as PUT …/inputs answers it — null for every other line and for a recovery without consent. A file with errors writes nothing and answers with every one of them — details.errors, each {line, column, code, message} (line is the row as a spreadsheet numbers it, null for the file as a whole), details.not_found, and details.warnings:

  • 422 file_invalid — at least one error is about the bytes: an unknown or a repeated column (refused, never ignored — a misspelt overtme_hours would be overtime nobody pays), a cell that is not a number or a date, a group missing its amount, lines that contradict each other, more than 5,000 rows (too_many_rows, answered at once: the rows are counted before the file is read — unless Prefer: respond-async asked for the background), a workbook too big to read (workbook_too_big: its first sheet unpacks past 256 MB, or another part past 64 MB — save it as CSV, or split it), a CSV line wider than any table (file_too_wide: more than 16,384 cells, however its quotes run). The same file can never pass.
  • 409 file_refused — every error is about the payroll as it stands: an employee not on the roster yet or not employed in the month, a posted month, an absence already recorded, a code the company does not have. The same file passes once that changes.

warnings ({line, column, code, message}, also on a successful answer) never stop the file. Since round 9 (2026-10-06) earned_past_deadline is one, under earned_from: the row's line is placed in months past 30 April of the year after them (Corrections, „A month past its deadline") — their records go on a носител after НАП's or НОИ's permission, the money is paid as usual. Since round 10 (2026-10-07) a row's absence recorded over a posted month (it starts in the file's month and runs into one that is posted) says on its row, under absence_from, what PUT …/inputs says in its correction: absence_past_deadline — the months it corrects past their deadline, as correction.past_deadline; absence_limitation_salary and absence_limitation_benefit — the months whose salary (КТ чл. 358) or НОИ обезщетение (КСО чл. 115, ал. 2) may be time-barred by now, as correction.limitation. The months in each message are YYYY-MM. Since round 11 a row's early return reaching a posted month says return_past_deadline under returned_on, as correction.past_deadline on POST …/return.

The Idempotency-Key covers the file's bytes and dry_run: a preview and the write of one file are two requests with two keys. A file of more than 2,000 rows — or any file sent with Prefer: respond-async — is taken in the background since build round 2026-10-18: A big file, in the background, below.

Payroll files: the roster, the openings, the allowances, the deductions

Since 2026-10-10 the files the app's /migration takes — for an integration that holds a spreadsheet rather than one call per person. kind is one of:

kind One row is Written through
roster a person — the fields of POST /payroll/employees under the template's column names (gross_salary, egn, …) and the create door's own names for the rest (type, class_percent_override, fte_fraction, kid_code, a1_country, …) the hire of POST /payroll/employees (existing employment: an ЕТЗ deadline opens only for a hire whose notice is still ahead) — or, with mode=update, the change of PATCH /payroll/employees/{id}
openings a person's year so far, leave opening and leave entitlement — any of the three PUT …/year-openings/{year}, PUT …/leave-opening, PUT …/leave-entitlements/{effective_from}
allowances a standing allowance POST /payroll/employees/{id}/allowances
deductions a running deduction, a запор's or an издръжка's order with it (order_* columns) POST /payroll/employees/{id}/deductions

GET /payroll/imports/{kind}/template.csv — the kind's template, with example rows (the roster's with every column). UTF-8 with a BOM, ;.

POST /payroll/imports/{kind}/file — multipart/form-data with file (a .csv or an .xlsx, up to 16 MB) and dry_run, required: true carries out the whole write and rolls it back, false writes it. For the roster also mode — create (the default: people already on the roster are passed over as duplicate) or update (they are brought up to date: found by external_id with active_from, then by ЕГН/ЛНЧ; a blank cell changes nothing; a salary change needs its salary_effective_from) — and template, an employee template's code for every row (a template column wins, the row's own values win over both). Any other field is 422 validation_failed. The openings, allowances and deductions name their person by identifier (a full ЕГН/ЛНЧ), external_id or employee_id; two given must agree.

Row by row, not all or nothing: each row is checked by the rules of the call it replaces and refused with that call's reason, and every other row is written. The answer is 200 with every row:

{ "data": { "kind": "roster", "dry_run": true, "error": null,
  "counts": { "create": 2, "update": 0, "unchanged": 0, "duplicate": 1, "refuse": 1 },
  "notes": { "etz_deadline_passed": 2 }, "unknown_columns": ["favouritecolour"], "new_departments": ["Склад"],
  "rows": [ { "line": 2, "action": "create", "subject": "Мария Петрова", "identifier": "91••••••56",
      "reason": null, "reason_text": null, "params": {}, "column": null,
      "details": { "type": "employee", "klass": { "years": 4, "months": 2, "percent_per_year": "0.6", "percent": "2.4", "source": "legal" },
                   "etz": { "state": "deadline_passed" }, "department": { "name": "Склад", "new": true } },
      "warnings": [] },
    { "line": 4, "action": "refuse", "subject": "…", "identifier": "…",
      "reason": "ui.migration.reject.bad_iban", "reason_text": "The IBAN is not valid — …", "params": { "column": "iban" }, "column": "iban",
      "details": {}, "warnings": [] } ] },
  "meta": { "import_id": "01k…" } }

unknown_columns are header names no field reads — a misspelt optional column would otherwise be lost. A roster row's details carry the клас it leaves the person with, whether it opens an ЕТЗ deadline (etz.state: opened with due_on, deadline_passed, no_signing_date, not_applicable for a ДУК) and its department; an update's details.changes are {column, from, to}. An openings row's details.parts say which of its three parts were created, updated or unchanged. A total length of service („Трудов стаж", in one column or in years and months) is refused unless the row also gives the стаж before joining (experience_before_hire_months). An allowance or a deduction without its own id (allowance_id, deduction_id) is named by a fingerprint of its figures, so the same file sent twice writes nothing the second time.

A written file (dry_run=false) is recorded in the company's import history: meta.import_id names it, and on /migration its new people can be taken off again while no month is computed on them. A file that cannot be read at all — no person column, no pay column in a roster, an unreadable workbook — is 422 file_invalid, and so is a workbook too big to read: one whose first sheet unpacks past 256 MB, or another part past 64 MB, details.reason ui.migration.error_workbook_too_big (save it as CSV, or split it); and a CSV with a line wider than any table — more than 16,384 cells, however its quotes run — details.reason ui.import.file_too_wide. A CSV whose lines end in a lone CR — none in an LF but its last, as Excel's „CSV (Macintosh)" writes it — is read line by line, in Mac Cyrillic when it is not UTF-8 and its letters read as Mac Cyrillic's words; in any other CSV only an LF ends a line, and a stray CR inside one stays in its cell. A company whose payroll is being computed is 409 payroll_busy. The Idempotency-Key covers the bytes and the fields.

A limit on people on payroll (since 2026-10-18). Under an enterprise contract a company's people on payroll have no limit — save one case: a paid accounting practice works the company by delegation and the contract does not cover delegated practices. The practice then pays for the company's people, and its plan's limit applies to them, as to every hire through POST /payroll/employees. A roster file written there (dry_run=false) is all or nothing against that limit: when every new person on payroll fits, the file is written row by row as above; when they do not, the answer is 409 payroll_room_capped and nothing is written — details.rows_past_limit counts the people past the limit, details.slots_needed the payroll slots that would make room for them. The API never buys payroll slots: the practice adds them on its Billing page, or the contract is set to cover delegated practices; then send the file again. A preview (dry_run=true) shows which rows are past the limit, refused with ui.migration.reject.employee_limit_slots. A former employee — a contract ended before today — takes no room; a row of mode=update that puts one back on payroll — an ended contract carried past today — takes room as a new person does, refused past the limit with ui.migration.reject.reinstate_limit_slots (since 2026-10-18).

A big file, in the background (since build round 2026-10-18). A file of more than 2,000 rows — or any file, when the client asks for the background with Prefer: respond-async (the answer then carries Preference-Applied: respond-async) — is not worked through inside the request: both POST /payroll/imports/{kind}/file and POST /payroll/periods/{YYYY-MM}/inputs/file answer 202 with a Location, and the file is taken in the background by the very same code. Up to that line, without the header, the answer is the request's own, as before:

{ "data": { "run": { "id": "01k…", "kind": "roster", "dry_run": true, "status": "queued",
                     "processed": 0, "total": 12000, "created_at": "…",
                     "started_at": null, "finished_at": null } } }

GET /payroll/imports/runs/{id} reads it back: status is queued, running, done or failed; processed of total say how many of the file's rows it has got through. Once done, result_url gives the address of its answer: GET /payroll/imports/runs/{id}/result answers exactly what the POST would have answered inside the request — its status and its body: 200 with every row and, for a write, meta.import_id; or the same 409 payroll_busy, 422 file_invalid or 409 file_refused — so it is read as the POST is. Once failed, error carries its code and a message: gone (the key was revoked or has expired, or its person can no longer write to the company as the key's account), read_only (the company became read-only after the file was sent, or its account is held for an unpaid plan upgrade; nothing more was written), contract_suspended (the account's enterprise contract was suspended before the file was taken; nothing was written — since 2026-10-18), ability_missing (the key no longer holds payroll:write there — its enterprise contract ended before the file was taken; nothing was written — since 2026-10-18), build_failed or build_lost (it stopped; send the file again). A run's answer is kept in the very transaction that writes its file, so a run is done with its answer or nothing of its file was written: after build_failed or build_lost, sending the file again writes it once. A written file is written once: a repeat with the same Idempotency-Key answers the same run, and a run is taken by one worker. Before it is done the result answers 409 run_not_ready (details.status), after it failed 409 run_failed (details.error_code); a day after it ended, or another company's id, 404. Any key of the company with payroll:read may follow a run.

A file of more than 15,000 rows is more than one file takes — a company's file is written in one transaction — and is refused at once: 422 file_invalid with details.reason ui.migration.import.too_many_rows, details.rows and details.most_rows. Split it into files of up to 15,000 rows. The rows are counted before the file is read (since 2026-10-19), so a file of very many short rows is refused the same way. (The month's inputs file keeps its own limit of 5,000 rows, too_many_rows, answered at once in the request.)

Corrections

A posted month is final. What it paid wrong — or could not pay, because the fact arrived after it was posted — is corrected in an OPEN month, through four doors. Each writes an input of the month it lands in, so a computed month goes stale until you compute it again; a posted month is 409 period_posted.

A month past its deadline, said where the change is entered (since round 9, 2026-10-06). A posted month's Д1 data are corrected the ordinary way until 30 April of the year after it (Наредба № Н-13, чл. 9, ал. 5); a correction whose settling package is due after that day goes to the носител (A month past its deadline, under Filings), and one entered after it needs НАП's or НОИ's permission if filed now. Every answer that enters such a change says so in past_deadline, never refusing it — the money is owed and paid as usual:

"past_deadline": { "settle_period": "2027-04",
  "months": [ { "period": "2026-12", "deadline": "2027-04-30", "carrier": true } ] }

months are the posted months the change corrects whose deadline is not met by the package of settle_period — carrier true when that package is due after deadline (their records will be in its d1d6-nositel-{year}.zip), false when the package is due in time but deadline has passed today (they stay in it, and filed now need the permission). Months in time are not listed; when none is past, past_deadline is null, or absent from meta. Where it is: meta.past_deadline on PATCH /payroll/employees/{id} (a salary dated back with retro) and on POST …/allowances (a standing allowance started in a posted month with retro); correction.past_deadline on a late absence's row of PUT …/inputs; past_deadline on a component row of PUT …/inputs whose line is placed in the months it was earned in (earned_from); termination.past_deadline on POST and PUT …/termination with settle (the leaving month, and a later posted month that paid the person nothing — the one the package deletes; a month that paid salary keeps its record); past_deadline on PUT …/termination/compensation when a чл. 225 input corrects posted months (only their corrected and deleted вид осигурен 18 records — a first record of стаж under КСО чл. 9, ал. 3 needs no permission); and the monthly inputs file warns earned_past_deadline on such a row.

Since round 9 (later the same night) three more places, and one door less that refuses. A late болничен or leave of a month whose deadline has PASSED is carried like any other (409 sick_year_closed / absence_year_closed with deadline is no longer returned; recalculated still is). PATCH /payroll/carry-forwards/{id} with confirm answers meta.past_deadline when the confirmation re-declares a month past its deadline — a sick proposal's month, or a recovery of the salary of the month the employment ended, which is on that month's corrective record; every other recovery is withheld before tax from the month that pays it and re-declares nothing. And each of meta.recovery_proposals on PATCH /payroll/employees/{id} carries past_deadline — what confirming it would re-declare, null for the usual pay cut of a month the person still works in.

A month whose claims may be time-barred (since round 9c). A late absence's row of PUT …/inputs carries correction.limitation, and PATCH /payroll/carry-forwards/{id} with confirm answers meta.limitation, when a month it reaches is old enough that a claim on it may be prescribed — never a refusal: prescription is not applied of its own accord (ЗЗД чл. 120), and what is returned after it is not claimed back (чл. 118):

"limitation": { "months": [ { "period": "2026-08", "salary": "2029-09-01", "benefit": "2030-01-01" } ] }

salary — the employer's claim to the salary the month paid and the change takes back or proposes for recovery: three years from its payment (КТ чл. 358, ал. 1, т. 3 and ал. 2, т. 2), counted from the first day after the month, the earliest it can have been paid; benefit — the person's claim to НОИ's обезщетение for a sick absence or a leave НОИ pays: three years from 1 January of the year after the month (КСО чл. 115, ал. 2). Each is the day from which that claim may be prescribed, set once today has reached it and null before; limitation is null (or absent from meta) when no month has.

Hand adjustments — /payroll/periods/{YYYY-MM}/adjustments. One statutory figure of one person's month moved by a signed amount, with a reason:

target Moves What follows it
insurable_base Д1 т. 21 Every contribution (employee and employer, per fund) and — through the contributions — the tax. The base is yours: no floor lifts it.
taxable_base Д1 т. 31 The tax.
income_tax Д1 т. 31.А The net.

The bases and the tax, never a fund's contribution: НАП checks each contribution as base × rate, so a moved base re-derives them all. In a month an A1 certificate covers in part, a figure is moved on the Bulgarian share the month insured (the base you move is that share); in a month an A1 covers whole there is no Bulgarian insurable base, so insurable_base is 422 validation_failed on target — the taxable base and the tax still move.

POST /payroll/periods/{YYYY-MM}/adjustments {"employee": "…" (or "external_id": "…"), "target": "income_tax", "delta": "10.00", "reason": "…"} — 201 the first time; one adjustment per employee, month and target, so the same body again is 200 and changes nothing, and another delta or reason corrects it (200). It takes a key minted by the account's owner or an administrator (403 role_required): a figure the law computes, overridden, is a decision somebody answers for — the app keeps it with the same two seats. The month's computation applies it after everything else is priced and before the deductions. Against a month already computed, a delta that takes the figure below zero — or the insurable base above the maximum insurable income — is 422 validation_failed on delta; a later computation that finds one (an input changed under it) fails with compute.error.code adjustment_invalid, naming the employee. GET lists the month's adjustments and, while the month is computed and current, what each moved (applied.before, applied.after). DELETE …/adjustments/{id} removes one. The run answers each person's adjustments (target, delta, reason, before, after) and the totals' manual_adjustments; register.csv carries manual_adjustments; the фиш has a block of its own; Д1/Д6 names each one in its caveats.

A late leaver — settle: "first_open_month" on the termination (above). The final pay lands in the first open month although the person is no longer employed in it: only the обезщетения, each with details.for_period (the leaving month) — no salary, no standing line. Since 2026-10-05 the month files no Д1 record of the person's own code — they are insured there no day, and НАП's program refuses such a record — and the final pay is declared on the corrective Д1 of the POSTED leaving month (код корекция 1, the last insured day in т. 15), in its т. 31 and 31.А: the обезщетения due on the termination are income of that month (ЗДДФЛ чл. 42, ал. 2). Since round 6 (2026-10-06) they are not in т. 29 or т. 34 — on that record or on any leaving month's own — because an обезщетение is no трудово възнаграждение: т. 29 is the брутно трудово възнаграждение (Н-13, Приложение № 1; НСОРЗ чл. 3) and т. 34 the net of it, without the обезщетения and their tax (НПОПДОО чл. 32, ал. 4); until then both carried them. Its tax stays in the paying month's код 8 column; nothing of it is insured (НЕВДПОВ чл. 1, ал. 8, т. 7). Salary a posted month paid after the leaving date is a proposed recovery — once confirmed and withheld, it lowers that corrective record's т. 29, 31, 31.А and 34:

GET /payroll/employees/{id}/carry-forwards — everything carried for the employee: kind termination (the final pay), compensation (an обезщетение confirmed after the fact, with its code), retro_pay (a raise's difference for a posted month, with retro — what it adds to that month and withholds for it; since 2026-10-06 cause earned for a one-off line's share of a month it was earned in — Pay for labour done in earlier months; since round 10 cause periodic_bonus for a posted month's paid leave priced again because a bonus earned in its КТ чл. 177 base month was paid after it — НСОРЗ чл. 17, ал. 2 — and, on every retro_pay row that prices the leave again, leave_basis: base_period, days, paid_daily and daily (the daily figure the month paid and the one it pays now, four decimals), periodic (each bonus the base month now holds: line, code, label, paid_in, from, to, share), and since round 11 chl21_act — the НСОРЗ чл. 21, ал. 2 supplement the leave now holds (amount, paid_amount the posted line held, days, acts), or null — null on every other row; since round 11 cause pay_act for a posted month's paid leave priced again because a raise before it was named the execution of an employer-wide act after the month was posted, Employer-wide pay acts; a raise the act itself dates back is a salary row, the supplement among its lines), recovery (status proposed until decided; cause termination — salary paid after the end, a settled raise's difference on it included and, since round 10b, never the one on the hours, the leave or the employer's sick days, which were owed — or sick — the salary a posted month paid for the days of a late болничен, or of a late maternity, paternity, childcare or father_childcare absence, under the company's default consent; absence_kinds names which — or, since 2026-10-04, pay_cut — what a salary dated back LOWER made a posted month overpay, less what a late leaver's proposal of the same month already asks; since round 10 the lines derived from the salary too — the hours on the contract's hourly base, the leave's чл. 21 добавка or current-salary figure, the employer's КСО чл. 40, ал. 5 sick days — and, confirmed, the sick days' share is a recovery line of its own, details.untaxed true, that lowers the month's insurable income and not its taxable one (ЗДДФЛ чл. 24, ал. 2, т. 14) — or granted_leave — what it paid for the days of a late paid_annual, additional_annual or unpaid absence and did not owe, under late_leave_recovery — or, since round 10, abroad — what a foreign employer recovered of a shadow month's salary for such days, status confirmed, with abroad {recovered_on, note}, below — or, since round 11, deleted_month — a posted month after a late leaver's leaving month that paid salary: its Д1 deleted and its pay reversed in settle_period, its net (amount) the employer's claim, deleted the month's figures as they now stand (gross, employee_contributions, employer_contributions, taxable_income, income_tax, net_pay — with every correction of the month settled since — and since round 11b paid_abroad: a shadow month's, deleted too, whose net the foreign employer paid — nothing is claimed here, the row confirmed with amount 0.00 from the start, its net and tax on the clearing account); proposed is the question whether the employee consents in writing to its being withheld; and on a termination proposal of the leaving month, since round 11, after_end — what of its amount the month paid for days after the end besides the salary: leave (days, paid, chl224_rate — the КТ чл. 177 daily rate at the termination — chl224, the КТ чл. 224 compensation the same days are owed as unused leave, set off, and asked) and sick (days, paid — the employer's КСО чл. 40, ал. 5 days, asked whole on a recovery line of its own that is never taxed) — since round 11b each with raise, of paid what a raise dated back and settled paid on those days — null on every other row) and sick_correction (a болничен — or one of those leaves — recorded after its month was posted, above — with retro, what it moves in that month, and sick: absences, the absence ids; absence_kinds, their kinds (sick, maternity, paternity, childcare, father_childcare, and since round 11 adoption, adoption_paternity); worked_days, sick_days_employer, sick_days_noi (and of them sick_no_benefit_days, a болничен's days without the right — т. 16.4, since 2026-10-04), maternity_days (with an adoption's days), paternity_days (with an adoption_paternity's — which carry no т. 17), childcare_days (with a father_childcare's days), the days the corrective Д1 declares, and maternity_no_benefit_days and paternity_no_benefit_days, the parts of maternity_days and paternity_days without the right to the обезщетение (т. 16.3); since 2026-10-04 paid_leave_days and unpaid_leave_days, a late paid or unpaid leave's days (absence_kinds then names paid_annual, additional_annual or unpaid), and sick_no_benefit_days, the part of sick_days_noi of an incapacity begun while the insurance was interrupted (т. 16.4); recovery, consent or net; granted_recovery, the same for what the month paid for a late leave's days (null without one), and leave_pay, the КТ чл. 177 pay a late paid leave is owed; taken_back, the salary for the days this row takes back — with a late paid leave's, set against its leave_pay; paid_abroad, true for a shadow payroll month; and since round 10 recovered_abroad, of taken_back what the foreign employer recovered from the employee, null for none), and — since round 6 — chl225_correction (a чл. 225 input changed after the month that paid it was posted: the open month that re-files the вид осигурен 18 records, amount null — The time without work, below); for_period is the month it is for, settle_period the month that pays it, settled whether that month is posted. A shadow payroll month (payroll_mode: shadow) gets no recovery proposal: its net was paid abroad by the foreign employer, not by this payroll. So a late болничен over such a month takes back none of the salary for the sick days and proposes none of it, whichever late_sick_recovery the company chose — only the share of a raise still waiting for the month, which it never paid — while the days, приложение № 9, the employer's чл. 40, ал. 5 pay and the corrective Д1 and Д6 follow as for anybody; a shadow settle month pays that pay through the clearing account, not through this payroll.

Since round 6 (2026-10-06) a sick_correction also comes from a late termination that ends its leaving month's unpaid leave: terminated_on the termination's day, sick.absences and sick.absence_kinds empty, amount 0.00. The health contribution on the leave's days after the termination is not owed (ЗЗО чл. 40, ал. 1, т. 1, б. „б" — „за лицата в неплатен отпуск"), so retro.unpaid_health_owed lowers the claim on the person for what the employer paid of it, and what the month withheld beyond the contribution now due comes back in retro (employee_contributions, taxable_base, income_tax, net_pay); Д1 corrects the month's вид осигурен 28 record to the termination and Д6 its код 5 column. The paying month's run names the row the same way: its totals.carried_forward entry (GET /payroll/runs/{YYYY-MM}) has kinds empty and terminated_on (kinds alone names a late absence's).

Since round 10 a sick_correction also comes from an unpaid leave ended early after its month was posted (POST /payroll/absences/{id}/return): sick.returned names the leaves ([] on every other row), and with no late absence of the month sick.absences and sick.absence_kinds are empty. amount is the salary for the days worked after the return, gross — paid whole, whatever granted_recovery says — and retro moves the month's contributions and tax with it, the unpaid-leave health on those days no longer owed; unpaid_leave_days and worked_days are the days the corrective Д1 declares. The run's item carries it as a sick entry with returned_ids.

Since round 11 a sick_correction also comes from a statement of unpaid leave taken with another employer that moved a posted month's split (PUT …/unpaid-leave-elsewhere): sick.unpaid_elsewhere is true (false on every other row), and with no late absence of the month sick.absences and sick.absence_kinds are empty. It moves the month's т. 16.5, the interruption in т. 14/15, the вид осигурен 28 record and the unpaid-leave health split between them; unpaid_leave_days stays. The run's item carries it as a sick entry with unpaid_elsewhere true.

meta.open_claim (since 2026-10-03) is null, or what the payroll left the employee owing when the employment ended — the takebacks carried until the final pay (or a later payment to them) could not lawfully withhold, within the чл. 446 ГПК ceiling of КТ чл. 272, ал. 2: takeback — a late болничен's or leave's salary taken back, net (its corrections were whole, so the debt sits on 498 „Други дебитори"); salary — a late leaver's confirmed recovery of salary paid after the end, gross, with salary_by_period (the month it was paid for and the amount; only what was withheld was recovered, so the rest is booked nowhere and those months' declarations keep it as pay); and since round 9 advance — an advance no month took back before the employment ended (КТ чл. 272, ал. 1, т. 1), net, a debit of the employee's on 421 where it was booked (0.00 while the employment goes on in another employee after a reinstatement: that pay takes it back itself); and since round 11 deleted — the nets of the posted months after the leaving month that paid salary, whose records the termination deleted (cause deleted_month below), net, on 498 — with deleted_by_period (recovers_period, amount — what is left) and deleted_months (each month's claim, what the payroll withheld with consent, collected, written_off, left, the month it closed_in — whose package files what became of the month: the tax on what was repaid off its код 8 column on the носител, what the employee kept declared with the income alone — consent, the proposal's status, and since round 11b recalculated_in: the posted month the year's чл. 49 recalculation was settled in when it was — made while the person still counted as employed on 31 December, it is not made again, and the person declares the year with an annual return — else null). A shadow month's deletion is not on the claim: nothing is claimed here. period is the month of the employee's latest item — the final pay, or a later month that paid them — and settled whether it is posted; the claim is null until the final pay is computed, which withholds from both first. No payroll month collects it: the employee pays it back (they consented in writing), or the employer claims it in court (ГПК чл. 410); book what is collected or written off by hand — against 498 for takeback, against 421 for advance; for salary, with those months' Д1 and Д6 corrected.

Since 2026-10-04 what became of it is recorded: takeback, salary, advance and salary_by_period are what is left, and settlements lists the facts, newest first (id, part, recovers_period, outcome, amount, settled_on, note, and since round 8 carried_to and settle_period). A claim settled whole still answers, with nothing left and its settlements. Since round 8 a later month that pays the employee again carries the claim on less what was collected, written off or carried away against it — it used to carry the item's whole outstanding again. carry_to (since round 8) is null, or — for an employee whose employment went on in another employee after a reinstatement (POST …/reinstatement) — that employee and the settle_period that would take the claim in: it can be carried there, below.

POST /payroll/employees/{id}/open-claim/settlements {"part": "salary", "recovers_period": "2026-08", "outcome": "collected", "amount": "100.00", "settled_on": "2026-10-01", "note": "В брой"} — the employee paid back (collected) or the employer gave up (written_off) part of the claim: part is takeback, advance (since round 9), or salary with the month (recovers_period, one of salary_by_period) — or, since round 11, deleted with the month (recovers_period, one of deleted_by_period), the fact answering settle_period, the first open month, whose package files the outcome once nothing is left; carried is refused for it (409 open_claim_deleted_not_carried — the claim is net, there is no pre-tax line to carry); amount no more than that part has left; settled_on no later than today. 201 with settlement (as above, and source api) and open_claim as it now reads. Nothing is posted — book it by hand as above. Refused while the month that left the claim is not posted (409 open_claim_provisional: what is left may still change), for a part with nothing left (409 no_open_claim), and for an amount past what is left (422 validation_failed on amount, saying what is left).

outcome: "carried" (since round 8), with consent: true — the employee is back at work on another employee of the same employment after a reinstatement, and agreed in writing on settled_on to amount of the part being withheld from that pay (КТ чл. 272, ал. 1: neither part is among what may be withheld without consent; consent other than true is 422 validation_failed). The part moves to carry_to's employee: the settlement answers carried_to and settle_period — the first open month that employee is paid in — and that month's run takes it in as the dismissed employee's later months would have: a takeback as the late correction's carried takeback (late_recovery.carried_in: net, after the employee's own deductions and within the чл. 446 ГПК room — КТ чл. 272, ал. 2 caps the month's deductions together even with consent — collected off 498 when the month is posted), a salary part as a late leaver's carried recovery line (recovery, recovers_period, details.open_claim; pre-tax, so it lowers the paying month's bases, as a recovery of salary overpaid to anybody the payroll still pays does); what a month cannot take is carried on on that employee. Refused without such an employee paid in an open month (409 open_claim_no_continued_pay). A reinstatement taken back takes its carries with the employee it removes. An advance is never carried: while the employment goes on, its pay takes the advance back without consent, and the claim names none.

DELETE /payroll/open-claim/settlements/{id} — a fact recorded by mistake, taken back: 200 with open_claim as it reads without it. A carried one only while its settle_period is not posted (409 open_claim_carried_paid — it was withheld there); the month goes stale. A deleted one only while its settle_period is not posted (409 open_claim_deleted_filed — that month's package filed what it made of the deleted month).

PATCH /payroll/carry-forwards/{id} {"decision": "confirm", "consent": true, "amount": "200.00"} or {"decision": "dismiss"} — the decision on a proposed recovery. Confirming needs consent: true — the employee agreed in writing to the withholding (КТ чл. 272 lists what may be withheld without it, and salary paid on after a termination the payroll heard of late, or for days of a болничен handed in late, is not among it; чл. 271, ал. 1 spares the employee returning pay received in good faith); amount may recover less than proposed, and the decision covers the whole proposal — what is not confirmed is not proposed again. A confirmed termination or pay_cut proposal becomes a pre-tax recovery line (recovers_period the month overpaid) of the first open month — taken within the month's lawful limit (since 2026-10-03; a recovery past the month's pay refused the month with recovery_exceeds_pay before): it is a deduction made with consent, taken after the employee's own deductions at the company's consented_recovery_pace — within the чл. 446 ГПК ceiling by default, on the net, never leaving less than one minimum wage; at net from whatever the pay leaves (since round 8 a deduction made with consent is read as outside КТ чл. 272, ал. 2, the stronger reading). Pre-tax, the line is the largest, to the cent, whose cost in net stays within that room, never more than the month's gross; the lines take it the earliest month first, and what they cannot take is carried as a recovery line into the next month the person is paid (termination_recovery on the run's items). For a leaver no month may pay again: the rest is the employer's open claim on them (meta.open_claim below). A confirmed sick proposal is taken back by the month's sick_correction in the first open month, priced as the month it is for — the contributions and the tax on it returned, the corrective Д1 and Д6 following it; its cash is withheld within the month's lawful limit and the rest carried, as under net (A month's inputs, late_recovery on the run's items). A sick proposal of a month whose year has closed since — the person's чл. 49 ЗДДФЛ recalculation of the year settled in a posted month — is 409 recovery_year_closed (details.period, details.reason recalculated): confirming would price that month again, which the closed year no longer allows; the salary stays the month's income, and dismiss still works. One of a month past 30 April of the next year is confirmed like any other since round 9 (deadline is no longer returned). A confirmation that re-declares a month past that day — a sick proposal's month, or a recovery of the salary of the month the employment ended (on that month's corrective record) — answers meta.past_deadline as the door that entered it does; any other recovery is withheld before tax from the month that pays it and re-declares no month, so carries none. Anything but a proposed recovery is 422 validation_failed on decision.

A deleted_month proposal (since round 11) is decided the same way, but the month is deleted whatever the answer: confirmed (consent: true, amount up to the claim), its net is withheld net — never a pre-tax line — from the first open month that pays the employee, within the чл. 446 ГПК ceiling or at the net pace, after the employee's own deductions and the other takebacks (deleted_recovery on the run's item); dismissed, nothing is withheld and the claim waits on meta.open_claim to be collected or written off. A pay_cut proposal of a deleted month is 422 validation_failed on decision: the month is claimed already.

PUT /payroll/employees/{id}/recovered-abroad/{YYYY-MM} (since round 10, 2026-10-07) {"amount": "476.19", "recovered_on": "2026-09-05", "note": "Lohnabzug"} — what the foreign employer recovered from the employee of the salary a shadow payroll month paid for the days of its late болничен (or a leave НОИ pays) — and, since round 10b, of a late платен or неплатен отпуск: what the month paid for those days past the leave pay owed for them (an unpaid leave's whole salary for the days, a paid leave's past its КТ чл. 177 pay). One sum for the month: the sick days' share first, then the leave's (sick.recovered_abroad the whole). This payroll takes none of that salary back (sick.paid_abroad above); when the foreign employer did, the employee no longer has the income, so the month is declared without it: the month's sick_correction is planned again with it taken back, as net takes a month paid here — т. 21 and the taxable income lowered, the contributions and the tax on it returned (corrective Д1, the month's corrective код 5 column, the settle month's код 8) — and its net settles through the clearing account with the foreign employer: the shadow settle month's net, never withheld from or owed by the employee here (no late_recovery, no claim on 498). amount is gross, no more than what the month paid for the days less what was recorded and settled already; recovered_on not after today nor before the month. 200 with recovered_abroad (a recovery row, status confirmed, cause abroad, abroad {recovered_on, note}) and correction (the month's sick_correction as it now stands — sick.recovered_abroad, the gross recovered, null for none); meta.past_deadline when it re-declares a month past 30 April of the year after it. Sent again while its settle_period is open, the record is replaced; amount: null takes it back (recovered_abroad null). Once that month is posted it stays (409 abroad_recovery_settled on taking it back) and what was recovered since is a further record. Refused: 409 not_paid_abroad — the month was paid here (its recovery is proposed and confirmed with the employee's consent, above); 409 no_late_correction — no late болничен or leave НОИ pays over the month; 409 not_on_shadow_payroll — the employee is paid here now, and the open month would withhold from that pay what the foreign employer already took; 409 recovery_year_closed as a confirmation; 422 validation_failed under amount or recovered_on.

Обезщетения measured after the fact — PUT /payroll/employees/{id}/termination/compensation {"code": "chl225_unlawful_dismissal", "amount": "6000.00", "reason": "Решение № …"}. code is chl222_1_without_work (КТ чл. 222, ал. 1 — paid once the person proves they stayed without work, up to a month's gross), chl331_by_agreement (чл. 331, ал. 2) or chl225_unlawful_dismissal (чл. 225, ал. 1 — the amount a court awards, up to six months' gross); "amount": null clears it. It is paid in the leaving month while that is open, else in the first open month (paid_in, carried), each line carrying the month it is for — except chl222_1_without_work, which since 2026-10-04 is never paid in the leaving month: it is for the time without work after the termination, which ends in the next month (КТ чл. 222, ал. 1; paid by the end of that month, чл. 228, ал. 3), so it is carried into the month after the termination, or the first open month after it (carried true — and only on a ground that owes it, else 409 compensation_not_owed), and none of its вид осигурен 27 records is for a month after the one paying it; once paid in a posted month it no longer changes (409 compensation_settled — never carried a second time on top), and only an обезщетение the termination owes (its ground and facts, as the offers read them) is carried (409 compensation_not_owed). No termination recorded is 409 not_terminated. All three are taxable (ЗДДФЛ чл. 24, ал. 2, т. 8 exempts none of them). None is insurable income, and there is no choice to send: "insurable": true is 422 validation_failed on insurable (omit it or send false). чл. 222, ал. 1 carries its own contributions (КСО чл. 9, ал. 3, т. 5 — фонд „Пенсии" and ДЗПО only, split between employer and employee as for pay, no health), computed since 2026-10-04 for the month after the termination it covers: spread over the calendar months of that period by working days, each month's share insured within what the person's other insured income of the month leaves of its maximum, withheld in the month that pays it (and off its tax base — ЗДДФЛ чл. 42, ал. 2), declared on Д1 with вид осигурен 27 (one record per month covered) and in Д6 код 6 columns for those months dated the paying month's end; on a run's items they are retro entries with kind chl222 (from, to, days, amount, insurable_base, capped, employee_funds and employer_funds — presented since 2026-10-06; see retro under GET /payroll/runs/{YYYY-MM}). Since round 10 a chl222_1_without_work confirmation also takes new_work_on (YYYY-MM-DD, the day the person started new work — proved by an extract of НАП's регистър на заетостта, or for a time before 1 June 2025 by the трудова книжка; null clears it, left out it is kept): the time without work then ends the day before it, and the contributions and the вид осигурен 27 records cover only that time (т. 14–16 its days in each month). The amount stays the one sent — the offer's ceiling is pro-rated by the working days. Since round 11 it also takes new_work_gross — the new job's gross monthly remuneration (КТ чл. 228, НСОРЗ чл. 17, ал. 1: permanent elements only, from the document the person presents) — and new_work_insurable ([{"period": "YYYY-MM", "amount": "1500.00"}], the new employer's insurable income the person declares for the months the new work falls in, up to three), each null to clear and kept when left out: a gross below the чл. 228 base gives the difference for new work at a lower pay (КТ чл. 222, ал. 1, last sentence) to the end of the month after the termination — the ceiling is then the base for the working days without work plus the base less the new gross for those of the new work, over the month's working days (МТСП's two proportions), the amount is spread over the calendar months by those two parts, each month's вид осигурен 27 record covers the whole period inside it, and its т. 21 is capped at the maximum less the person's other insured income of the month and the declared income for a month the difference reaches (none declared: capped on what is known, and the package says so). The package also says that no НАП or НОИ text settles the difference's insurance and names the other reading (the difference taxed only). With new_work_on, new_work_gross or new_work_insurable, amount may be left out (kept as it stands). A day on or before the termination, after the last day of the month the обезщетение covers, or one that leaves no working day without work (unless the new work pays less — then the whole month is the difference's) is 422 validation_failed under new_work_on, as is the field sent with another code; new_work_gross or new_work_insurable with no day of new work recorded or sent is 422 under its own field, as is income for a month the new work does not reach. The response carries time_without_work for this code — from, to, working_days, month_working_days (those of the whole month after the termination), new_work_on, and since round 11 new_work_gross (as recorded) and difference (null — none; else from, to, working_days, new_work_gross, base, months, new_employer_income as [{period, amount}] and missing_income, the months with none declared) — and null for the others. With no day recorded the whole month is declared, and the package says so. Paid to a person insured no day in the paying month, the 27 record takes the обезщетение's own т. 31 and its share of the month's tax (since 2026-10-05; until then the whole month's). чл. 225 and чл. 331 are outside the insurable income (НЕВДПОВ чл. 1, ал. 8, т. 7). On Д1, since 2026-10-05, a чл. 331 amount paid after the leaving month was posted is declared on that month's corrective record (т. 31 and 31.А; since round 6 not т. 29 and 34, which are the remuneration's) — it is due on the termination — and the paying month files no record of the person's own. Both taxes stay in the paying month's код 8 column.

The time without work after an unlawful dismissal — computed since round 5. It counts as стаж with contributions the employer owes (КСО чл. 9, ал. 3, т. 2 and ал. 5; НЕВДПОВ чл. 1а and 4а — Д1 вид осигурен 18), and a chl225_unlawful_dismissal confirmation takes what they are priced on: act_effective_on (YYYY-MM-DD, the day the act recognising the dismissal as unlawful took effect — after the termination, else 422 validation_failed on it); reinstated (true, false, or null — not said) with reinstated_on (YYYY-MM-DD, required when reinstated is true, after the termination); other_insurance, the person's declaration under НЕВДПОВ чл. 4а — none (not insured elsewhere), declared (insured elsewhere: other_income is then required) or null (not received); and other_income, a list of {"period": "YYYY-MM", "amount": "300.00"} — the insurable income declared for a month of the time without work (a month outside it is 422 on other_income). Each one sent replaces the stored one and each one left out is kept, so a body of code and amount alone changes none of them; the other codes refuse them (422, prohibited); until round 6 they changed only while the month that pays the обезщетение was open (409 compensation_settled) — since round 6 a change after it is posted is corrected in the first open month (below). Since round 6, for chl225_unlawful_dismissal alone, amount may be left out — it is kept as it stands, so the inputs travel on their own ("amount": null still clears it, and the other two codes still send it, 422 on amount otherwise) — and the time without work is declared with no amount at all: reinstatement and the обезщетение are separate claims (КТ чл. 344, ал. 1, т. 2 and 3), and КСО чл. 9, ал. 3, т. 2 puts the contributions on the employer whatever the court awarded. With act_effective_on and no amount the answer's amount is null and paid_in the month the act took effect (or the first open month after it): that month carries a line of 0.00 (details.insurance_only) which prices and files the вид осигурен 18 records and their код 6 columns, books the employer's contributions (Дт 605 / Кт 455 — a month paying nobody posts all the same) and pays them with the month's transfers; nothing is paid to the person, nothing withheld, т. 31 and 31.А stay 0, and the фиш prints no обезщетение line. Clearing the act's date ("act_effective_on": null) drops it. Since round 6 the inputs also take base — the base month for a company whose payroll does not hold it (it began here after the dismissal): {"period": "YYYY-MM", "remuneration": "2000.00", "days": 20, "labour_category": "second", "teacher": true, "qualification_group": 2, "kid_code": "8510"} — the last month before the dismissal's with worked days (a month not before it is 422 on base), its pay (the insurable lines without the employer's sick pay) and the days it was for (worked and on paid leave; raised to a whole month by the month's working days), its category of labour (first, second, third — the default) and teacher's flag, and т. 12.1–12.2 (left out: the card's); "base": null clears it. It is used only while no posted month here is the base, and the package says it was declared. unlawful_dismissal reads base_month (the posted month the time is priced on, null when the payroll holds none) and base (as declared, remuneration as money), and missing names base_month while there is neither. With act_effective_on the amount is paid in the month the act took effect, or the first open month after it (paid_in) — never with the leaving month's final pay: its contributions and their Д1 are due by the 25th of the month after the act (КСО чл. 7, ал. 12, т. 2). The response carries unlawful_dismissal — the inputs as stored (other_income as money), period (from, to: the day after the termination to the day before the reinstatement, at most the act's day + 14; null until the act's date is known) and missing (any of act_effective_on, reinstatement; since round 7 never other_insurance: a declaration not received prices as none — НАП, писмо № М-26-Б-513/28.09.2020: the person not declaring does not release the employer from computing the contributions on the last gross pay and paying them by the 25th of the month after the act — and declaration_pending is true while it is; one received later corrects the filed records, below) — and the employee's termination.unlawful_dismissal reads the same (null for a termination with no чл. 225 confirmed or entered; null in this answer for the other codes). The month that pays it prices each month of the period: the base is the last posted month before the dismissal's with worked days — its insurable lines but the employer's чл. 40, ал. 5 sick pay, over its worked and paid-leave days, times its working days — then the month's share by working days, not below its МОД, within what the person's insured income here that month leaves of the maximum, less the income declared elsewhere (a month left with nothing gets no record); фонд „Пенсии" (both shares) in т. 22А, УПФ in т. 26А (inside т. 22А for a person born before 1960), ППФ and the I/II категория's points in that category, УчПФ for a teacher — all of it the employer's, nothing withheld, no health contribution, each box rounded on its own. On a run's items (GET /payroll/runs/{YYYY-MM}) they are retro entries with kind chl225 — for_period, insurable_base (т. 21) and employer_contributions, their employee_contributions and income_tax 0.00, and since 2026-10-06 from, to, days, capped, employer_funds and unlawful_dismissal (the act's date, the base month, the share and what was declared elsewhere, the boxes' rates — see retro there); EMPL2021.TXT carries one вид осигурен 18 record per month (т. 12.1–12.3 as the base month declared them; when the person is insured no day in the paying month, the обезщетение's т. 31 and 31.А on that month's record), NRA62007.TXT a код 6 column per month dated the day the act took effect. Without the inputs or a base month nothing is priced and the package names what is missing; a month with no Д1 record at all files no EMPL2021.TXT.

A change after the paying month is posted — corrected in the first open month (since round 6). A change of reinstated / reinstated_on, other_insurance / other_income or base after the month that paid the обезщетение (and filed or named the вид осигурен 18 records) was posted — or an act_effective_on entered only then, when the records were named and not filed — is stored and carried into the first open month, never one before the act took effect: the answer keeps paid_in (the posted month) and adds corrected_in, the month whose package corrects the records (null when nothing changes — the inputs sent as they stand, or changed back before that month was posted, which drops the carried correction). That month carries a line of 0.00 (chl225_correction) that prices the time without work again on the inputs as they now stand, at each month's rates and maximum, and compares it month by month with what was filed — the paying month's records and every correction posted since: a month whose figures moved gets a corrective record (код корекция 1), re-filed whole; a month that is no more (the period shortened, or insured elsewhere on as much) a deleting record (код 8); a month not filed before a new record. т. 31 and 31.А stay on the record that carried them (the paying month's, or the last month before it), and move with a corrective record when that month is deleted. NRA62007.TXT carries what rose in a new код 6 column of the difference and what fell in a corrective код 6 column (код корекция 1) — the column re-filed whole at what it now declares — both dated the day the act took effect (Н-13 чл. 9, ал. 7, 11 and 12; Приложение № 4, т. 7 and 18). The employer's side moves by the signed sum: a rise is Дт 605 / Кт 455 and joins the month's transfers; a fall is Кт 605 / Дт 455, an overpayment НАП offsets or refunds (ДОПК чл. 129), never netted against a transfer. On a run's items the correction is retro entries with kind chl225_correction (for_period, employer_contributions signed). Two things stay as filed: the amount (409 compensation_settled) and an act's date the records were filed on (409 act_date_filed — it dates the filed код 6 columns, which a correction may not change; correct those by hand). A correction of a year past 30 April of the next needs НАП's or НОИ's permission (Н-13 чл. 9, ал. 5), and the package says so.

The person back at work — POST /payroll/employees/{id}/reinstatement (since round 6), on the dismissed employee, no body. A reinstated person takes the job up again within two weeks of the notice (КТ чл. 345, ал. 1); the annulled dismissal's effects are erased, and the employer takes the termination out of the employment register within seven days of the act taking effect (Наредба за вписване в регистъра на заетостта, чл. 10, ал. 4, т. 5, б. „б"; Приложение № 1, т. 2, Забележка 2 — код 2). Once the employee's chl225_unlawful_dismissal inputs carry act_effective_on, reinstated true and reinstated_on (else 409 not_reinstated), the call answers 201: employee is a new employee on the same contract from reinstated_on — the card copied (the contract's dates and ground, so the клас keeps counting from contract_start; the latest salary, its salary_history starting that day; the standing allowances and the leave entitlement in force at the dismissal), existing_employment true (no hire record is owed: the contract never ended in the register), the same external_id, and reinstates naming the dismissed employee; dismissed is that employee's id; register says what became of the termination record — erasure (its заличаване, код 2, prepared for the next package: employment_record, due_on seven days after the act), erasure_filed, portal (filed outside Autonify: take it out in the НАП portal) or not_owed (never filed: nothing goes to НАП, and no package or reminder asks for it); posted_months lists months from the day of return already posted — they paid the new employee nothing, so pay those days by hand; not_carried names what the new employee could not take — each standing allowance running at the dismissal by its label, and leave_entitlement when the contract's leave is below the legal minimum on the day of return — to be added by hand. The dismissed employee stays as it was paid — its months, its final pay, the обезщетение and the вид осигурен 18 records of the time without work, now to the day before the return — and is history: its termination is no longer corrected or withdrawn, and its act_effective_on, reinstated and reinstated_on no longer change (409 employment_reinstated, details.continued_as; the declaration still does). Its termination.reinstatement reads on, act_effective_on, person (the new employee), register and erasure (id, due_on, filed); a second call is 409 already_reinstated. The new employee starts on the day of return — the time without work ends the day before it — so a PATCH that moves its active_from is 409 reinstatement_day (details.dismissed, details.reinstated_on): take the reinstatement back, correct reinstated_on and reinstate again. In the month of return the new employee's own insured income comes first within the maximum (КСО чл. 6, ал. 11), the days before it take what is left. DELETE /payroll/employees/{id}/reinstatement takes it back while nothing is final — the new employee removed, the заличаване withdrawn — else 409 reinstatement_final (a month of the new employee posted, or a record about it or the заличаване filed). A dismissal annulled with no reinstatement: POST /payroll/employees/{id}/annulment, below. The new employee's leave includes the time without work (GET …/leave-time-without-work, which also names the чл. 224 compensation the dismissal paid — the person keeps it, and its days are not restored), and the deductions of either employee bind the pay of both (carried on GET …/deductions). The personnel file is one as well (since round 8): GET …/documents on either employee lists the papers filed on both, each with employee (where it was filed) and carried, and a paper of one downloads under the other's path; a till the dismissed employee answered for (the „Каси" section's responsible person) names the new employee from the day of return. A reinstatement taken back moves the papers filed on the new employee — the bin's too — and the tills it answers for to the dismissed one. The year's чл. 49 recalculation, the служебна бележка (and GET /payroll/income-certificates/{year}.zip) and the справка по чл. 73, ал. 6 read the dismissed and the new employee as one person — every employment of one ЕГН/ЛНЧ at the company, the обезщетение paid between them included — as for anybody the company took on again in the year: one employer, one year (ЗДДФЛ чл. 45, ал. 1; чл. 49, ал. 1).

A dismissal annulled with no reinstatement — POST /payroll/employees/{id}/annulment (since round 7), on the dismissed employee, body {"terminated_on": "YYYY-MM-DD"} (and since round 8 optionally "pension_entitled": true, below). A court that annuls a dismissal erases its legal effects, and when the person does not come back — no reinstatement was claimed, or the court reinstated them and they did not report within the two weeks of КТ чл. 345, ал. 1 — the employment is ended anew under КТ чл. 325, ал. 1, т. 2 (МТСП, answer ID 5221), with an order the employer issues (чл. 335, ал. 1; чл. 128а, ал. 3). terminated_on is that order's date: with no reinstatement claimed, usually the day the act took effect (the ground arises when the dismissal is recognised as unlawful); reinstated but not reporting, the day the two weeks from the court's notice ran out, or the day the person said they would not come back (ВКС, ТР № 3/2019 ОСГК; МТСП, answer ID 5482). Never before act_effective_on (422 on terminated_on). Once the employee's chl225_unlawful_dismissal inputs carry act_effective_on and reinstated false (else 409 not_annulled), the call answers 201: register says what became of the dismissal's record in the employment register — erasure (its заличаване, код 2, prepared for the next package: erasure, due_on seven days after the act — Наредба за вписване в регистъра на заетостта, чл. 10, ал. 4, т. 5, б. „б"; Приложение № 1, т. 2, Забележка 2), erasure_filed (the register holds it no more already), portal (filed outside Autonify: take it out in the НАП portal before filing the new record) or not_owed (never filed: no package or reminder asks for it any more); record is the new termination's record — a record of its own (correction refile, код 0, тип на документа 3), filed after the заличаване in the same package, with т. 26 the new day, т. 27 003, т. 25, 30 and 31 counted to the new day, due_on seven days after it (чл. 10, ал. 4, т. 1). Both are the law's deadlines and read overdue once past. The payroll does not move: the time between the dismissal and the new day is no employment the payroll pays — the person is owed the чл. 225 обезщетение for it, not salary — and КСО чл. 9, ал. 3, т. 2 makes it стаж of its own, so the employee keeps active_to, termination_ground and termination.terminated_on (the dismissal's), its months and its final pay, and the time without work stays вид осигурен 18 to 14 days after the act — the law gives a person who is not reinstated no other end. The dismissal is history: its termination is no longer corrected or withdrawn, and its act_effective_on, reinstated and reinstated_on no longer change (409 employment_annulled, details.terminated_on; the declaration still does). Its termination.annulment reads terminated_on (the new day), ground (003), act_effective_on, register and erasure and record (id, due_on, filed); a second call is 409 already_annulled (details.terminated_on). A person reinstated and back at work is not ended anew (409 annulment_reinstated, details.continued_as); a fixed-term contract whose agreed term ran out before the act ended with its term (чл. 325, ал. 1, т. 3), not under т. 2 — 409 term_ended (details.agreed_end), not built: file its records in the portal. DELETE /payroll/employees/{id}/annulment takes it back while nothing of it is filed — the new record and the заличаване withdrawn — else 409 annulment_final, and since round 8 409 annulment_compensation_paid (details.paid_in) once a posted month paid what the new termination owes. The app prints no termination order.

The new termination's обезщетения (since round 8), priced on the annulment and carried as compensation rows of the dismissed employee (GET …/carry-forwards: code, annulment — the new day; for_period the dismissal's leaving month) into the new day's month, or the first open month after it (КТ чл. 228, ал. 3): чл. 224 for the leave of the time without work — from the day after the dismissal to the new day, at the leave the employment had (no чл. 156 days, the time worked elsewhere left out — PUT …/leave-time-without-work), at the чл. 177 rate to the new day; and чл. 222, ал. 3 when the person had acquired the right to a pension by the new day (pension_entitled) — 2 or 6 monthly wages of the month before the dismissal (чл. 228, ал. 1: the last received), once: not when the dismissal paid it. PATCH /payroll/employees/{id}/annulment {"pension_entitled": true} changes the fact while nothing it decides is paid. termination.annulment reads pension_entitled, compensations (code, amount, quantity — days or months — rate — the rate or the base — settle_period, paid) and uninsured: from/to, the time between the act's day + 14 and a later new day, for which nothing is declared — the person neither works nor is paid, so the insurance is interrupted (КСО чл. 10), and КСО чл. 9, ал. 3, т. 2 counts the time without work only to the act's day + 14; the person pays their own health contributions (ЗЗО чл. 40, ал. 5); the time is трудов стаж and its leave is in the чл. 224. Д1 declares the чл. 224 on the record of the person's own вид осигурен for the new day's month, т. 31 and 31.А alone (the month has no insured day under it — НАП, 26-М-181/2012); the чл. 222, ал. 3 is neither taxable nor insurable and no record carries it.

The ground corrected by a court — PUT /payroll/employees/{id}/termination/ground (since round 7), body {"termination_ground": "029", "decision_effective_on": "YYYY-MM-DD"}. A court may correct the ground written for a dismissal without annulling it (КТ чл. 344, ал. 1, т. 4): the dismissal stands — no reinstatement, no чл. 225 обезщетение, no time without work — and its ground becomes the court's, which the employer enters in the employment register within seven days of the decision taking effect (КТ чл. 346; чл. 350а, ал. 2; Наредба за вписване в регистъра на заетостта, чл. 10, ал. 4, т. 5, б. „в"). The employee's termination_ground takes the court's; a final pay still to be paid (the leaving month open, or the open month a carried termination settles in) follows it and is computed again, a posted one stays as it was paid — an обезщетение the new ground owes that it did not pay is paid as the court decided (a чл. 222, ал. 1 amount confirmed with PUT …/termination/compensation is carried into the first open month). A filed termination record gets its correction — код 1, every точка, т. 27 the court's (т. 27 is not among the точки код 1 may not touch) — due seven days after decision_effective_on, overdue once past; one not filed files the court's ground when it is filed. The answer: employee, and termination with termination_ground, ground_correction (decision_effective_on, from, to, corrections — id, correction, due_on, filed; also on the employee's termination.ground_correction) and record_corrections. Refused: 422 on decision_effective_on (on or before the termination's day) or on a ground outside the nomenclature, 409 ground_unchanged, not_terminated, employment_reinstated, employment_annulled, and a correction the record cannot take here (its own codes, as PUT …/termination).

A raise dated back — "retro": "pay_in_open_month" on the employee's PATCH (above). Each posted month from the date is priced again for the person — the basic, the клас and every standing line, as the month would pay them now — against what it paid; the difference is a retro_pay line of the first open month with details.for_period. The money belongs to the month it is for (КСО чл. 6, ал. 2: pay for past work is spread over the days it was worked): its contributions are priced at THAT month's rates and maximum insurable income (a month already at the cap owes none; a month an A1 covered in part insures only the Bulgarian share it recorded, and one it covered whole none), and its tax on THAT month's base (ЗДДФЛ чл. 42, ал. 2) — withheld now (ал. 5), beside the open month's own. The open month's own bases and Д1 record leave the difference out; its EMPL2021.TXT adds a corrective record (код корекция 1) for each month the difference is for, every field re-filled with the corrected figures, and its NRA62007.TXT adds a код 6 column for that month's contributions (т. 9 the month it is for, т. 18 the day it was paid); the tax is in the open month's код 8 column. A second change over the same months pays only what the first did not. A difference still waiting follows its cause: cancel the allowance or move its end, record (or withdraw) a termination that ends the employment inside those months, and the waiting retro_pay rows are priced again — a month that no longer owes anything loses its row, and the open month goes stale so it is computed again before it can be posted. Once the open month that paid a difference is posted, the allowance it was paid for can no longer be cancelled or ended before those months (409 period_posted, details.months), as with any month that paid it. The year's служебна бележка (column 5), the чл. 49 recalculation and the справка по чл. 73, ал. 6 count the difference in the year it is paid (ЗДДФЛ чл. 11, ал. 1). Standing allowances started inside a posted month are priced the same way when the salary is. Not re-priced: the employer's sick pay, overtime priced on the hourly base, the НСОРЗ чл. 21 leave supplement for the posted months — send what is owed on them as a one-off line.

Confirm with an adviser: the code-6 Д6 and the corrective Д1 follow Наредба Н-13 (Приложение № 1 т. 1 and Приложение № 4 т. 8) as we read them, and the files have not been through НАП's validator; a correction of a month of a previous year after 30 April needs НАП's permission (Н-13 чл. 9, ал. 5).

Т. 34 of the months already filed — /payroll/net-remuneration-corrections (since round 8, 2026-10-06). Д1 т. 34 „нетно възнаграждение" is what НОИ caps the sickness and maternity benefits by (КСО чл. 41, ал. 1; чл. 49, ал. 1), and what it holds changed: since round 6 the обезщетения a termination pays and the чл. 49 ЗДДФЛ settlement are out of it, since round 7 the food vouchers are in (НПОПДОО чл. 32, ал. 4 and 5) and an equity line follows its own insurable word. A month filed before keeps the old figure until it is corrected — and nothing is corrected until you ask.

GET reads every posted month's filed EMPL2021.TXT — the latest record of each employee's own code for each month: the month's own (filed_correction_code 0) or a corrective one a later package filed (1) — and compares it with the corrective record a т. 34 correction would file now. Only records of a package written under older rules are compared (a package of the current rules says what they compute). Each month that differs:

{ "data": [ {
  "employee": { "id": "01J…", "external_id": "NC-1", "name": "Явор Петров Ваучеров" },
  "period": "2026-07",
  "filed": { "amount": "1541.26", "currency": "EUR" },
  "corrected": { "amount": "1691.26", "currency": "EUR" },
  "difference": { "amount": "150.00", "currency": "EUR" },
  "filed_in": "2026-07", "filed_correction_code": "0",
  "causes": ["social_expenses"], "also_changes": [],
  "deadline": "2027-04-30", "status": "correctable", "carrier": false, "correction": null,
  "refiled_with": [] } ],
  "meta": { "settle_period": "2026-10" } }

causes: social_expenses (food vouchers), equity, compensation (an обезщетение a termination pays — the month's own, or one later months paid for the leaving month), chl49, maximum (filed above the maximum insurable income), other; and rehire (since round 11) on a scheduled record filed with a rehire month's other employment (below). also_changes: the other points of Приложение № 1 the corrective record fills under the current rules (never one the contributions are computed from). status: correctable; scheduled (in the first open month's package — correction.id, correction.settle_period); carrier (since round 9c; until then past_deadline, never filed) — 30 April of the year after the month is past, or the package it would go in is due after it (Наредба Н-13, чл. 9, ал. 5: after it a corrective declaration goes only with НАП's or НОИ's permission): put in only when named, its record goes to the носител zip of its year (A month past its deadline), counted by its протокол; contributions_differ — the corrective record would also move a box the contributions are computed from (т. 17, 18, 21, 22–28, 29, 30 — НАП's own computation, box by box), which needs a Д6 beside it (чл. 9, ал. 11 and 12); insured_type_differs — the month was filed under another вид осигурен, which a correction may not change (чл. 9, ал. 1, т. 1). The last two are listed and never scheduled. carrier (bool, since round 9c) says whether the record goes to the носител — a carrier month's, and a scheduled one's past its deadline. meta.settle_period is the first open month — null with nothing posted.

A rehire month (since round 11): an employee whose employment ended and who was hired again inside one month has two employments (two employee ids, one ЕГН), and the month's package filed a record of the person's own code from each. The file names the ЕГН and the code, never the employment, so until round 11 such a month was left out; now each record is read to its employment by its days (т. 14 against the employment's days in the month) and compared on its own. refiled_with lists the employee's other employments whose record of the same code the month holds — empty for every other month. НАП's register keeps a month's data by месец, година, ЕИК, ЕГН and вид осигурен (Н-13 чл. 9, ал. 1, т. 1), and a corrective declaration replaces everything held under them, so such a month is corrected as one: a POST naming one employment puts the others in with it — each as its own row when its т. 34 differs too, else as filed with causes ["rehire"] (rehire is added to the others' causes) — and refuses the whole (409 net_correction_not_offered) when one of them cannot go. The package then files a deletion of the month's records (код корекция 8) followed by every record again as a regular one (код 0), its caveat saying so; a DELETE of one takes them all back.

POST {"items": [{"employee": "01J…", "period": "2026-07"}]} — or no items for every correctable month (never a carrier one, which goes only when named) — puts the corrective records into the first open month's package: 201 with what was written (id, employee, period, settle_period, filed_in, filed, corrected, causes, also_changes, source, created_at), 200 and an empty list when every month named is already in. That month goes stale — compute it (POST /payroll/runs) and its EMPL2021.TXT carries a record with код корекция 1 for each month: every реквизит as filed (Приложение № 1, т. 1) and т. 34 as the rules compute it, merged into the record a retro difference or a late correction of the same month already files (one record per person and month), for a leaver too (the month pays them nothing). Its NRA62007.TXT carries nothing for them: no contribution moves, so no Д6 goes with them (чл. 9, ал. 11 and 12). The package's caveats name each. A month named that cannot go is 409 — net_correction_not_listed, net_correction_not_offered (details.reason) — and nothing is written (net_correction_past_deadline is no longer returned since round 9c). An employee of another company is 404 not_found.

DELETE /payroll/net-remuneration-corrections/{id} takes one back while the month it goes in is not posted (409 net_correction_settled after), and that month goes stale again — with it, since round 11, a rehire month's other employments scheduled together.

What follows at НОИ (НПОПДОО чл. 42): a benefit already paid from a period whose data are corrected is recomputed by НОИ on its own, by 30 June of the next year — a higher figure is paid to the person, who claims nothing; an overpayment is returned by the person unless it came from data the employer filed wrongly.

Runs

POST /payroll/runs {"period": "2026-10"} — 202 with where the month stands. We compute it, prepare Д1/Д6 and the НОИ приложения, all in one transaction on our queue:

{ "data": {
  "period": "2026-10", "status": "queued", "stale": false,
  "compute": { "status": "queued", "requested_at": "2026-11-01T06:02:11+00:00",
               "started_at": null, "finished_at": null, "error": null },
  "run": null } }

Wait for the payroll.run.computed or payroll.run.failed event (§9), or read GET /payroll/runs/{YYYY-MM}. status is queued or computing while the work is pending, then computed, failed or posted. A failure carries a stable code in compute.error.code: period_posted, opening_overlaps_payroll, recovery_exceeds_pay (until round 8), salary_inputs_missing, employee_data_missing, payroll_busy, compute_failed, d1d6_failed, noi_failed — and changes nothing: the month is exactly as it was before you asked. A computation our worker ran out of time on is recorded failed (compute_failed) and announced like any other.

  • 409 period_in_future — a month is computed once it has begun (Europe/Sofia): details.current names the current month. A „preview" of December computed in September would bill December's payslips in September. A 409, not a 422: it is a fact about time, and the same request — same Idempotency-Key included — computes once the month has begun.
  • 409 period_posted — the month is posted.
  • 409 opening_overlaps_payroll — somebody's year so far already covers the month: the previous system paid it, and a month is paid once (details.employees: each id and the month its opening runs through). Correct the opening to end before the month, or remove it, and ask again. An opening saved while the computation waits is caught by the computation itself, with the same code in compute.error.code.
  • 409 salary_inputs_missing — somebody's salary cannot be priced: an hourly employee with no worked_hours for the month, or a salary in a currency with no ECB rate for it (details.employees: each id and reason — hours_missing, or rate_missing with the currency and the date it was needed for). Send the hours (or wait for the rate) and ask again; the computation asks too, with the same code in compute.error.code.
  • 422 employee_data_missing — somebody employed in the month has no pay on file: an employee or manager with no salary (no gross_monthly_salary or basic_monthly_salary, no hourly_rate for an hourly one, no contract_amount for one paid in another currency), or a граждански договор with no civil_contract_fee. The month is not computed with them at 0.00 (details.employees: each id, the readiness check — person.pay or person.civil_fee — and the field to send). PATCH the employee and ask again with the same Idempotency-Key — this 422 is about the employee's card, not your request, so it is never memoised (§3). The computation asks too, with the same code in compute.error.code; the app's own button and the monthly auto-run refuse the month the same way. Somebody who left before the month began does not hold it up. GET /payroll/readiness lists these gaps in advance (blocks_compute).

Forty companies at once. Ask for every month you need: each is computed as its own job, on a queue of its own. While our servers have room to spare, several companies are computed side by side; when they are busy, one at a time — but one is always running, so a batch always moves, and waiting its turn never fails a request. A month whose company is busy with another payroll write (someone saving an absence in the app, another month of the same company computing) waits that out for up to 30 minutes before it is answered payroll_busy. Forty entities asked for on the 1st finish over minutes, not seconds: wait for the payroll.run.computed / payroll.run.failed events rather than polling.

One entity of more than 1,000 people (since build round 2026-10-11) is computed in chunks: the same figures, a hundred people at a time over as many jobs as it takes, then the month's totals with Д1/Д6 and, last, the НОИ приложения — so 5,000 people in one entity compute (one job's time used to stop at about 1,700). While it runs, compute.progress says how far it has got — { "done": 2300, "total": 5000 }, null for a month computed in one go — the month reads status: computing and stale: true, its documents are refused (409 run_stale) and posting is 409 run_computing: nothing is handed out of half a month — and neither are its figures: run is null and items is empty, as for a month before its first computation (the previous computation's people are gone and the new one is not whole yet). A page asked for with ?limit= has no items (meta.items_total: 0, no next_cursor), and a cursor handed out before it began is 409 run_recomputed. Other payroll writes of the company are let in between the chunks; one written while it runs may belong to somebody already computed, so the month finishes stale: true — compute it again. Asking again while it runs replaces it (the newer request's computation takes over). One difference from a month computed in one go: a step that fails after the first leaves the month stale with its previous computation gone, rather than exactly as it was — the failure is recorded and announced with the same codes; ask again. Until it is computed again such a month reads status: failed with run: null and no items — unless only the НОИ step failed: its figures are whole by then, and the month is handed out, stale: true.

The refusals of such an entity come from the computation (since build round 2026-10-12). The three refusals that read every person of the month — opening_overlaps_payroll, salary_inputs_missing and employee_data_missing — are asked by the computation itself, not by POST /payroll/runs: for an entity past the line the POST answers 202, and the month then reads status: failed with the code in compute.error.code and what the refusal named in compute.error.details — exactly the details the synchronous answer carries (employees with each id and its check and field, or its through, or its reason). Up to the line nothing changed: the POST refuses them at once, as above. A posted month is refused at once either way (409 period_posted). The monthly auto-run of such an entity is queued the same way and announced with source: auto_run.

GET /payroll/runs — the months, newest first (?year=, ?cursor=, ?limit= — 24 months a page by default, at most 100; meta.next_cursor is the cursor of the next page). GET /payroll/runs/{YYYY-MM} — the month, its totals, and one row per person, keyed by the employee, not by the payroll item (whose id changes on every recompute):

{ "data": {
  "period": "2026-10", "status": "computed", "stale": false,
  "run": { "id": "01k…", "status": "computed", "employees": 48,
           "totals": { "gross": { "amount": "118400.00", "currency": "EUR" },
                       "net": { "amount": "…", "currency": "EUR" },
                       "amount_payable": { "amount": "…", "currency": "EUR" }, "…": "…" } },
  "items": [
    { "employee": { "id": "01k…", "external_id": "E-1001", "name": "Анна Андреева",
                    "personal_identifier_last4": "0011" },
      "type": "employee",
      "gross": { "amount": "2700.00", "currency": "EUR" },
      "personal_contributions": { "total": { "amount": "…", "currency": "EUR" },
                                  "funds": { "pension": { "…": "…" }, "health": { "…": "…" } } },
      "employer_contributions": { "amount": "…", "currency": "EUR" },
      "income_tax": { "amount": "…", "currency": "EUR" },
      "net_pay": { "amount": "…", "currency": "EUR" },
      "amount_payable": { "amount": "…", "currency": "EUR" },
      "days": { "worked": "19.00", "paid_leave": "0.00", "sick_employer": "3.00", "…": "…" },
      "components": [ { "code": "bonus", "amount": { "amount": "300.00", "currency": "EUR" }, "…": "…" } ],
      "salary": null,
      "minimum_wage": { "monthly": { "amount": "620.20", "currency": "EUR" }, "due": null, "below": false },
      "deductions": [] } ] } }

Paging the items (since build round 2026-10-11). Without ?limit= or ?cursor= the month answers every item at once, exactly as it always has — about 3 KB a person, so 6 MB at 2,000 people. Ask for a page instead with ?limit= (1 to 500, clamped like every list's limit, never refused; 200 when only a cursor is given) and follow meta.next_cursor:

GET /api/v1/payroll/runs/2026-10?limit=500
→ { "data": { "period": "2026-10", "status": "computed", "run": { "…": "…" }, "items": [ … 500 rows … ] },
    "meta": { "next_cursor": "MzoxMWsy…", "limit": 500, "items_total": 2000 } }
GET /api/v1/payroll/runs/2026-10?limit=500&cursor=MzoxMWsy…

Every page carries the whole month — status, stale, compute and run with its totals (deductions and amount_payable summed over every item, not the page) — and items holds the page, in the order of the whole answer (surname, then name; the employee's id breaks a tie). meta.items_total is the number of items in the month; meta.next_cursor is null on the last page. The cursor is opaque and belongs to one computation of the month: once the month is computed again (run.generation moves) a cursor handed out before is refused with 409 run_recomputed (details.generation, the month's current one) — its later pages would be another computation's figures under the same list — and so is any cursor while the month is being computed in chunks. Read the month again from its first page. A cursor that is not one this endpoint handed out is 422 validation_failed (details.cursor). Each page is one call, priced as the month is (5 units). Only the page's items are read whole, so a page of 500 costs the same whatever the size of the month. (The default stays the whole month so that no integration changes behaviour by our hand — assistant, delegated.)

minimum_wage (since round 11b) is what the month's own terms say of the minimum wage, for an employee: monthly the full-time МРЗ of the month, and — when a monthly salary in force on some of the month's employed days was under it by the working time of those days (half of it at half time; a reduced day of 35 hours is a full time) — due, the floor it fell under, and below true. Never lifted; the readiness check names the person too (person.below_minimum_wage). A rate by the hour has its own flag (salary.below_minimum_hourly_wage). null for anyone but an employee and for a month computed before round 11b.

child_tax_relief (since 2026-10-28) is what the 2026 child tax relief took off the month's tax base — ЗДБРБ 2026, § 3 of its transitional provisions lets an employee take the ЗДДФЛ чл. 22в and 22г reliefs monthly after handing the employer a written declaration (entered on the employee card in the app): 255.65 / 511.29 / 766.94 for one / two / three or more minor children and 511.29 for each child with a disability, after the чл. 18 relief (disability_relief) and no further than the base. taxable_base and income_tax are already net of it — Д1 т. 31 stays the taxable income, т. 31.А the reduced tax. Applied once a person a month: a person with two contracts at the company shares one amount between them. null for a month with no declaration in force, for every month outside 2026 and for a month computed before 2026-10-28.

salary is null for the ordinary month — one monthly salary in euro all month. Otherwise it is what the month was paid on: basis (monthly, hourly or mixed); segments, one per stretch of the month on one set of terms, each with from, to, effective_from, pay_basis, monthly_salary or hourly_rate, days of month_norm or hours, the amount it earned, its seniority_class, and — agreed in another currency — contract (amount in its currency, rate, rate_date, provisional); the month's hours; minimum_hourly_wage and below_minimum_hourly_wage; and contract — the month-end segment's amount, rate, rate_date, net_pay in the contract currency at that rate, and paid — for a person paid in that currency (pay_in_contract_currency), the amount payable converted at the same rate, the money register.csv and the bank file pay; null otherwise.

department is the department the month recorded — id, name and cost_center as they were when it was computed — or null. payroll_mode is paid, or shadow: a net paid abroad by a foreign employer, with amount_payable 0.00. international is null for a domestic person; otherwise what the month applied: tax_resident, non_resident_tax, tax_treaty_reference, tax_residence_country, and a1 — the certificate (country, certificate_number, valid_from, valid_to) and its hold on the month: covered_days and employed_days (working days), fraction (the share of the month insured in Bulgaria, six decimals), whole_month, and bg_windows (the days insured here, as [first, last] day-of-month pairs) — or null when no certificate touched the month.

late_recovery (since 2026-10-03) is null unless a late болничен's or leave's correction takes salary of a posted month back from the person, now or from an earlier month: debt (what this month's corrections take back, net), carried_in (left from earlier months), withheld (what this month lawfully took of both — after the person's own deductions, at the company's consented_recovery_pace: within the чл. 446 ГПК ceiling, never below one minimum wage, by default), outstanding (carried into the next month), deferred (debt − withheld: positive when the month took back less than it owed, negative when it recovered an earlier month's) and, since round 8, outside — what of withheld was taken outside the ceiling at the net pace (0.00 otherwise). Since round 9 each correction goes at the pace it was confirmed under: a month's takeback is split into what rests on a consent confirmed here and what the company withholds on its own word — the second first, within the ceiling — and what is left keeps its kind into the next month. net_pay keeps the whole takeback; amount_payable is net_pay + deferred less the deductions. The journal entry books deferred on 498 „Други дебитори" against 421 — debit when owed, credit when recovered — and a month whose corrections return more than it pays (the only employee on майчинство) posts its gross, employer contributions, contributions and tax with the sign they have. Since round 10b a shadow month (payroll_mode shadow) owes nothing of a correction of a month the foreign employer paid: what it takes back (the sick days' share of a raise the month pays, which nobody paid) is already out of the net settled through the clearing account, so it is no debt. What a correction of a month paid here leaves a person on the shadow payroll owing is still deferred on 498 — and the clearing account is credited with the net before it (the foreign employer pays it), never 421.

advance_repaid_excess (since round 10b) — one row per advance a repayment in cash applying this month paid back past what the advance still owed: deduction (the advance), repaid (this month's repayments of it) and excess. The excess is the person's (ЗЗД чл. 55, ал. 1 — they paid this advance, ЗЗД чл. 76) and the payroll neither withholds nor pays it: return it the way it was received, or record it against another of the person's debts they name. A sum past what the advance owes when the repayment is recorded is refused then (422 under amount); the excess is found when a month asks less later — a month before it not yet posted takes more of the advance, or the repayment is moved to a later month (which keeps its measure). The run's totals.advance_repaid_excess lists them (person, repaid, excess). Empty when there is none.

termination_recovery (since 2026-10-03) is null unless the month takes a late leaver's confirmed recovery (a pre-tax recovery line of salary paid after the employment ended), a pay cut's, or — since round 8 — a recovery line typed by hand, or one carried from an earlier month: due (what the lines ask this month; carried_in of it from earlier months), withheld (what the month took, pre-tax — the lines' total), cash (what that cost the person in net: counted against the чл. 446 ГПК ceiling, before a late correction's late_recovery, which takes what is left of it), cash_outside (since round 8 — of cash, what the consented lines took outside the ceiling at the net pace), outstanding (carried as a recovery line into the next month the person is paid) and lines (each recovers_period with its due, withheld, outstanding and, since round 8, consented — false for a line typed by hand, an overpaid sum withheld without consent (КТ чл. 272, ал. 1, т. 2), which is taken first and within the ceiling whatever the pace; the earliest month first). The month is computed whatever the recovery asks; the run read's components show each line at what was withheld, with details.due.

deleted_recovery (since round 11) is null unless the month withholds a deleted month's net with the employee's consent (cause deleted_month): due (what the consents still allow this month), withheld (net, off amount_payable — never a line of the month's pay), outside (of withheld, what the net pace took outside the чл. 446 ГПК ceiling) and lines (each recovers_period with its claim, consented, withheld and left). deleted_months (since round 11) is null, or the months the run reverses because its package deletes their records: for_period, gross, employee_contributions, employer_contributions, income_tax and net_pay (the claim). The run's totals list them in deleted_months (employee, person, for_period and the same money) with deleted_months_gross, deleted_months_employee_contributions, deleted_months_employer_contributions, deleted_months_tax, deleted_months_claim and deleted_claim_withheld; posted, the month books Кт 604 the gross, Кт 605 the employer's contributions, Дт 455 both shares, Дт 454 the tax and Дт 498 the claim less what was withheld. Since round 11b a shadow month is among them (paid_abroad true on its entry): its tax and net stay out of deleted_months_tax and deleted_months_claim and go to deleted_months_abroad, booked Дт the clearing account with the foreign employer; its income is declared alone in the next month's package.

deductions — one row per deduction the month withheld: type, category, requested, amount, capped (the limit ran out before the request did), remit (a запор's or an издръжка's creditor, account and reference) and, since round 7, limit — which law limited it, or null (an издръжка, an advance, a voluntary удръжка, and every month computed before round 7): {"basis": "gpk_446", "ceiling": {…}, "measured_on": {…}} — the ГПК ceiling and the pay it was taken from (the net less the month's издръжка) — or, for an nra order, {"basis": "dopk_213", "seizable": {…}, "protected": {…}, "average_wage": {…}, "average_wage_from": "2026-08-12", "average_wage_carried_forward": false} — what it could take at its turn, what the person keeps, and the НСИ figure behind it (carried_forward: a newer release is most likely published and not loaded yet). Since round 8 carried_forward on a row is what an advance leaves for the next month — the month's own advance the pay could not take back whole, or a carried one — and carried_from (YYYY-MM) marks a carried earlier_advance row: the month whose advance it is left of; both null on every other row.

days.maternity_no_benefit (since 2026-10-03) is the part of days.maternity without the right to the обезщетение — a maternity absence with lacks_benefit_stazh: Д1 declares it in т. 16.3, the rest of days.maternity in 16.2. days.sick_no_benefit (since 2026-10-04) is the same of days.sick_noi — a sick absence with lacks_benefit_stazh, no 6 months of стаж, or an incapacity that began while the insurance was interrupted by an unpaid leave past the year's 30 insured working days (then no employer day either): Д1 declares those days in т. 16.4, the rest of days.sick_noi in 16.2. days.paternity_no_benefit (since 2026-10-03) is the same of days.paternity — a paternity absence with lacks_benefit_stazh, no 6 months of стаж.

A self_insured item's days (since 2026-10-03) carry the benefit days of a person insured for ОЗМ by kind, as an employee's do: sick_noi, maternity (with maternity_no_benefit), paternity and childcare, and Д1 puts childcare and maternity_no_benefit in т. 16.3 („Попълва се и за самоосигуряващи се лица" — Н-13). Until then every benefit day was sick_noi, so a самоосигуряващо се лице's отглеждане на дете went to НАП in т. 16.2. insured_without_contributions is still their sum.

days.adoption and days.adoption_paternity (since round 11b) are, of days.maternity, an adoption leave's days (КТ чл. 164б, ал. 1–5) and, of days.paternity, the adoptive father's 15 days (ал. 8) — 0.00 for a month computed before; Д1 counts them with the майчинство's and the бащинство's. days.insured_without_contributions counts every day of стаж without contributions since round 11b: until then an employee's was the ЗЗО т. 5 count, which leaves out the days that carry no т. 5 — the adoptive father's 15 days and a childcare taken under КТ чл. 164а (childcare_taker placed_with / placed_with_spouse, which since round 11b carries no т. 5 ЗЗО either).

funds_to_pension (since 2026-10-06) lists the funds whose contributions this month are фонд „Пенсии"'s because the person chose it instead of a second pillar — upf (КСО чл. 4б, the employee's upf_opt_out_from) and ppf (чл. 4в, ppf_opt_out_from); empty for anyone else. The amounts stay under personal_contributions.funds.upf and the employer's УПФ/ППФ, as Д1 т. 26/25, Д6 т. 12/13 and the ДЗПО transfer keep them.

health_contribution_sick_days is the employer's ЗЗО on the days НОИ pays (ЗЗО чл. 40, ал. 1, т. 5 — 4.80 % of the МОД for the self-insured over НОИ's sick days and the days of a майчинство, бащинство or отглеждане на дете), inside employer_contributions. Since 2026-10-03 it runs on no more than the month's insurable_base leaves of the maximum insurable income (ал. 7 and 8 — the salary first, the order НАП gives the incomes): health_on_noi_base (since 2026-10-03) is the base it was priced on — Д1 т. 17 — and health_on_noi_capped is true when the maximum bound it; a month whose base reaches the maximum owes nothing on those days. health_on_noi_base is null for a month with no such days and for one computed before. Д1's т. 17 is this base (since 2026-10-03, the same day — the file rebuilt it from the days until then and named such a month by a caveat).

health_unpaid_leave (since 2026-10-04) is null, or the health contribution for the days of an unpaid leave — ЗЗО чл. 40, ал. 1, т. 1, б. „б": 8 % of half the МОД for the self-insured over the month's unpaid working days, within what the month's insurable_base and health_on_noi_base leave of the maximum; the employee's own (a leave at their request, КТ чл. 160): base (Д1 т. 27 — of the month's own record for the unpaid days the year's first 30 working days cover, КСО чл. 9, ал. 2, т. 3, where т. 16.5 counts them; since 2026-10-04 the part on the days past them, which interrupt the insurance — КСО чл. 10, ал. 2, the month's record closing and reopening in т. 14/15 — is т. 27 of a separate record with вид осигурен 28, Н-13, Приложение № 1, т. 12), contribution (т. 27 × т. 28 of both, each rounded on its own, in Д6's health box), withheld (inside employee_contributions, and off the tax base — ЗДДФЛ чл. 42, ал. 2) and owed — what the month's pay could not carry, which the employer pays with the month and the employee owes it (the run's totals.unpaid_health_owed, Дт 498 at posting). None for an employee with unpaid_leave_insured_elsewhere. A late correction that lowers a posted month's contribution past what the month withheld lowers that claim by the rest (since 2026-10-04 — a late болничен or leave that interrupts the unpaid leave): unpaid_health_owed on the item's retro entry and on the carry-forward's retro (signed, negative), the run's totals.unpaid_health_owed_corrected (Кт 498 at posting), in the health box of the month's corrective код 5 column, and a sentence on the фиш. employer (since round 10; "0.00" when the employee bears all of it) is the share the EMPLOYER bears — the days of a leave of КТ чл. 167а and of one for production necessity and престой (unpaid_ground, ЗЗО чл. 40, ал. 1, т. 1, б. „б"), by the days: inside employer_contributions_total (605 / 455 at posting), neither withheld nor owed, never off the tax base; the фиш names it under the employer's contributions. A late correction moves it with the employer's side — unpaid_health_employer on the item's retro entry (inside its employer_contributions), declared in the health box of the month's код 5 column.

retro lists what the month pays for other months, one entry per month it is for: for_period, kind — retro (a raise's difference), sick (a late болничен's or leave's correction), chl222 (the contributions on a чл. 222, ал. 1 обезщетение, вид осигурен 27) or chl225 (those on the time without work after an unlawful dismissal, вид осигурен 18) — and gross, insurable_base, employee_contributions, employer_contributions, taxable_base, income_tax and unpaid_health_owed, inside the item's totals and outside its own bases. Since 2026-10-06 a chl222 or chl225 entry also says what time it covers: from and to (YYYY-MM-DD, the part of the month the period takes), days (its working days, Д1 т. 16), capped (true when the maximum insurable income bound the base), employer_funds (the employer's side by fund — pension, upf, and for a chl225 of a person who worked in I/II категория doo_extra and ppf, for a teacher's teacher; the funds add up to employer_contributions; a person born before 1960's upf is the УПФ-sized share inside т. 22А, фонд „Пенсии"'s), and for a chl222 amount (the обезщетение's share of the month, by working days) and employee_funds (what was withheld, by fund — pension, upf); a chl225 has none withheld (employee_funds null) and carries unlawful_dismissal: act_effective_on (the day the act took effect — Д6 т. 18), base_period (YYYY-MM, the month the base was taken from — Д1 т. 12.1–12.3), share (the month's share of the base, not below its МОД) and elsewhere (the insurable income the person declared for the month — insurable_base is what the maximum and it leave of share), stazh_only (true for a month whose maximum the person's own insurance here took whole — the month of return after a reinstatement: insurable_base 0.00, nothing due, its days стаж with no contributions in Д1 т. 16.4 and no код 6 column; since round 6 such a month is filed rather than dropped), and rates (the percentage of each Д1 box: doo_employer т. 22А, upf_employer т. 26А, teacher т. 23, ppf т. 25). Every one of these keys is null on a retro or sick entry. Since round 11 a chl222 entry with the difference for new work at a lower pay also has difference: from (the day the difference runs from), without_work_days and difference_days (the month's working days of each part), new_work_gross, and new_employer_income (the declared income the cap took, null with new_employer_income_missing true when none was declared for a month the difference reaches) — null on every other entry. Since round 10 every entry also has unpaid_health_employer — of employer_contributions, the unpaid-leave health a late correction moved that the employer bears (a leave of КТ чл. 167а, production necessity and престой; "0.00" otherwise) — and returned_ids: the unpaid leaves the employee came back from early that a sick entry corrects its month for (POST /payroll/absences/{id}/return; [] on every other entry), its gross then the salary for the days worked after the return. Since round 11 also unpaid_elsewhere: true on a sick entry that corrects its month for a statement of unpaid leave taken with another employer (PUT /payroll/employees/{id}/unpaid-leave-elsewhere), false on every other.

POST /payroll/runs/{YYYY-MM}/post — posts the month: the journal entry, the НАП obligations, final. 409 run_stale when its inputs changed since it was computed (recompute first), or when an earlier computed month's did — this month's leave pay is priced on that month, so details.period names it: recompute it, then this month — and (round 6) when the month was computed on a retro difference or a late correction priced before the per-box rule of 2026-10-05: the post marks it stale, and computing it again prices the row anew; 409 run_computing while a computation you asked for is still queued or running; 409 period_posted when it is already posted (after a lost response, read the month); 409 period_locked when the accounting period is closed; 409 ledger_account_missing when the company's chart of accounts lacks an account the entry needs (details.accounts — add it in the app, then post again); 409 post_refused when the payroll itself refuses the month (details.reason).

GET /payroll/runs/{YYYY-MM}/payslips/{employee}.pdf?locale=bg|en — one фиш за заплата, in Bulgarian (the default) or English, bytes per §4. A граждански договор has no фиш: 422 not_a_payslip, whose details.smetka and details.acceptance_protocol are the paths of its two papers below (smetka is null where чл. 45, ал. 8 cancels it).

GET /payroll/runs/{YYYY-MM}/smetka/{employee}.pdf?locale=bg|en — a граждански договор's сметка за изплатени суми (ЗДДФЛ чл. 45, ал. 4), the document the app prints: the fee, the нормативно признати разходи, the contributions and the tax withheld, the amount paid. Bytes per §4. 422 not_civil_contract for anybody else — their month has a фиш; 409 smetka_not_issued (details.reason: self_insured_declaration) for a month paid under a чл. 43, ал. 5 declaration, for which чл. 45, ал. 8 issues no сметка.

GET /payroll/runs/{YYYY-MM}/acceptance-protocol/{employee}.pdf?locale=bg|en — the приемо-предавателен протокол that goes with every civil-contract payment: the month's work handed over and accepted without remarks, and the agreed fee due. It names the contract by the employee's civil_contract_number, civil_contract_date and civil_contract_subject (Employees, above) and leaves out what is not set; it is dated the day the fee was paid through the bank, or else the last day of the month, and placed in the company's seat town. Issued for every civil contract — a самоосигуряващо се лице's too: accepting work is contract law, not tax. 422 not_civil_contract for anybody else. Bytes per §4.

Both follow the payslip's rules for the month: 404 not_found for a month nothing was computed or asked for, or an employee not on it.

GET /payroll/runs/{YYYY-MM}/register.csv?locale=bg|en — the ведомост as a file, and the month's payment list. UTF-8 with a BOM, semicolon-separated, amounts as plain decimals with a point. One wage row per person — days, gross, the employee's contributions per fund, the employer's, the tax, net, deductions, amount payable — and one remittance row per amount withheld for somebody else (a запор, an издръжка). Every row with a pay_amount is one transfer to pay_to_iban with pay_reference: the employee's own IBAN, whole, on a wage row; the creditor's account on a remittance row. A wage row whose person has no IBAN on file, and a remittance row with no account, carry no pay_amount — the sum is still in amount_payable, paid by other means. The ЕГН is masked to its last four digits. A shadow payroll's wage row — its net paid abroad — carries its figures, an amount_payable of 0.00 and no transfer.

The header row is the columns' names, the same in every locale — read the file by them; ?locale changes the words in the rows (the deduction's name), never the header. In this order:

Column On a wage row On a remittance row
row wage remittance
employee_id, external_id, name, identifier, type the employee: our id, yours, the name, the ЕГН masked to its last four digits, the relationship the same, of the employee it was withheld from
days_worked, days_paid_leave, days_sick, days_unpaid the month's days (sick = employer's + НОИ's) empty
gross брутно empty
fund_pension, fund_upf, fund_ozm, fund_unemployment, fund_health the employee's contributions per fund — for a person born before 1960, who has no second pillar, the УПФ-sized share is фонд „Пенсии"'s and is in fund_pension, as Д1/Д6 declare it (fund_upf empty). Since 2026-10-06 everything the month withheld, so they add up to personal_contributions: also what a retro line withheld for the months it is for (a raise's difference, a late correction, a чл. 222, ал. 1 обезщетение's employee share) and the unpaid-leave health contribution (in fund_health) — until then the month's own funds only, as the year to date never was empty
personal_contributions, employer_contributions the two totals empty
taxable_base, income_tax, net_pay данъчна основа, ДДФЛ, net empty
deductions_total, amount_payable withheld for others; what the person receives empty
deduction, creditor empty the deduction's name; the creditor of an order
pay_to_iban, pay_amount, pay_reference the transfer to the employee, or empty the transfer to the creditor, or empty
department, cost_center the department the month recorded and its cost centre, as they were (for a month computed before months recorded them, the person's current ones) the same
reimbursements, non_cash_income paid with the wage but not pay (inside amount_payable); income in kind, taxed but never paid empty
pay_currency, pay_rate, pay_rate_date the currency of pay_amount — EUR, or the contract's for a person paid in it (pay_in_contract_currency), with the ECB rate the amount payable was converted at and its day EUR for a transfer; the rate empty
manual_adjustments the figures moved by hand this month, as text („income_tax +10.00") empty
fund_upf_to_pension of fund_upf, what is фонд „Пенсии"'s because the person chose it instead of УПФ (the employee's upf_opt_out_from, КСО чл. 4б): all of it in a month the choice covers, 0.00 otherwise, empty with no УПФ share. fund_upf keeps it — Д1 т. 26, Д6 т. 12 and the ДЗПО transfer do empty
child_tax_relief what the 2026 child tax relief took off the tax base (the run item's child_tax_relief) — already inside taxable_base; empty for a person with no declaration in force empty

Amounts are plain decimals with a point, empty where they do not apply; a pay_amount in another currency has that currency's minor unit. department, cost_center, reimbursements, non_cash_income, pay_currency, pay_rate and pay_rate_date were appended after pay_reference, and manual_adjustments, (since 2026-10-06) fund_upf_to_pension and (since 2026-10-28) child_tax_relief after them, so a program reading the earlier columns by position still finds them where they were. Like every report CSV below, register.csv takes ?columns= and ?header= (see „Reports").

GET /payroll/runs/{YYYY-MM}/obligations — what the month owes НАП (ДОО, здравно, ДЗПО, ДДФЛ, each самоосигуряващо се лице's own), each with its amount, due date and budget IBAN. A posted month answers the obligations as they stand, with their ids, and — beside them — the quarter's чл. 43 tax on граждански договори (kind ddfl_civil, period 2026-Q3), as the run page shows it; a computed one, "status": "preview" rows of what posting will create.

{ "id": "01k…", "kind": "contributions", "fund": "doo", "employee": null,
  "period": "2026-10", "label": "Осигуровки ДОО",
  "amount": { "amount": "1234.56", "currency": "EUR" }, "due_on": "2026-11-25",
  "iban": "BG97BNBG96618000112001", "status": "pending",
  "paid_on": null, "paid_amount": null, "reference": null,
  "employer_blocked": false, "payment_in_progress": false }

label is the row's name as a bank order prints it (Bulgarian, whatever the locale); employee names the самоосигуряващо се лице whose own contributions a self_insured row is — the задължено лице on that order is the person, by ЕГН; payment_in_progress says a bank order for the row is already open in the app.

POST /payroll/obligations/{id}/paid — the money left from outside Autonify (your own treasury, the customer's online banking), and you say so. The app's own „Платено", through the same writer and with the same fields:

curl -X POST https://app.autonify.bg/api/v1/payroll/obligations/01k…/paid \
  -H "Authorization: Bearer $AUTONIFY_KEY" \
  -H "Idempotency-Key: treasury-2026-10-doo" \
  -H "Content-Type: application/json" \
  -d '{ "paid_on": "2026-11-24", "paid_amount": "1234.56", "reference": "MT103-4471" }'

paid_on is required (YYYY-MM-DD); paid_amount left out is the row's whole amount, less than it leaves the row partial; reference (≤ 120 characters) is the payment's own reference. 200 with the row as the list shows it. A row already marked may be marked again — the latest mark is its paid facts, which is how a wrong date or amount is corrected, as in the app. Only the payroll's own obligations are reached (the month's ДДФЛ, contributions and самоосигуряване, the quarter's чл. 43 tax): any other id is 404 not_found. While a bank order for the row is open in the app — the „Плащания към НАП" switch's, or a person's — the mark is 409 obligation_payment_in_progress (details.payment_status): the order would pay it a second time. Marking paid records a fact: it moves no money and posts nothing to the books.

A stale month's payslips, сметки, protocols, ведомост and obligations are 409 run_stale: they would carry the figures from before your change. A month nothing was computed or asked for is 404 not_found.

The Д1/Д6 files of a computed month are a filing like any other: GET /filings?kind=d1_d6&period=2026-10 and its files — which needs filings:read on the key and in the contract, and payroll:read for its files: they carry every person's full ЕГН. Read the filing's ready_to_submit and caveats before filing it, and its stale — a stale month's Д1/Д6 files are 409 run_stale too. A month recomputed AFTER its Д1/Д6 was submitted fires filing.superseded and reports correction_required: true. A month that corrects a month of another year (the code-6 columns and corrective records above, a late leaver, a late sick leave) carries an EMPL2021.TXT and a NRA62007.TXT per year — year on /files tells them apart, and each year's pair is filed on its own.

Built for many entities — approval, payslips, the ЕТЗ through НАП

Four options for a group running many entities. Every one is off until the company switches it on, and a company that switches nothing on works exactly as described above.

GET /payroll/settings/enterprise — the four switches:

{ "data": { "payroll_requires_approval": false, "pay_acts_require_approval": false,
            "payslip_delivery": false, "etz_auto_submit": false } }

PATCH /payroll/settings/enterprise — any of the four, booleans; an unknown field is 422. Only a key whose person is an owner or admin of the account that owns the company may move them — anybody else is 403 settings_owner_only: a key may use the second-person rule, never switch it off for itself. meta.changed says whether anything moved.

A second person before a month is posted (payroll_requires_approval). A computed month is submitted for approval and approved by somebody other than whoever computed or submitted it — the person is the key's — and only then posted. Until it is approved, POST …/post answers 409 approval_required, the bank file (which needs a posted month) is not made, and the month's Д1/Д6 files are held (GET /filings/{id}/files/{fileId} answers 409 approval_required for them). An approval belongs to one computation: a month computed again (run.generation moves) has to be submitted and approved again. run.approval on GET /payroll/runs/{YYYY-MM} is the step: not_required (the default), not_submitted, submitted, approved or posted.

  • GET /payroll/runs/{YYYY-MM}/approval — state, required, stale, generation, who computed_by (null when the API's queue computed it), submitted, approved and posted (each {id, name, at} or null), the note of a returned month, can — what this key's person may do now (submit, approve, return, post) — and, since 2026-10-30, may_approve: whether the person's team seat includes approving payroll at all (owners and admins always; a staff seat when the account gave it the right). Without it can.approve and can.return are false and the two POSTs answer 403 team_access.
  • POST /payroll/runs/{YYYY-MM}/approval/submit — empty body.
  • POST /payroll/runs/{YYYY-MM}/approval/approve — empty body; by another person.
  • POST /payroll/runs/{YYYY-MM}/approval/return — {"note": "…"} (optional, up to 500 characters): back to computed, approval withdrawn.

Each answers the approval as GET …/approval does. Refusals are 409 with a stable code: approval_off (the company does not ask for a second person), approval_not_submitted, approval_same_person, approval_already_given, run_stale, period_posted.

A second person before a pay act is applied (pay_acts_require_approval): POST /payroll/pay-acts/{id}/approve (empty body, by somebody other than whoever recorded the act) answers the act with approved_at and approved_by. Until then POST /payroll/pay-acts/{id}/apply is 409 approval_required. A change of what the act raises, or of whom, takes the approval away.

GET /payroll/runs/{YYYY-MM}/payslips.zip?locale=bg|en — every фиш of the month in one ZIP: one PDF per employee or ДУК, named by your external_id (characters other than letters, digits, ., _, - become _; our employee id where there is none). A граждански договор has no фиш and is not in it. Priced as a list read. A stale month is 409 run_stale. Up to 250 payslips are rendered inside the request (about 30 seconds); a bigger month answers 409 payslips_async_required (details.payslips, details.sync_up_to) — ask for it as an archive instead (below).

POST /payroll/runs/{YYYY-MM}/payslip-archives — the same ZIP for any number of people, built in the background. Body (optional): {"locale": "bg" | "en"} (Bulgarian when absent; any other field is 422). Answers 202 with the archive resource and a Location header pointing at it:

{"data": {"id": "01k…", "status": "queued", "period": "2026-09", "locale": "en",
  "total": 1840, "done": 0, "progress": 0, "files": null, "bytes": null,
  "error_code": null, "run_generation": 3, "run_status": "computed",
  "created_at": "2026-10-03T07:10:12+00:00", "finished_at": null,
  "expires_at": null, "download_url": null}}

GET /payroll/payslip-archives/{id} — poll it (every few seconds is plenty; the payslips are rendered at roughly ten a second per worker, several workers side by side). status goes queued → building → ready, or failed with an error_code: run_recomputed (the month was computed again while it was built — ask again), build_failed (rendering failed) or build_lost (the build stopped and never came back — ask again). Once ready, download_url is a signed address that needs no key — hand it to whatever downloads the file — valid until expires_at, a day after the archive was ready; after that the archive reads expired and the file is gone. It answers only while the key that read it still may read the company's payroll: revoked, expired, its person's seat stopped, the company out of its reach or the account suspended, the address answers 403 download_key_unusable — read the archive again with a working key. An archive of an earlier computation of the month — the month was computed again after it was asked for — reads superseded, has no download_url and is never handed over: ask for a new one (the nightly sweep then expires it with error_code: superseded). Asking again for the same month, language and computation while an archive is queued, building or ready answers that archive instead of building another. The archive belongs to the company: any of its keys with payroll:read may poll it. The same refusals as the sync route: a month not computed is 404 not_found, a stale one 409 run_stale, a month with nobody on a фиш 404 not_found. The files are named as in the sync ZIP, -en added for English.

The signed download answers in the same error shape as every other route: an address altered or past its time is 403 invalid_signature; one of an archive since superseded is 404 archive_superseded; one expired, swept or never ready is 404 not_found.

Payslip delivery (payslip_delivery) is the app's: after posting, the payroll team sends each person with an email a link that lives seven days — never the PDF — and the page behind it asks for the last four digits of the person's ЕГН/ЛНЧ before it hands the фиш over. Nothing is sent unless the company switched it on and somebody pressed „Send".

POST /payroll/employment-register/{YYYY-MM}/submit — a package of електронни трудови записи submitted to НАП through its declarations API (service type DEC_ETZ62). Fetch the package's XML (GET …/employment-register/{YYYY-MM}/xml), sign it with the person's КЕП as a detached PKCS#7 over those exact bytes, and send:

{ "signature": "<base64 of the detached PKCS#7>",
  "certificate": "<base64 of the DER certificate, or its PEM>",
  "user_pin": "8001010000", "user_pin_type": "IND_EGN" }

{YYYY-MM} is the package's period — 2026-10, or 2026-10-2 for a follow-up. We check what the app's own button checks: the XML is the one generated for the package, the signature verifies over it and is the certificate's, and an earlier attempt whose answer was lost holds this one back. The answer is the submission (status, environment, entry_number, entry_date) and the package's package_status — submitted once НАП's production environment gave it an entry number, which is what makes its records filed. payroll.employment_records.submitted follows (§9).

  • 409 nra_route_disabled — the company files through НАП's portal: the API route (automation.auto_submit_filings, the same switch as Д1/Д6) is off.
  • 409 employment_register_xml_blocked — the package has no XML yet.
  • 409 submission_refused — refused before anything reached НАП (unless details.reason is outcome_unknown): signature_invalid, signer_mismatch, file_mismatch, certificate_unreadable, no_key, key_expired, outcome_unknown_pending, not_configured, …, and already_submitted — the package is already filed, or these very bytes already went to НАП in this environment and have an entry number. A package is sent once: a retry under a new Idempotency-Key does not send it again. Since 2026-11-07 also pin_not_signer — the certificate carries a personal number (PNOBG-…) and user_pin (IND_EGN) is not it — send_in_progress (the same package is being sent right now, from the app or another call) and rate_limited (the company's НАП key is paused, or its allowance for the minute is spent: try again later).
  • 502 nra_refused — НАП refused it; details carries its own answer.

With etz_auto_submit on, a package whose XML a person signed in the app is submitted by itself within the hour, under the ЕГН inside the signer's certificate, and the payroll team hears about a package still unsent on the day before it is due.

POST /payroll/runs/{YYYY-MM}/nra-submissions (since 2026-11-07) — the month's Д1/Д6 submitted to НАП through its declarations API (service type DEC_1_6), as the app's run page submits them. Fetch the month's EMPL2021.TXT and NRA62007.TXT (GET /filings/{id}/files, a d1_d6 filing), sign each with the person's КЕП as a detached PKCS#7 over those exact bytes, and send:

{ "year": 2026, "part": null,
  "files": [{ "name": "EMPL2021.TXT", "signature": "<base64 of the detached PKCS#7>" },
            { "name": "NRA62007.TXT", "signature": "<base64>" }],
  "certificate": "<base64 of the DER certificate, or its PEM>",
  "user_pin": "8001010000", "user_pin_type": "IND_EGN" }

The bytes that reach НАП are the files the app generated, read by name, year and part — never bytes you send. year is needed only for a month that corrects another year (its files come a pair per year, one year per submission), part only for a year filed in parts (past НАП's 15 MB a file); send every file of that year or part, the Д1 and the Д6 together. We check what the run page checks: each signature verifies over those bytes and is the certificate's, user_pin is the personal number inside the certificate when it carries one, an earlier attempt whose answer was lost holds the year back, a stale or unapproved month holds the files. The answer is 201 with the submission (status, environment, year, part, entry_number, entry_date), the filing's filing_status — submitted once НАП's production environment gave every year (and part) of the month an entry number — and its nra_incoming_number. payroll.declarations.submitted follows (§9); НАП's verdict is read with GET …/nra-submissions below.

  • 409 nra_route_disabled — the API route (automation.auto_submit_filings) is off, as for the ЕТЗ above.
  • 409 submission_refused — nothing reached НАП (unless details.reason is outcome_unknown), the run page's reasons, among them: filed_already — in production the month is already recorded as filed, through this API or through НАП's portal (a submitted status recorded on the filing), and a second regular Д1/Д6 for it would duplicate it; a change is filed as a correction, which this API does not make. The one exception is a year (or part) whose submission a person marked rejected (…/rejected, below), which goes again; already_submitted — these very bytes already went to НАП's production environment and have an entry number; send_in_progress — the month is being sent right now, from the app or another call; rate_limited — the company's НАП key is paused (НАП limited it, or did not answer) or its allowance for the minute is spent, until details.retry_at; and pin_not_signer, signature_invalid, signer_mismatch, file_mismatch, run_stale, approval_required, verdict_needed, part_declares_again, outcome_unknown_pending, no_key, key_expired, not_configured. In the test environment a month is never refused as filed, nor the same bytes as sent: rehearsing them is what it is for.
  • 422 validation_failed — an unknown key (there is no resend flag, and no corrective re-send), a file the month does not carry for that year and part, half of a year's pair, a year or part the month needs and was not given.
  • 502 nra_refused — НАП refused it; details carries its own answer (http_status, nra_error_code, nra_message, and retry_after in seconds for a 429).

GET /payroll/runs/{YYYY-MM}/nra-submissions (since 2026-10-17) — the month's Д1/Д6 submissions to НАП, newest first, each with the year it declared — and the part, of a year filed in parts — its entry_number and entry_date, its people (whom its Д1 declared), status (submitted, result_available, rejected, failed, unknown), result_available, verdict (null, or { "by": "person" | "filing", "source": "result" | "portal" | null, "recorded_at" }), result_overdue, and whether a verdict may be recorded on it (rejectable) or taken back (withdrawable). meta carries the filing's filing_id, filing_status and nra_verdict_needed (as on GET /filings). 404 not_found for a month with no Д1/Д6.

POST /payroll/runs/{YYYY-MM}/nra-submissions/{id}/rejected — НАП rejected this submission: what a person reads in НАП's processing result, the app's „НАП отхвърли". НАП answers in HTML only and we read no verdict from it, so the verdict is the key's person's, recorded with who and when. The body names the submission's entry_number — { "entry_number": "30Е000000801" } — and a number that is not the submission's is refused with nothing recorded (422 entry_number_mismatch, which says only that the number differs, never which it is — read it from the list), so that a verdict lands on the declaration НАП rejected and not on its neighbour. A rejected submission declared nothing: the year it carried is prepared again, or its part sent again, and a month that waits for НАП's verdict (nra_verdict_needed) may go on. Recorded only:

  • on a submission whose result was fetched (result_available) — or, when НАП gave none 7 days after the submission (result_overdue), on what the person reads in НАП's portal, recorded so (verdict.source: "portal"); before that 409 verdict_needs_result, and the same request succeeds once either holds;
  • on a production submission that went to НАП and counts: 409 not_rejectable for one sent to НАП's test environment, refused by it, with its answer lost, or already rejected.

DELETE /payroll/runs/{YYYY-MM}/nra-submissions/{id}/rejected — the verdict taken back, the app's „Не е отхвърлена": the submission counts again as it went. Name its entry_number (in the query, ?entry_number=…, or the body). Only while nothing of that year — or that part of it — went to НАП since, and the files it sent are still the filing's (a month prepared again holds other files): 409 verdict_final otherwise. Either answer is the submission as GET …/nra-submissions lists it, with meta.nra_verdict_needed; a 409 carries it in details.submission.

GET /payroll/runs/{YYYY-MM}/nra-submissions/{id}/explanation (since 2026-11-08) — НАП's answer to one of the month's Д1/Д6 submissions, explained line by line, as the app shows it beside „Резултат (HTML)" on the run page: what each line means, what to do and the rule it rests on, in ?locale=bg|en (Bulgarian when absent; anything else is 422 validation_failed). A read of one, like the list of submissions above.

{ "data": {
    "submission": { "id": "01k…", "entry_number": "30Е000000006", "status": "result_available", "channel": "d1d6" },
    "result_available": true,
    "counts": [ { "form": "1", "submitted": 2, "accepted": 0, "rejected": 2 },
                { "form": "6", "submitted": 1, "accepted": 0, "rejected": 1 } ],
    "etz_counts": null,
    "lines": [ { "index": 2,
        "text": "Декларация обр.1: Ред :2 Период : 12.2022 … ЕГН:••••••0008 Валидация:100 :Недопустим праг на осигурителния доход (1)",
        "kind": "problem", "entry": "d1.mod_threshold",
        "title": "The insurable income is below the minimum",
        "meaning": "The NRA compares the insurable income (point 21) with the minimum …",
        "fix": "Check the КИД activity code in the payroll settings …",
        "basis": "The State Social Security Budget Act for the declaration's year …",
        "verified": true, "source": "nra_mock",
        "params": { "form": "1", "row": "2", "period": "12.2022" },
        "fields": [ { "id": "d1.12_1", "text": "Point 12.1 — the occupation's qualification group …" } ],
        "repeat": 1 } ],
    "refusal": null, "truncated": false },
  "meta": { "period": "2026-10", "filing_id": "01k…", "locale": "en" } }
  • lines — НАП's processing result, one entry per line, in order. text is НАП's own words — whitespace collapsed and every run of ten or more digits masked to bullets and its last four: no ЕГН travels back. kind is problem, notice, info or unknown (nothing explains the line yet — quote it to support), or summary, context and boilerplate: НАП's counts, headings and fixed text, with no title, meaning or fix. entry names the explanation; basis the rule or source it rests on, and verified is false where НАП's wording is not read in a primary source. params are the values the line carries — form, row, period, code, and person, the surname and initials of the person the line is about, read from the file that went — masked as text is. fields are the Д1/Д6 points the line names, { "id", "text" }. repeat counts identical lines folded into one.
  • counts — НАП's own figures per form (submitted, accepted, rejected), as НАП wrote them. Nothing here is a verdict: a line saying НАП refused a declaration marks nothing rejected — the verdict stays a person's (…/rejected, above).
  • refusal — НАП's refusal of the request itself, for a submission that failed: НАП's message as text, params.code (НАП's error code, or HTTP_<status>), params.exception_id (the id to quote to НАП's help desk) and params.details; its fix is the very sentence the app shows for that refusal. null otherwise.
  • An answer lost on the way (status: unknown) is not a refusal: refusal is null, and the first line (entry: api.outcome_unknown) says that НАП may have registered the declaration — look in НАП's portal before sending it again. Once a person has recorded in the app what they found there, it is lost no more: a submission they found is explained by НАП's result alone (no lines until it is fetched), and one they did not find — status: failed, though НАП refused nothing — has one info line (entry: api.outcome_unknown, params.resolution: not_received) saying so, and refusal stays null.
  • truncated — the result had more than 2,000 lines; the first 2,000 are explained.

Computed from what is stored every time; nothing is written. Д1/Д6 only — an ЕТЗ package's protocol is explained in the app. 404 not_found for a month with no Д1/Д6, or a submission that is not one of its; 422 validation_failed for a period that is not YYYY-MM.

Reports

The reports the app's run page and year page offer, from the same code — a file downloaded in the app and the same file fetched here are the same rows. A month's report needs a month that may be read as documents: 404 not_found when nothing was computed, 409 run_stale when its inputs changed since. The bank file and the journal file also need the month posted: 409 run_not_posted.

Every report CSV is the ведомост's format (UTF-8 with a BOM, ;, CRLF, amounts as plain decimals with a point) and takes three parameters:

  • ?columns=a,b,c — only these columns, in this order. The names are the columns listed for each report below. An unknown name is refused, 422 validation_failed with details.unknown and details.available — a misspelt pay_amount silently dropped would be a payment list without its amounts.
  • ?header=names|labels — the header row: the columns' names (the default, what a program reads) or their names in words, in ?locale's language.
  • ?locale=bg|en — the words in the rows (and the labels).

The JSON variants carry one object per row, keyed by the same column names, money as money objects (§4).

GET /payroll/runs/{YYYY-MM}/bank-file.xml — the month's wages and запор/издръжка remittances as a SEPA credit transfer file: ISO 20022 pain.001.001.03, the format every Bulgarian bank's online banking takes as a bulk-payment upload. Nothing is sent: you upload the file at the bank and authorise it there. Its transfers are register.csv's rows with a pay_amount — each person's amount_payable to their IBAN, each remittance to the account on its order — in two payment blocks: wages under category purpose SALA (booked as one debit), remittances without it. Left out, and counted in X-Autonify-Excluded: a person with no IBAN on file, an order with no account, an account that is not a valid IBAN, and a remittance to a budget account (a ДСИ, НАП) — that one needs the budget payment form, which a SEPA transfer cannot carry. Names and remittance texts are transliterated by the official Bulgarian system (Закон за транслитерацията) into the EPC character set; names are cut at 70 characters, texts at 140, identifiers at 35. A bank's BIC is written only where it is known — the BIC БНБ's register of БАЕ codes lists for the IBAN's bank code (usually the code followed by BGSF, but not always: Изипей's is ESPYBGS1, БНБ's own BNBGBGSF — and BNBGBGSD for a budget revenue account at БНБ, type 8x, the BIC НАП publishes beside its accounts); any other debtor bank is NOTPROVIDED and any other payee bank is left to its IBAN (SEPA routes by the IBAN). The same payment fetched twice carries the same MsgId (a digest of the month, the account, the date and every transfer), so a bank that refuses a message it has already received refuses the second upload rather than paying the wages twice; another date or account is another message.

A person paid in their contract's currency (pay_in_contract_currency) is paid in a payment block of its own per currency, still a salary batch (SALA), debited from a company account in that currency, with the amount in the currency's minor unit. Such a transfer is not a SEPA credit transfer: its block names no SvcLvl and its charges are shared (ChrgBr SHAR, where a euro block says SLEV). The euro blocks are unchanged, and a month with nobody paid in another currency is the same file it always was. A currency the company holds no active account in leaves its people out, counted in X-Autonify-Excluded (reason no_currency_account, on the run page with the currency). The group header's CtrlSum is every amount of the message, currencies together.

  • ?debtor_account= — the account to pay from: one of the company's active euro bank accounts with an IBAN (the app's Banking page), or, when it has none, the IBAN on the company profile as profile. Required when there is more than one: 422 debtor_account_required lists them in details.accounts (id, name, masked IBAN).
  • ?debtor_accounts[USD]= — the account each other currency is paid from, one parameter per currency; required when the company holds more than one in it (422 debtor_account_required with details.currency and details.accounts).
  • ?execution_date=YYYY-MM-DD — from today (Europe/Sofia) to a year ahead; by default today, or the next business day.
  • A shadow payroll's wage is not in the file: its net is paid abroad, and its register row carries no transfer.
  • Answers X-Autonify-Transfers (how many) and X-Autonify-Total (the euro ones' sum) beside the file — and, when another currency is paid, X-Autonify-Totals (EUR=3966.71;USD=2387.66). 409 no_debtor_account when the company has no euro account with an IBAN; 409 nothing_to_pay when no row can be paid by transfer; 422 unknown_debtor_account; 422 execution_date_invalid.

GET /payroll/runs/{YYYY-MM}/budget-payments.{format} — „платежни нареждания": the posted month's payments to НАП still owed, one row per obligation, with everything a платежно нареждане за плащане от/към бюджета asks for (the joint instruction of the МФ and БНБ ДДС № 03/25.06.2025, т. 10–14). csv (the house CSV — ?columns=, ?header=, ?locale= as every report) or xlsx. Columns: obligation_id (what POST /payroll/obligations/{id}/paid takes), obligation_kind, obligation_label, payee (НАП), payee_iban, payment_type_code (empty: НАП's accounts are type 80, and the код за вид плащане is filled only for a type-84 municipal account — т. 10.7), amount (what remains to pay), currency, basis (the основание, ≤ 35 characters: the row's name and its period — the form has no period field of its own, and the instruction puts the period in the основание, т. 13.1), period, period_from, period_to (for a bank whose own format still asks for them), obligor_name, obligor_id_type (EIK, EGN or LNC, the instruction's own names; empty, with obligor_id, for a person with no number on file — never the company's in its place), obligor_id, due_on, obligation_status, employer_blocked. The quarter's чл. 43 tax rides beside the month; a row already paid is left out, one paid in part carries what remains.

The задължено лице is the company by its ЕИК for what it owes as работодател and осигурител, and a самоосигуряващо се лице by their own full ЕГН (ЛНЧ when the number is one) for their own contributions — the number the bank form needs, so this file is payroll data at its most sensitive: it needs payroll:read, and every fetch is recorded on the company's audit chain (the size, the month and the key — never the content).

The list is not itself a bank upload file. The budget form's fields are fixed, but each Bulgarian bank takes budget payments in its own upload format, and there is no bank-independent pain.001 for them to build against — so the same rows in a bank's own format are the next endpoint, for the banks that publish one; and never inside bank-file.xml, whose SALA batch is wages only. Pay the rows at the bank (or from your treasury), then mark each one paid. 409 run_not_posted for a month not posted yet.

GET /payroll/runs/{YYYY-MM}/budget-payments/bank-file?format=… — the same payments to НАП as a bank's own upload file, built field by field from the format the bank publishes for a платежно нареждане за плащане от/към бюджета. Nothing is sent: the file is uploaded in the bank's e-banking, where every payment becomes a budget order to be signed there. Check the first upload in the bank's preview before you sign it — the format is the bank's, and the bank has the last word on it. ?format= is required:

format Bank The file The bank's own spec
ubb_iban313 ОББ „Импорт на файл", operation IBAN313: one line per payment, | after every field (TRANSID to LNC), windows-1251 („ANSI"), CR LF. It names no payer account: you pick it when importing. faqImportBG_v16042026_Reg1113.pdf, edition of 16.04.2026 (archived English edition)
postbank_obp Пощенска банка (Юробанк България) Масово плащане от/към бюджета: an OBP;BP header and one twenty-field BP record per payment, every field closed by ;, windows-1251 and CR LF (the spec names neither — that is the assumption to check). Every record carries the execution date (field 20); the header carries the day the file is made, which the bank wants no earlier than its accounting day: upload it the same day. Formatmasspayments01012026.pdf, section 4, edition of 01.01.2026
ing_mt100 ING Bank MT100 with the Bulgarian Budgetary Payment block (:72:/DTYPE/BUDJ, /DOC/NUM, /PERIOD/, /EIK/ · /EGN/ · /LNC/, /IZL/), UTF-8, CR LF, every payment's :32A: carrying the execution date. InsideBusiness Payments Bulgaria — Annex to the User Guide, January 2026; MT100 usage guide, version 10, August 2026

?debtor_account= names the account the money leaves from, for the formats that name one (postbank_obp, ing_mt100) when the company keeps several euro accounts at that bank: 409 no_debtor_account when it keeps none there (details.bank), 422 debtor_account_required with details.accounts, 422 unknown_debtor_account. A format not on the list, or none: 422 validation_failed with details.formats.

?execution_date=YYYY-MM-DD is the day the payments are to be executed, for a format that has a field for it — by default the next banking day (today, when today is one; a Saturday's file is Monday's), never in the past, and no later than the bank takes: ing_mt100 sixty days („system date + 60 days" in its annex), postbank_obp a year (its spec names no limit — the SEPA wage file's reach). The day the file says comes back in X-Autonify-Execution-Date. Outside those bounds, or not a date: 422 execution_date_invalid with details.today and details.latest. ubb_iban313 has no execution-date field — its orders are dated in ОББ's e-banking, where they are signed — so a date asked of it is 422 execution_date_unsupported rather than dropped, and its answer carries no X-Autonify-Execution-Date. The file's reference (ING's :01:) is a digest of what it pays and on which day: the same payments on another day are another file.

Every format writes the задължено лице by the kind of number they hold — the company by ЕИК, a самоосигуряващо се лице by ЕГН, or by ЛНЧ when they declared one — in exactly one of the format's slots; the document type „1 Декларация" (a declared instalment „4 Авансова вноска", as the PSD2 rail writes it), never a document number, which this app does not hold; and the period's first and last day where the format has them. Where a format names the payee's bank — ОББ's BIC_R, Пощенска банка's bank name, ING's own SWIFT in the file header — it is written as БНБ's register of БАЕ codes lists it, except that НАП's accounts (БНБ, budget revenue accounts of type 8x) are reached by BNBGBGSD, the BIC НАП publishes beside them and ОББ's own bulk example writes for one; the bank's name is „Българска народна банка".

A payment a file cannot carry is left out and named, never written with a guessed value: X-Autonify-Excluded counts them and X-Autonify-Excluded-Obligations lists obligation_id=reason — employer_blocked (the employer's share could not be computed, so the sum is short), no_iban, invalid_iban, not_euro, no_identifier (a person with no ЕГН or ЛНЧ on file: an order to an 8x account needs exactly one), invalid_identifier (an ЕИК or ЕГН failing its control digit, a ЛНЧ that is not ten digits — the check the bank makes), and a format's own no_bic, unknown_bank, amount_too_large. X-Autonify-Format, X-Autonify-Payments and X-Autonify-Total describe the file. Nothing left to carry: 409 nothing_to_pay with details.excluded. The same payroll:read and the same record on the audit chain as the list. The run page remembers the bank last downloaded for the company; the API never changes that — name your format every time.

The banks that are not here, and why (checked 03.10.2026): ДСК, УниКредит Булбанк and БАКБ publish no format (ДСК describes its own — MT103BUDJ and pain.001 among them — inside its e-banking only); Fibank's published budget format is the input to its own converter program; Алианц Банк's only manual predates the euro and asks a код за вид плащане for every 8x account, which НАП's accounts no longer take; ЦКБ publishes an Excel template and a TXT sample that disagree with each other; and no bank publishes the ДДС № 03/2025 т. 14 Ultimate Debtor coding for a customer's own pain.001 (ING's XML for budget payments names no message version). For those, pay from the list.

GET /payroll/runs/{YYYY-MM}/gl and /gl.csv — the posted journal entry of the month, one row per line: entry_number, entry_date, period, line, account_code, account_name (the chart's name in ?locale), debit, credit, currency, description, entry_description, journal_entry_id, department, cost_center. Debits equal credits; the JSON's meta.total_debit and meta.total_credit say so. The expense lines — 604, 602, 605 and a pay line's own account (609) — are one line per department and cost centre, the month's department in department and cost_center (blank for the people with none), which is where the ledger's own dimensions carry it; the liabilities — 421, 499, 454, 455 — are one line each. A company with no departments gets one line per account, as before. A shadow payroll's nets are credited to the clearing account (Payroll settings).

GET /payroll/runs/{YYYY-MM}/cost and /cost.csv — cost to company, per person: employee_id, external_id, name, identifier, department, cost_center, type, gross, the employer's contributions fund by fund (employer_pension, employer_ozm, employer_unemployment, employer_tzpb, employer_upf, employer_ppf, employer_teacher, employer_health), employer_contributions and total_cost = gross + employer contributions. The funds add up to the total the month booked; summed over the people, the total cost is the entry's Дт 604 + 602 + 605. A самоосигуряващо се лице is not on it (its contributions are its own). What the month pays for other months — the run item's retro entries: a чл. 222, ал. 1 обезщетение's contributions (вид осигурен 27), those on the time without work after an unlawful dismissal (вид осигурен 18), a raise's difference, a late correction — is in its own funds since 2026-10-06 (employer_pension and employer_upf for a 27; also employer_ppf and employer_teacher for an 18; the ЗЗО on НОИ's days a correction moves in employer_health), where until then all of it was in employer_pension; a difference or a correction priced before 2026-10-05 kept no split and still is. The year to date's employer columns read the same. Since 2026-10-06, last: employer_upf_to_pension and employer_ppf_to_pension — of employer_upf and employer_ppf, what is фонд „Пенсии"'s because the person chose it instead of УПФ or ППФ (КСО чл. 4б, чл. 4в — the employee's upf_opt_out_from, ppf_opt_out_from); the two columns keep it, as Д6 т. 12 and т. 13 and the ДЗПО transfer do.

GET /payroll/runs/{YYYY-MM}/cost-by-department and /cost-by-department.csv — the cost to company summed per department and cost centre: department, cost_center, headcount, gross, employer_contributions, total_cost. Each person is under the department their month recorded; the people with none are one row with both blank, last. The rows add up to the cost report's totals and to the entry's 604 + 602 + 605 (meta.headcount, meta.total_gross, meta.total_employer_contributions, meta.total_cost).

GET /payroll/runs/{YYYY-MM}/variance and /variance.csv — the month against the calendar month before, per person (with department and cost_center, as every report with a row per person): status (new, left, continuing — empty when nothing was computed for the month before), salary_changed (the full-month basic salary each month implies: basic_previous, basic_current), and for gross, net, tax and employer_cost (gross + employer contributions) the _previous, _current, _delta and _delta_percent. meta.previous_period, meta.totals. meta.threshold is the company's variance_threshold (the payroll settings) and meta.above_threshold names, by employee_id, the figures (gross, net, tax, employer_cost) whose change reaches it — a person new this month or gone since reaches any percentage; a change under one cent reaches nothing. The CSV is unchanged.

GET /payroll/ytd?year=YYYY and /payroll/ytd.csv — the year to date (this year by default); for a finished year, the annual payroll register. One row per person paid in the year (with department and cost_center): months_paid, months_unposted, opening_months, gross, taxable_income, the employee's funds (fund_pension … fund_health; a person born before 1960's УПФ-sized share in fund_pension, as in the register), personal_contributions, the employer's funds and employer_contributions, income_tax, chl49_settlement, net_pay, deductions_total, amount_payable, total_cost, the part brought over from a previous system (opening_gross, opening_taxable_income, opening_contributions, opening_income_tax), and since 2026-10-06 fund_upf_to_pension, employer_upf_to_pension and employer_ppf_to_pension — what of fund_upf, employer_upf and employer_ppf is фонд „Пенсии"'s: the months the person's choice of it instead of УПФ or ППФ covered (a difference for an earlier month follows the month that paid it, as in those columns). gross, taxable_income, personal_contributions and income_tax include the year so far you sent with year-openings; the other columns cover the months computed here. meta.unposted_months names the months that may still change.

A company of more than 5,000 people paid in the year (since build round 2026-10-17): the year read inside one request takes over a minute (about 75 seconds at 12,000 people), so past that line — or past 2,000 people when the client asks for the background with Prefer: respond-async (the answer then carries Preference-Applied: respond-async) — both GET /payroll/ytd and GET /payroll/ytd.csv answer 202 with a Location, and the year to date is prepared in the background. Up to that line the answer is the request's own, as before:

{ "data": { "preparation": { "id": "01k…", "year": 2026, "status": "queued",
                             "processed": 0, "total": 0, "created_at": "…",
                             "started_at": null, "finished_at": null, "expires_at": null } } }

GET /payroll/ytd/preparations/{id} reads it back: status is queued, running, ready or failed; processed of total say how many of the year's months it has read. Once ready, result_url and csv_url give its addresses: GET /payroll/ytd/preparations/{id}/result answers exactly what GET /payroll/ytd answers — the same rows, columns and meta, byte for byte — and GET /payroll/ytd/preparations/{id}/result.csv exactly what GET /payroll/ytd.csv answers, shaped by the same ?columns=, ?header= and ?locale=. Once failed, error carries its code (build_failed, build_lost) and a message: ask for the year to date again. Asking again while one is being prepared answers that one; asking once it is ready answers it again for a day while the year's data stands as it was (a month computed or posted, a person, a department or a year so far changed since makes a new one). Before it is ready the result answers 409 preparation_not_ready (details.status), after it failed 409 preparation_failed; past its day, or another company's id, 404.

GET /payroll/income-certificates/{year}.zip — every служебна бележка по чл. 45 ЗДДФЛ of the year, one PDF per employee or ДУК with a posted month in it or a year so far brought over — the same document the app prints per person. One per PERSON: a person with two employments at the company in the year (reinstated after an unlawful dismissal, or taken on again) has one бележка over both, named after the latest. 409 no_income_certificates when there is nobody. Up to 250 бележки are rendered inside the request (about 35 seconds); a bigger year answers 409 income_certificates_async_required (details.certificates, details.sync_up_to) — ask for it as an archive instead (below).

POST /payroll/income-certificates/{year}/archives — the same ZIP for any number of people, built in the background: the same PDFs, named and in the order the request's ZIP names and orders them. No body (any field is 422). Answers 202 with the archive resource and a Location header pointing at it:

{"data": {"id": "01k…", "status": "queued", "year": 2026, "total": 12000,
  "done": 0, "progress": 0, "files": null, "bytes": null, "error_code": null,
  "created_at": "2027-01-12T07:10:12+00:00", "finished_at": null,
  "expires_at": null, "download_url": null}}

GET /payroll/income-certificate-archives/{id} — poll it (every few seconds is plenty; the бележки are rendered at roughly eight a second per worker, several workers side by side). status goes queued → building → ready, or failed with an error_code: year_changed (a month of the year was posted or computed again, or a year so far or a чл. 49 recalculation was recorded, while it was built — ask again), build_failed (rendering failed) or build_lost (the build stopped and never came back — ask again). Once ready, download_url is a signed address that needs no key, valid until expires_at, a day after the archive was ready; after that the archive reads expired and the file is gone. Like the payslips' address, it answers only while the key that read it still may read the company's payroll — otherwise 403 download_key_unusable. An archive of the year as it no longer stands reads superseded, has no download_url and is never handed over: ask for a new one. Asking again for the same year while an archive of it, as it stands, is queued, building or ready answers that archive instead of building another. The archive belongs to the company: any of its keys with payroll:read may poll it. A year nobody has a бележка for is 409 no_income_certificates.

The signed download answers in the same error shape as every other route: an address altered or past its time is 403 invalid_signature; one of an archive since superseded is 404 archive_superseded; one expired, swept or never ready is 404 not_found.

Net ↔ gross calculator

POST /payroll/calculate — one hypothetical person, one month, priced by the same engine as the runs, on this company's payroll settings (its КИД: ТЗПБ and the МОД cell; its МОД regime). Nothing is written. Both directions:

{ "direction": "net", "amount": "2000.00", "period": "2026-10", "type": "employee",
  "seniority_years": 7, "qualification_group": 2 }
Field
direction gross — amount is the salary; net — amount is the net wanted, and the answer is the smallest salary reaching it
amount the основна заплата (клас is added on top of it, as on a real card), a граждански договор's fee, or the net wanted
period YYYY-MM — the month's rates, floor and cap
type employee, duk or civil_contract
seniority_years, seniority_percent_per_year клас (трудов договор only); the percent defaults to the registry's 0.6
qualification_group 1–9: the МОД cell of the company's activity; none = the МРЗ
fte 0.1–1: a part-time contract's share of the floor
disability_percent ЗДДФЛ чл. 18 relief at 50 and over
labour_category first, second, third (I/II: the employer's ДОО uplift and ППФ)
is_teacher УчПФ
insured_on_other_grounds, q4_advance_tax_requested a граждански договор's two facts
upf_to_pension, ppf_to_pension (since 2026-10-06) the person chose фонд „Пенсии" instead of a УПФ (КСО чл. 4б — any type) or a ППФ (чл. 4в — an employee in labour_category first or second; otherwise 422 validation_failed on ppf_to_pension, as on the employee's card)

The answer carries gross, basic_salary (or fee), the components (basic, клас), insurable_base with floor (applied: gross, mrz, mod, max …) and capped_at_max, employee_contributions (total, rate, funds by fund), taxable_base, disability_relief, income_tax, net_pay, employer_contributions (total, rate, funds — the split, tzpb, teacher, doo_extra, ppf), employer_cost, a граждански договор's civil block, notes (cap, floor, tzpb_default, civil_no_contributions …), and for net: target_net and exact (with клас, a cent of salary can add two cents of net: false means the net shown is the nearest reachable). funds_to_pension (since 2026-10-06) lists the funds whose share is фонд „Пенсии"'s by that choice — upf, ppf, both or neither — as a run item's does: the amounts are the same with the choice and without it, and stay under funds.upf and funds.ppf (Д1 т. 26/25, Д6 т. 12/13 and the ДЗПО transfer keep them there). Every amount is a money object. The contributions are priced the way НАП recomputes them from Д1 (Наредба № Н-13, ДР § 2): each declared box — т. 22А/Б (Пенсии, ОЗМ and Безработица together), 22.1А/Б, 22.2, 23, 25, 26А/Б — rounded half up to the cent on its own, the funds inside a box adding up to it (the residue on Пенсии), and each total the sum of its funds. The child relief (ЗДДФЛ чл. 22в, 22г) is not in the calculation: it is annual, and in 2026 also monthly on an employee's written declaration (a run item's child_tax_relief), which a hypothetical person has not made. 422 period_unsupported — a month before the rates on record.

Simulation — „what if", nothing saved

POST /payroll/runs/{YYYY-MM}/simulation — the month computed as its inputs stand AND with a scenario, side by side, inside a transaction that is always rolled back: nothing is stored, no payslip is billed, no webhook is sent. A month that has not begun may be simulated (computing it is period_in_future); a posted month is 409 period_posted.

{ "employees": [
    { "external_id": "E-1001", "gross_monthly_salary": "3200.00" },
    { "employee": "01k…",
      "components": [{ "code": "bonus", "amount": "500.00", "amount_basis": "net" }],
      "absences": [{ "kind": "unpaid", "start_date": "2026-11-16", "end_date": "2026-11-17" }] } ],
  "new_hires": [
    { "ref": "N1", "type": "employee", "first_name": "Нов", "last_name": "Служител",
      "gross_monthly_salary": "2500.00", "active_from": "2026-11-01", "qualification_group": 2 } ] }

An employee entry is named like PUT …/inputs (employee and/or external_id, employed in the month — else 409 unknown_employee); components take the same fields as there (a net bonus, a reimbursement, a recovery — since round 9 with its consented_on, the day the person consented in writing to it — equity) and are refused the same way: since round 9 a line whose facts do not fit its kind is 422 validation_failed under the line's own field, employees.N.components.M.<field> (consented_on, recovers_period, note, amount_basis, …), as PUT …/inputs answers it — until then one sentence under employees; an absence starts in the month and needs no external_id, and since round 10 an unpaid one takes unpaid_ground as there. A line placed in the months it was earned in (earned_from / earned_to) whose months cannot carry it is 409 earned_months_unposted, and since round 9 (2026-10-06) it names them, as the app's panel does under the change: details.months — the months, YYYY-MM — and details.components — { "index", "row" } of every line of that employee whose months hold one of them, index the entry in employees and row the line in its components. Positions are the request's own, in the order sent. Since 2026-10-06 an employee entry may also carry upf_to_pension and ppf_to_pension (booleans): whether the month's УПФ (КСО чл. 4б) and ППФ (чл. 4в) shares are фонд „Пенсии"'s — left out, the card's own (upf_opt_out_from, ppf_opt_out_from); a choice the card would refuse (born before 1960, no ППФ in the third категория) is 422 validation_failed on the field. A new_hires entry is somebody who does not exist: ref is how the answer names them. The answer:

{ "data": {
  "period": "2026-11", "saved": false,
  "totals": { "current":    { "employees_gross": { "amount": "…", "currency": "EUR" }, "employer_cost": { "…": "…" }, "…": "…" },
              "simulated":  { "…": "…" },
              "difference": { "…": "…" } },
  "employees": [
    { "employee": { "id": null, "external_id": null, "name": "Нов Служител", "ref": "N1" },
      "hypothetical": true, "changed": true, "current": null,
      "simulated": { "gross": { "amount": "2500.00", "currency": "EUR" }, "net_pay": { "…": "…" }, "…": "…" },
      "difference": { "gross": { "amount": "2500.00", "currency": "EUR" }, "…": "…" } } ],
  "flags": { "unprocessed_absences": [], "…": "…" } } }

Per person: gross, employee_contributions, taxable_base, income_tax, net_pay, employer_contributions, deductions_total, off_cycle_paid, amount_payable, employer_cost, and the components — current, simulated, and the difference. Changed people come first. Since 2026-10-06 the current and the simulated blocks also carry employee_funds and employer_funds (the month's contributions by fund, money objects — the employer's without the ЗЗО on НОИ's days) and funds_to_pension (as on a run item); a person whose choice of фонд „Пенсии" alone differs is changed, every difference 0.00.

A company of more than 5,000 people (since build round 2026-10-12): the month computed twice inside one request takes minutes (about five at 5,000 people), so past that line — or past 1,000 people when the client asks for the background with Prefer: respond-async (the answer then carries Preference-Applied: respond-async) — the simulation is computed in the background, a hundred people at a time — each chunk in its own transaction, rolled back, nothing stored — and the POST answers 202 with a Location. Up to that line the answer is the request's own, as before:

{ "data": { "simulation": { "id": "01k…", "period": "2026-11", "status": "queued",
                            "processed": 0, "total": 5000, "created_at": "…",
                            "finished_at": null, "expires_at": "…" } } }

What the request refuses before it computes — a posted month, a month with no rates, a line or an absence the scenario's writers refuse — is still refused at once, with the codes above. GET /payroll/simulations/{id} reads it back: status is queued, running, done or failed; processed of total say how far it is. Once done, result carries exactly the fields of the answer above (period, saved, totals, employees, flags); once failed, error carries the error the request would have answered — its code, message and details (employee_data_missing with details.employees, …), or simulation_failed. The company's other payroll writes go on between the chunks: an input written meanwhile may be in some people's figures and not others' — ask again for a look at the month after it. Asking again for the same month and scenario while one is being computed answers that one. Kept for a day, then 404.

Parallel run — the previous provider's month

POST /payroll/runs/{YYYY-MM}/parallel-run (multipart: file, optional tolerance, default 0.01) — the previous provider's results for the month against ours, person by person. The file is CSV or XLSX, one row per person: egn (ЕГН/ЛНЧ) or external_id, and any of gross, employee_contributions, income_tax, net_pay, employer_contributions (Bulgarian headers are read too: „ЕГН", „Брутно", „Нето" …; a decimal comma is fine). Ours are the posted run, else the current computed run, else the month computed now and rolled back — source says which (posted, computed, simulated); past the chunked computation's line (1,000 people by default) a month with no current computed run is not computed here but answered 409 month_not_computed — compute it first (POST /payroll/runs, in the background at that size) and compare again. The answer: summary (matched, agreeing, differing, unmatched on either side), totals per figure over the people matched, employees (each figure provider, autonify, difference = ours − theirs, within the tolerance; status match or differs), unmatched_file (the file's line, and no_employee or duplicate), unmatched_autonify. Amounts here are plain decimal strings, as in the file. A file with no person column, no figure column, or a figure that is not a number is 422 validation_failed on file.

Off-cycle payments

Money paid on account of a month's pay before the month's run is paid — a bonus on the 15th, a leaver's final settlement on their last day, an advance. The month keeps ONE run: it computes the whole month (the tax and the contributions on the month's total — ЗДДФЛ чл. 42) and takes the PAID off-cycle payments off amount_payable (the item's off_cycle_paid); net_pay, the tax, Д1/Д6 and the posting are what they would have been with one payment.

POST /payroll/periods/{YYYY-MM}/off-cycle-payments

{ "employee": "01k…", "kind": "bonus", "pay_date": "2026-10-15",
  "lines": [{ "code": "bonus" }], "status": "paid", "paid_on": "2026-10-15" }
kind pays amount
bonus the month's one-off lines named in lines (code, and key for a kind with several lines a month) — enter them first with PUT …/inputs. Since 2026-10-22 a code alone never takes a bonus rule's line: it pays what it paid before rules existed (the lines you sent or typed); a rule's line is paid off-cycle only when named, {"code": "bonus", "key": "rule:<id>"}. Since 2026-11-13 a code alone never takes a business trip's line either; name it with its key, {"code": "reimbursement", "key": "trip:<id>:per_diem"} (or :travel_costs) computed: what the lines add to the person's amount_payable — the month with them and without them
final_settlement a leaver's last pay (the employment ends in the month) computed: everything the month has left to pay them
salary_advance on account of the salary amount, at most what the month has left

status is planned (the default — moves nothing) or paid with paid_on. "preview": true answers the quote (amount, maximum, breakdown: how the month's gross, contributions, tax, net, withholdings and amount payable move) and writes nothing. 201 with the payment: id, period, employee, kind, pay_date, amount, status, paid_on, reason, lines, breakdown.

Pay for labour done in earlier months (since 2026-10-06). A bonus payment may pay a line that names the months it was earned in (earned_from / earned_to on PUT …/inputs or in the inputs file — Pay for labour done in earlier months): the quote and the run price it as those months' pay — each share at its month's rates and maximum — and the month's Д1/Д6 package declares it there (corrective records, код 6 columns), as for the line paid with the month. Each of the payment's and the quote's lines carries its earned_from and earned_to (null for the month's own pay), and the advice prints them. Its contributions are due by the 25th of the month after the one it is accrued or paid in (КСО чл. 7, ал. 2), so such a payment — or a final_settlement of a month that holds such a line — is never dated (pay_date, paid_on) or marked paid before the first day of the month in the path: 409 off_cycle_earned_before_month (details.period, details.from). Enter the line in the month it is paid in instead.

GET /payroll/periods/{YYYY-MM}/off-cycle-payments — the month's payments. GET …/off-cycle-payments.csv — the payment list (UTF-8 with a BOM, semicolons): payment_id, employee_id, external_id, name, identifier (last four digits), kind, period, pay_date, status, paid_on, amount, pay_to_iban, pay_reference. POST /payroll/off-cycle-payments/{id}/paid {"paid_on": "2026-10-15"} — the money left. DELETE /payroll/off-cycle-payments/{id} — a planned payment any time; a paid one while its month is open. GET /payroll/off-cycle-payments/{id}/advice.pdf?locale=bg|en — the payment advice the person keeps.

GET …/off-cycle-payments/bank-file.xml (since 2026-10-04) — the month's planned payments as one ISO 20022 pain.001.001.03, the same bulk transfer (масово нареждане) the month's wages go in (GET /payroll/runs/{YYYY-MM}/bank-file.xml): one salary batch (SALA, booked as one debit), each payment a transfer to the person's own IBAN under the payment list's pay_reference, from the company's euro account — ?debtor_account= when it has several, ?execution_date= (from today to a year ahead; default today, or the next banking day), and ?pay_date=YYYY-MM-DD to file one date's batch. Nothing is sent and nothing is marked: mark each payment paid (POST …/paid) once the bank has paid it. The message id is a digest of what the file pays (OFFCYC-YYYYMM-…), so the same payments downloaded twice are refused by the bank as a duplicate.

What the file leaves out is never in it, and is said apart from it: a payment already marked paid (already_paid — a second transfer would pay it twice) and a person with no IBAN or an invalid one (no_iban, invalid_iban). The headers carry X-Autonify-Transfers, X-Autonify-Total, X-Autonify-Execution-Date, X-Autonify-Excluded and X-Autonify-Excluded-Payments (<payment id>=<reason>;…). Nothing left to pay is 409 nothing_to_pay; no euro account 409 no_debtor_account; a pay_date not written YYYY-MM-DD 422 validation_failed.

Recording a paid payment, marking one paid or removing a paid one makes a computed month stale: compute it again before posting. A posted month refuses them all (409 period_posted) — a payment the posted run did not take off would be paid twice. Only an employee or a ДУК manager, employed in the month. In GET /payroll/runs/{YYYY-MM} each person carries off_cycle_paid and off_cycle_payments (id, kind, pay_date, paid_on, amount), and the totals off_cycle_paid; register.csv's amount_payable is already net of them. Nothing here moves money: the payment is made from the list or in the app's own way, and booked against 421 when it leaves, like any wage.

Pay transparency

Directive (EU) 2023/970 asks every employer for objective pay criteria, an answer to each worker's request for pay information and a yearly notice of that right, and larger employers for a yearly gap report. The app handles requests and the notice under Заплати → Прозрачност на възнагражденията; through this API you keep each employee's sex and category of workers — the people who do the same work or work of equal value — and read a year's indicators. Bulgaria has not adopted its law yet (bill No. 52-602-01-42): the thresholds and dates the report applies come from the bill and change when the law does. Since build round 2026-11-12. There are no doors for the requests or the notice, and no event: they stay in the app.

GET /payroll/pay-transparency/categories, POST /payroll/pay-transparency/categories, PATCH /payroll/pay-transparency/categories/{id} — a category's name (unique among the active ones), what work it covers (description), the four criteria of Art. 4(4) (skills, effort, responsibility, working_conditions) and other_factors, and the starting pay you tell applicants (applicant_pay_min, applicant_pay_max, monthly basic pay in EUR, both or neither; applicant_pay_note). archived: true keeps it on the people who hold it and offers it to nobody new.

{ "data": [
  { "id": "01k…", "name": "Счетоводители", "description": "Текущо счетоводство на клиентите",
    "skills": "…", "effort": "…", "responsibility": "…", "working_conditions": "…", "other_factors": null,
    "applicant_pay_min": { "amount": "1800.00", "currency": "EUR" },
    "applicant_pay_max": { "amount": "2400.00", "currency": "EUR" },
    "applicant_pay_note": "Допълнително възнаграждение за клас", "archived": false, "people": 6,
    "created_at": "2026-11-12T08:00:00+00:00", "updated_at": "2026-11-12T08:00:00+00:00" } ] }

The active ones first, then the archived — one company's are a short list, so there are no pages; people is how many employment rows hold it. On a POST name is required (≤ 120, unique among the active ones whatever its case — 422 category_name_taken); the texts are ≤ 4,000 characters (description) or ≤ 2,000; the applicant range is sent as decimal strings ("1800.00") and read back as money objects (§4) — both or neither, above zero, the lower first (422 applicant_range_invalid). 201. A new category is active: archived on a POST may only be false. A PATCH changes only what you send; archived: false brings an archived one back (422 category_name_taken when an active one took its name meanwhile). There is no DELETE: a category people or a report name is archived. A key a category does not have is 422 validation_failed; a GET's id, people and dates may ride along. Another company's category is 404.

GET /payroll/pay-transparency/people — employee_id, sex (female, male or null), sex_source and category_id for every employee, a page at a time like every list here (limit, cursor, meta.next_cursor); ?missing=sex or ?missing=category lists the ones still to do, ?category_id= one category's people (none — those with none). updated_since is not accepted on this list (422 validation_failed): setting a sex or a category does not change the employee's updated_at.

{ "data": [
  { "employee_id": "01k…", "sex": "female", "sex_source": "stated", "category_id": "01k…" },
  { "employee_id": "01k…", "sex": null, "sex_source": null, "category_id": null } ],
  "meta": { "next_cursor": "01k…", "limit": 50 } }

Every employee the figures count is listed — employees, and ДУК managers when the company counts them (a setting in the app); civil contracts, the self-insured and removed employees are not. sex_source is stated (set here or entered in the app) or egn (filled in the app from the ЕГН, at a person's click). The list carries no names: you hold them.

PUT /payroll/pay-transparency/people/{id} — {id} is the employee's id (/payroll/employees/{id}); {"sex": "female", "category_id": "01k…"}, both keys required; null clears either. 200 with the row as the list shows it. Sex is used for nothing but these figures and never appears in another resource. An employee the figures do not count (a civil contract, a self-insured owner) is 422 person_unknown; an archived category 409 category_archived; another company's category 422 validation_failed on category_id; another company's employee 404.

GET /payroll/pay-transparency/reports/{year} — the year's figures as last prepared: the mean and median gap per hour and per year, the same for additional pay among those who receive it, the shares of women and men receiving additional pay, the four hourly pay quartiles, and the gap by category for basic, additional and total pay with flagged (5 % or more) and small (fewer than three of a sex). Only posted months count.

{ "data": { "year": 2026, "status": "draft", "prepared_at": "2027-01-15T07:40:00+00:00",
  "preparing": false, "error": null, "stale": false,
  "figures": { "version": 1,
    "period": { "from": "2026-01", "to": "2026-12", "months_posted": ["2026-01", "…"], "months_missing": [], "months_unposted": [] },
    "coverage": { "workers": 172, "counted": 168, "by_sex": { "female": 81, "male": 87 }, "sex_missing": 2, "…": "…" },
    "headcount": "164.25",
    "levels": { "female": { "workers": 81, "mean_hourly": "12.40", "median_hourly": "11.90",
                            "mean_annual": "23810.00", "median_annual": "22900.00" }, "male": { "…": "…" } },
    "indicators": {
      "gap_mean": { "hourly": "7.31", "annual": "12.05" }, "gap_median": { "…": "…" },
      "gap_mean_additional": { "…": "…" }, "gap_median_additional": { "…": "…" },
      "additional_share": { "female": "64.71", "male": "72.22" },
      "quartiles": [ { "q": 1, "workers": 42, "female": "55.56", "male": "44.44" }, "…" ],
      "categories": [ { "category_id": "01k…", "name": "Счетоводители", "counts": { "female": 4, "male": 2 },
        "basic": { "female": "14.10", "male": "14.60", "gap": "3.42" },
        "additional": { "female": "0.80", "male": "1.10", "gap": "27.27" },
        "total": { "female": "14.90", "male": "15.70", "gap": "5.10", "annual_female": "…", "annual_male": "…", "annual_gap": "…" },
        "flagged": true, "small": true } ] } },
  "scope": { "required": false, "hypothetical_due_on": "2027-06-07", "due_on": null,
             "headcount": "164.25", "tier_min_workers": 150 },
  "submitted_on": null } }

A gap is (men − women) ÷ men × 100, to two decimals: positive means men are paid more, negative that women are. Inside figures the pay per hour and per year are EUR as decimal strings and the percentages likewise, as the report the app prepares holds them. status is draft (it changes with every preparation), final or submitted (made so in the app, and frozen). stale says the payroll or the assignments changed since the figures were worked out — prepare them again; error is build_failed when the last preparation failed. scope.required says the year must be reported, by due_on; while the law is not in force, hypothetical_due_on says when it would be due if the bill passes as tabled, tier_min_workers naming the tier the company reaches by headcount — the average number of workers per posted month. A category marked small would let a reader work out a colleague's pay: leave its figures out of anything you show workers (the app's workers' copy withholds them). Before the year's figures are first worked out the answer is 404 not_prepared; a year outside 2026 … next year is 404 not_found.

POST /payroll/pay-transparency/reports/{year}/preparation works them out again: 200 when done in the request, 202 while a large company's are prepared in the background — read the GET until preparing is false (the 202 carries its address in Location). A final report (made final in the app) answers 409 report_final; a preparation already running 409 report_preparing; next year 422 report_year_invalid. A preparation that fails answers 500 build_failed and leaves the figures prepared before as they were. No body.

Error codes of these doors: 422 category_name_taken, 422 applicant_range_invalid, 422 person_unknown, 422 report_year_invalid, 409 category_archived, 409 report_final, 409 report_preparing, 404 not_prepared, 500 build_failed.

Payroll error codes

Code Status What to do
period_in_future 409 The month has not begun (Europe/Sofia). details.current. Ask again once it has — the same Idempotency-Key is not replayed.
invalid_json 400 A PATCH body that is not JSON. Nothing was changed.
period_posted 409 The month — or a month the dates reach — is posted and final. details.months; for a salary change also details.first_open, the earliest date it may take.
run_stale 409 The inputs of the month in details.period changed since it was computed — this month, or on a post an earlier month it is priced on. POST /payroll/runs for that month (then for this one), then retry.
run_computing 409 A computation of the month is queued or running. Post once it has finished.
run_recomputed 409 GET /payroll/runs/{YYYY-MM}?cursor=: the month was computed again since the cursor was handed out (or is being computed again in chunks), so its later pages would be another computation's figures. details.generation is the month's current computation. Read the month again from its first page. Since build round 2026-10-11.
payroll_busy 409 Another payroll write holds the company. Nothing was written; retry in a few seconds.
payroll_room_capped 409 POST /payroll/imports/roster/file with dry_run=false: the file's new people on payroll do not all fit the limit of the paid practice that pays for the company's payroll — it works the company by delegation, and the enterprise contract does not cover delegated practices. Nothing was written. details.rows_past_limit (the people past the limit), details.slots_needed (the payroll slots that make room). The practice adds payroll slots on its Billing page, or the contract is set to cover delegated practices; then send the file again. Since 2026-10-18.
month_not_computed 409 POST /payroll/runs/{YYYY-MM}/parallel-run: the month has no current computed run and more people than the chunked computation's line (details is empty): it is not computed inside the comparison. POST /payroll/runs for the month (in the background at that size), then retry. Since 2026-10-17.
ledger_account_missing 409 The chart of accounts lacks an account the month's entry needs. details.accounts. Add it in the app, then post again.
post_refused 409 The payroll refuses to post this month. details.reason.
employee_exists 409 That employment already exists — same external_id and start with other data, or the same ЕГН over overlapping months. details.id.
external_id_taken 409 Another employment carries that external_id with the same start date.
already_terminated 409 Terminated on another date; its end follows the ЕТЗ record — correct it with PUT /payroll/employees/{id}/termination. details.terminated_on.
termination_filed 409 The ЕТЗ termination record is filed with НАП: the termination is no longer withdrawn through the API (its date and ground are corrected with PUT, which prepares the record's correction). details.terminated_on.
employment_record_unchanged 409 A filed record restated from the data says what it was filed with: there is nothing to correct. details.id.
employment_record_correction_pending 409 A correction of the record is prepared and not filed yet: file it, or take it back (DELETE). details.corrections.
employment_record_filed_elsewhere 409 No package prepared here carried the record, so what it was filed with is not known: correct it in the НАП portal. details.id.
employment_record_refiled 409 The record was taken out and filed anew: correct the record filed anew. details.id.
employment_record_deleted 409 The record's заличаване is filed: there is nothing left to take out (a PATCH files it anew). details.id.
employment_record_has_later_records 409 A hire is taken out only after the change and termination records of the same contract filed after it, and while none waits to be filed — one prepared to be filed anew included. details.records.
employment_record_stale_refile 409 A hire's key correction while a change or termination of the same contract, prepared to be filed anew, carries the contract's old т. 1, 4–10 (and т. 12 of a termination): take it back and prepare it again first. details.records.
employment_record_is_correction 422 A prepared correction is filed as it was prepared, never edited: take it back and prepare it again. details.corrects.
not_a_change_record 422 Only a change record takes signed_on, effective_from and ground, or is withdrawn: a hire's dates are the employee's, a termination has its own door. details.kind.
no_employment_records 409 No contract was signed, changed or ended in the month: there is no package to prepare. details.period.
employment_register_xml_blocked 409 The package has no XML: a point НАП's schema makes mandatory is still empty. details.period, details.xml_blocked_by. Fill it in and prepare the package again.
obligation_payment_in_progress 409 A bank order for the obligation is open in the app: it is marked paid when the bank confirms it, or from outside once the order has failed. details.payment_status.
unknown_employee 409 No such employee on this company. Create it, then send again.
employee_not_active 409 Not employed in that month.
ambiguous_employee 409 Two employments under that external_id in the month. Name it by employee.
absence_overlaps 409 Overlaps another absence of the person (often one entered in the app).
sick_onset_uninsured 409 No longer answered (since 2026-10-04): such an absence is recorded, with no employer days and no НОИ benefit, correction.onset_uninsured saying so, its corrective Д1 and приложение № 9 prepared (A month's inputs). Until then: a sick absence for a posted month whose incapacity began inside an unpaid leave past the year's 30 working days that count as insurance (КСО чл. 9, ал. 2, т. 3), refused with details.onset, details.unpaid_days, details.unpaid.
interruption_uninsured 409 A sick, maternity, paternity, childcare or father_childcare absence for a posted month sent with interrupts_unpaid_leave: true whose risk began after the unpaid leave it falls in had passed the year's 30 working days that count as insurance (КСО чл. 9, ал. 2, т. 3; the insurance interrupted, чл. 10, ал. 2): ending the leave on that day does not make the person insured before it (НПОПДОО, указания т. 8). details.onset, details.interrupted_from, details.unpaid. Nothing was written; send it without the flag — it is recorded, with no employer pay and no НОИ benefit. Since 2026-10-04.
recovery_year_closed 409 Confirming (PATCH /payroll/carry-forwards/{id}) a sick recovery proposal of a posted month whose year has closed since: details.period, details.reason — recalculated (the person's чл. 49 ЗДДФЛ recalculation of the year settled in a posted month). deadline (past 30 April of the next year) is no longer returned since round 9: such a proposal is confirmed, with meta.past_deadline. Nothing changed; the salary stays the month's income — settle it outside the payroll, or dismiss the proposal.
not_paid_abroad 409 PUT /payroll/employees/{id}/recovered-abroad/{YYYY-MM} (since round 10): the month was not a shadow payroll month — this payroll paid it, and its recovery is proposed and confirmed with consent.
no_late_correction 409 PUT …/recovered-abroad/{YYYY-MM}: no late болничен, leave НОИ pays or (since round 10b) платен or неплатен отпуск is recorded over the month.
not_on_shadow_payroll 409 PUT …/recovered-abroad/{YYYY-MM}: the employee is paid by this payroll now; the open month would withhold from that pay what the foreign employer already recovered.
abroad_recovery_settled 409 PUT …/recovered-abroad/{YYYY-MM} with amount: null: the record was settled in a posted month (details.period) and stays.
absence_onset_uninsured 409 No longer answered (since 2026-10-04), as sick_onset_uninsured: a maternity, paternity, childcare or father_childcare absence for a posted month that began inside such an unpaid leave is recorded with no НОИ benefit, correction.onset_uninsured saying so.
use_active_to 422 Only a трудов договор is terminated; PATCH active_to instead (a duk, civil_contract, self_insured, and an employee whose public_service is civil_servant or judiciary).
use_termination 422 A трудов договор is ended — or its end moved earlier — through POST /payroll/employees/{id}/termination, not by PATCHing active_to (the app's card refuses it too). An extension (a later end) is a PATCH.
termination_ground_required 422 A termination with no termination_ground sent and none on the employee's record. Send the ЕТЗ т. 27 article, or 064 (друго). details.field, details.other. Never memoised: a ground PATCHed onto the employee answers it too.
not_an_employee 422 Leave balances, entitlements and postponements, and standing allowances, are kept for employees on a трудов договор only. details.type. Since round 10 also …/unpaid-leave-elsewhere: unpaid leave is counted for employees only.
return_not_unpaid 422 POST /payroll/absences/{id}/return: only an unpaid absence is ended early here; a paid leave is interrupted (КТ чл. 175). Since round 10.
return_outside_leave 422 The day back falls outside the leave: after its first day, no later than its last. Nothing was written. Since round 10.
return_already_recorded 409 The leave already ended early, and the day sent is LATER than the one recorded: no return — withdraw it (DELETE …/return) while its correction is open, or record the days the employee stayed away as a leave. Since round 10; since round 11 an earlier day ends the leave earlier still (return.earlier).
return_not_recorded 409 DELETE /payroll/absences/{id}/return: the leave has no early return to withdraw. Since round 10.
unpaid_elsewhere_year_closed 409 PUT …/unpaid-leave-elsewhere: the statements move the split of a posted month of a closed year — the employee's annual tax recalculation (ЗДДФЛ чл. 49) of it is settled in a posted month — so the month is not corrected here and nothing is written. details.period, details.reason (recalculated). Since round 11.
return_final 409 The return is reflected in a posted month — the month that settled its correction, or one posted since that reaches the days it gave back — and is no longer withdrawn. Since round 10.
no_time_without_work 422 …/leave-time-without-work: only an employee continued after a reinstatement (reinstates) has a time without work — from the day after the dismissal to the day before the return; a dismissed employee, any other employee, and one back the day after the dismissal have none. details.reinstates.
recovery_exceeds_pay — No longer answered since round 8: every recovery — typed by hand, a confirmed proposal, a late correction's takeback — is taken within the month's limit and the rest carried. Until then: in compute.error.code of a failed computation, a recovery that would take somebody's gross below zero.
percent_without_base 409 Computing a month: a one-off line entered as percent_of_basic belongs to an employee with no basic monthly salary on the month's last day — paid by the hour from a change dated into the month, or no salary on file. Nothing was computed. Send the line as an amount (or record the salary) and compute again. Since 2026-10-22.
earned_months_unposted 409 A one-off line's earned_from/earned_to name a month that is not posted, or one with no payslip of the employee, or none of them has a day worked (Pay for labour done in earlier months, since 2026-10-06). Nothing was written. Send the line without the months, or once they are posted. From a simulation (since round 9): details.months and details.components ({ "index", "row" } of the lines naming them).
adjustment_invalid — In compute.error.code of a failed computation: a hand adjustment takes a base or the tax below zero, the insurable base above the maximum, or the net below zero. Change or remove it, and ask again.
role_required 403 Adjusting a statutory figure takes a key minted by the account's owner or an administrator. details.role is the key's.
retro_lower 422 No longer returned since 2026-10-04: a salary dated back with retro that pays a posted month less is saved, and what each such month overpaid is proposed for recovery (meta.recovery_proposals, cause pay_cut).
sick_year_closed 409 A sick absence for a posted month of a closed year: details.period, and details.reason — recalculated (the person's чл. 49 ЗДДФЛ recalculation for the year is settled in a posted month). deadline (past 30 April of the next year) is no longer returned since round 9: such a month is carried, its records for the носител, with correction.past_deadline. Nothing was written; the НОИ benefit itself does not depend on the salary.
absence_year_closed 409 The same for a maternity, paternity, childcare or father_childcare absence — and, since 2026-10-04, a paid_annual, additional_annual, unpaid or other one — reaching a posted month of a closed year: details.period (the first such month) and details.reason. Nothing was written; the part from 1 January of the next year can be sent on its own, and НОИ's certificate for the closed months is filed outside the payroll.
not_terminated 409 No termination is recorded for the employee, so there is no compensation to confirm.
compensation_settled 409 The compensation was already paid in a posted month and no longer changes. details.settle.
act_date_filed 409 PUT …/termination/compensation (chl225_unlawful_dismissal): the time without work was declared in a posted month on this act's date, which dates its код 6 columns — a correction may not change it (Н-13 чл. 9, ал. 7). details.settle is that month.
not_reinstated 409 POST /payroll/employees/{id}/reinstatement: the employee's чл. 225 inputs do not say yet that the person was reinstated from a day — send act_effective_on, reinstated true and reinstated_on with PUT …/termination/compensation first; on DELETE, nobody was reinstated.
already_reinstated 409 The employee was already reinstated: the employment goes on in the employee details.continued_as.
reinstatement_final 409 The reinstatement is no longer taken back: a month of the continued employee is posted, or a record about it — or the termination's заличаване — is filed with НАП. details.continued_as.
employment_reinstated 409 The person was reinstated from this termination and is back at work as details.continued_as: the termination is history — no other date, ground or withdrawal — and its act_effective_on, reinstated and reinstated_on no longer change (the declaration still does). Take the reinstatement back first.
termination_ground_recorded 409 A PATCH changed the termination_ground of an employee whose termination is recorded (details.terminated_on, details.termination_ground, details.filed): the ground is corrected through the termination — PUT /payroll/employees/{id}/termination (the register's correction, код 1, once the record is filed) or, for a court's correction, PUT /payroll/employees/{id}/termination/ground (details.correct_with).
reinstatement_day 409 The employee continues an employment after a reinstatement and starts on the day of return (details.reinstated_on, of the dismissed employee details.dismissed): its active_from is not moved on its own. Take the reinstatement back while nothing of it is final, correct reinstated_on and reinstate again.
not_annulled 409 POST /payroll/employees/{id}/annulment: the employee's чл. 225 inputs do not say yet that the dismissal was annulled with no reinstatement — send act_effective_on and reinstated false with PUT …/termination/compensation first; on DELETE, nothing was ended anew.
already_annulled 409 The employment was already ended anew under КТ чл. 325, ал. 1, т. 2 on details.terminated_on: take it back (DELETE …/annulment) while nothing of it is filed to change the day.
annulment_compensation_paid 409 …/annulment (DELETE, PATCH) and PUT …/leave-time-without-work on an employee ended anew: an обезщетение of the new termination was paid in a posted month (details.paid_in) — the new termination, its pension_entitled and the periods worked elsewhere no longer change.
annulment_reinstated 409 The person was reinstated and is back at work as details.continued_as: the employment goes on and is not ended anew. Take the reinstatement back first.
annulment_final 409 The new termination is no longer taken back: the dismissal's заличаване or the new termination's record is filed with НАП. Correct the register in the НАП portal.
employment_annulled 409 The dismissal was annulled and the employment ended anew on details.terminated_on: the dismissal is history — no other date, ground or withdrawal — and its act_effective_on, reinstated and reinstated_on no longer change (the declaration still does). Take the new termination back first.
term_ended 409 POST …/annulment: the fixed-term contract was agreed to end on details.agreed_end, before the act took effect — the employment ended with its term (КТ чл. 325, ал. 1, т. 3), not under т. 2. Not built: file its register records in the НАП portal.
ground_unchanged 409 PUT …/termination/ground: the termination already carries details.termination_ground — there is nothing to correct.
no_open_claim 409 POST …/open-claim/settlements: the employee owes nothing of that part (or month) of the open claim — nothing was left after the final pay, or it was already collected or written off.
open_claim_provisional 409 POST …/open-claim/settlements: the month that left the claim is not posted yet, so what is left may still change — post it first.
open_claim_no_continued_pay 409 POST …/open-claim/settlements with outcome carried: the employment did not go on in another employee after a reinstatement who is paid in an open month — there is nothing to withhold it from (meta.open_claim.carry_to is null). Record it as collected or written off.
open_claim_carried_paid 409 DELETE /payroll/open-claim/settlements/{id} of a carried part whose settle_period is posted: it was withheld there.
open_claim_deleted_not_carried 409 POST …/open-claim/settlements with part deleted and outcome carried (since round 11): a deleted month's net is a former employee's debt for a month outside the employment — record it as collected or written off.
open_claim_deleted_filed 409 DELETE /payroll/open-claim/settlements/{id} of a deleted fact whose settle_period is posted (since round 11): that month's package filed what the fact made of the deleted month.
compensation_not_owed 409 The termination does not owe this compensation (its ground or facts rule it out), so it is not carried into an open month.
salary_inputs_missing 409 A salary the month cannot price: an hourly employee with no worked_hours, or a salary in a currency with no ECB rate. details.employees (id, reason: hours_missing or rate_missing with currency and date).
employee_data_missing 422 Somebody employed in the month has no pay on file — no salary, or a civil contract with no fee — so the month is not computed. details.employees (id, check, field). About the employee's card, not the request: never memoised, the same request succeeds once the field is sent.
opening_overlaps_payroll 409 The year so far would cover a month computed here for the person (details.months) — or, asking to compute a month, somebody's year so far already covers it (details.employees).
not_employment_income 422 The year so far and running deductions are kept for an employee or a ДУК only. details.type on a deduction.
deduction_exists 409 The employee already has a deduction under that external_id, with other data. Its amounts never change: cancel it and record the new one under another id. details.id.
not_an_advance 422 POST /payroll/deductions/{id}/repayments (since round 9): only an advance is paid back to the employer.
no_total_owed 422 POST …/repayments: an earlier_advance with no total_owed — nothing to count a repayment against.
deduction_cancelled 409 POST …/repayments: the advance is cancelled and withholds nothing more.
nothing_owed 409 POST …/repayments: nothing of the advance is withheld from details.period on.
employment_ended 409 POST …/repayments: the employment has no month from details.period on — record the repayment on the open claim (part: advance, outcome: collected).
repayment_applied 409 DELETE …/repayments/{repayment}, and since round 10 PATCH …/repayments/{repayment}: the month it applies in (details.period) is posted and withheld less for it; it stays.
allowance_exists 409 The employee already has an allowance under that external_id, with other data. Its amount never changes: end it and record the new one under another id. details.id.
hours_not_applicable 422 Hours are for a трудов договор only.
components_not_applicable 422 One-off lines are for employees and ДУК only.
component_not_allowed 422 The payroll derives that code itself, or it is standing pay — the salary, or a standing_allowance, which is recorded once with POST /payroll/employees/{id}/allowances.
unknown_component 422 No pay component has that code.
absence_invalid 422 A child on the absence contradicts itself, the remainder of the 410 days taken instead of the mother (remainder_taker, remainder_by_father) carries a болничен or starts before the child is six months old, or a father_childcare absence ends after the youngest child's eighth birthday (absence_father_childcare_too_late, the message naming the birthday; since 2026-10-04), starts before its second birthday or 1 August 2022 (absence_father_childcare_too_early), or runs past the child's two months (absence_father_childcare_too_long, the message naming the last day; absence_father_childcare_exhausted when none is left — both round 5), or reaches the day a circumstance of НРВПО чл. 46ж, ал. 5 ended the right (absence_father_childcare_ended from that day on, absence_father_childcare_ends naming the last day — round 10), or an adoption / adoption_paternity absence (or an adoptive father's father_childcare) falls outside what КТ чл. 164б gives from the day the child was handed over — absence_adoption_before_handover, absence_adoption_instead_too_early (taken instead before six months), absence_adoption_too_late (past the 365th day or the fifth birthday), absence_adoption_paternity_too_late (the 15 days past the 15th calendar day or the fifth birthday), the message naming the day (round 11). details.reason.
father_leave_child_needs_identity 422 Round 10: a period of the father's leave used elsewhere or a circumstance of НРВПО чл. 46ж, ал. 5 (POST …/father-leave/elsewhere, …/circumstances) names the child by neither an identifier nor a birth date.
father_leave_child_needs_date 422 …by an identifier that is no ЕГН (a ЛНЧ, a служебен номер) without a birth date.
father_leave_child_date_mismatch 422 …by a birth date the ЕГН contradicts; the message names the ЕГН's date.
file_invalid 422 A month's inputs file cannot be imported as it is — an unknown column, a cell that is not a number or a date, a line missing its amount. details.errors names the row and the column of each. Nothing was written.
file_refused 409 A month's inputs file names people or months that cannot take the inputs now — an employee not on the roster or not employed in the month, a posted month, an absence already recorded. details.errors, details.not_found. Nothing was written; the same file passes once that changes.
not_a_payslip 422 A граждански договор has no фиш: details.smetka and details.acceptance_protocol are the paths of its papers (smetka is null where чл. 45, ал. 8 cancels it).
not_civil_contract 422 The сметка за изплатени суми and the приемо-предавателен протокол are a граждански договор's; this employee's month has a фиш. details.type.
smetka_not_issued 409 The month was paid under a чл. 43, ал. 5 declaration (details.reason), and чл. 45, ал. 8 issues no сметка for it. The protocol is still issued (details.acceptance_protocol). A declaration recorded by mistake: withdraw it, compute the month again, and ask again.
employee_limit_reached 403 The plan's limit of people on payroll — under an enterprise contract only where a paid practice works the company by delegation and the contract does not cover delegated practices: then the practice's plan's limit. Counted across every company the plan pays for (employees whose contract is open; self-insured owners never count), with the payroll slots bought on top. details: max (the cap), active (people on payroll now), included (what the plan includes), payroll_slots (slots bought), slots_needed and slot_price_minor (how many slots this hire needs and what one costs a month, VAT exclusive — null on a plan that sells none, where a larger plan is the answer) and billing_url. Payroll slots are never bought over the API: an Owner or Admin buys them on /billing (or beside the consent box on the employee card), then the same request succeeds. The same answer refuses a PATCH that puts a former employee back on payroll and, since 2026-10-19, a termination withdrawn after its day (DELETE /payroll/employees/{id}/termination) or a passed termination day moved to today or later (PUT /payroll/employees/{id}/termination).
document_unreadable 409 A stored personnel document no longer reads back as it was filed. Nothing is wrong with the request; contact support.
run_not_posted 409 The bank file and the journal file are made from a posted month. Post it, then ask again.
no_debtor_account 409 No active euro bank account with an IBAN to pay the wages from — or, for a budget bank file (details.bank), none at that bank. Add one in the app (Banking, or the company profile).
debtor_account_required 422 Several accounts to pay from (for a budget bank file, several at that bank): name one with ?debtor_account= (details.accounts) — or, with details.currency, one in that currency with ?debtor_accounts[USD]=.
unknown_debtor_account 422 ?debtor_account= (or, with details.currency, ?debtor_accounts[…]=) names no account to pay from on this company.
nothing_to_pay 409 No wage or remittance of the month can be paid by transfer (no account on file) — or, for a budget bank file, every payment still owed is left out. details.excluded.
execution_date_invalid 422 ?execution_date= must be YYYY-MM-DD, from today (Europe/Sofia) to a year ahead — for a budget bank file, to the bank's own reach (details.latest: ING sixty days).
execution_date_unsupported 422 A budget bank file whose format has no execution-date field (ubb_iban313): leave ?execution_date= out. details.format.
no_income_certificates 409 Nobody has a служебна бележка for the year: no posted month, no year so far.
income_certificates_async_required 409 GET /payroll/income-certificates/{year}.zip: the year holds more бележки than the request renders (details.certificates, details.sync_up_to). Ask for them as an archive: POST /payroll/income-certificates/{year}/archives.
preparation_not_ready 409 GET /payroll/ytd/preparations/{id}/result (or result.csv): the year to date is still being prepared (details.status). Follow GET /payroll/ytd/preparations/{id} until its status is ready. Since 2026-10-18.
preparation_failed 409 GET /payroll/ytd/preparations/{id}/result (or result.csv): the preparation did not finish (details.status, details.error_code). Ask for the year to date again. Since 2026-10-18.
run_not_ready 409 GET /payroll/imports/runs/{id}/result: the file is still being taken in the background (details.status). Follow GET /payroll/imports/runs/{id} until its status is done. Since 2026-10-18.
run_failed 409 GET /payroll/imports/runs/{id}/result: the file was not taken (details.status, details.error_code: gone, read_only, contract_suspended, ability_missing, build_failed, build_lost) — nothing of it was written. Send it again. Since 2026-10-18.
period_unsupported 422 The calculator or a simulation was asked about a month before the payroll rates on record (2026-01).
off_cycle_line_taken 409 A line named is already on another off-cycle payment of the month. Remove that payment, or pay other lines.
off_cycle_nothing_to_pay 409 The lines add nothing to what the person receives, or the month has nothing left to pay them.
off_cycle_not_leaving 409 A final settlement is for an employment that ends in the month: record the termination first.
off_cycle_exceeds_month 409 An advance past what the month has left to pay. details.maximum.
off_cycle_earned_before_month 409 A payment carrying a line paid for labour done in earlier months (earned_from / earned_to) dated or marked paid before the first day of its month: its contributions would be due before the month's package declares them (КСО чл. 7, ал. 2). details.period, details.from. Date it from the month, or enter the line in the month it is paid in (since 2026-10-06).
off_cycle_already_paid 409 The payment is already marked paid.
department_in_use 409 People or computed months name the department: archive it (archived: true) instead of deleting it.
pay_act_applied 409 Raises name the pay act: its kind, dates, raise and components are what they were written by. The reference, the issuer, the note and the scope still change.
pay_act_in_use 409 Raises name the pay act, so it is not deleted: take it off them first (the employee PATCH's pay_act_id null), or keep it.
pay_act_overlap 409 Since 2026-10-17: another act is being applied in the app's background to some of the same people; apply this one once it is done.
pay_act_person_refused 409 Since 2026-10-17: a writer refused one person's raise (named in the message, with its reason); nothing of the act was applied. Correct the card, or exclude the person.
account_rule_managed 409 Since 2026-10-14: the raise rule is this company's copy of an account-wide rule (account_rule); it is changed or deleted on that rule — in the app, or (since 2026-10-22) through /payroll/account-raise-rules with a key holding payroll:account. Since 2026-10-23 the same for a bonus rule (/payroll/bonus-rules/{id}): through /payroll/account-bonus-rules.
not_held 409 Since 2026-10-22: POST /payroll/raise-rules/{id}/follow-account-rule on a rule that is not held: the company's own, or a copy that already follows its account rule. (A bonus rule's copy is never held, so it has no such endpoint.)
account_scope_sandbox 403 Since 2026-10-22: a sandbox key on /payroll/account-raise-rules (and since 2026-10-23 /payroll/account-bonus-rules) — an account rule reaches the account's real entities; use a live key.
account_scope_not_permitted 403 Since 2026-10-22: the person the payroll:account key belongs to is no longer the account's owner or an admin with two-factor authentication; an owner or admin creates a new key. The key's other permissions keep working.
outside_contract 409 Since 2026-10-22: the account raise rule reaches an entity the enterprise contract does not cover (or every entity, under a contract that lists its companies); it is read here and changed or deleted in the app. Since 2026-10-23 the same for an account bonus rule.
template_code_taken 409 Another template of the account already uses the code (any case).
template_in_use 409 People were given the template, or it was applied, so it is not deleted: archive it (archived: true).
template_archived 409 The template is archived: restore it (archived: false) before applying it.
template_account_wide 403 The template is for every entity of the account: it is created and changed in the app by somebody who works for all of them; a key uses it as it stands.
template_effective_posted 409 effective_from is in a posted month, which keeps what it paid: date the application in a month not yet posted.
template_not_employee 409 POST /payroll/employees/{id}/template for a ДУК, a civil contract or a self-insured person: a template holds the terms of an employment contract (трудов договор).
net_correction_not_listed 409 POST /payroll/net-remuneration-corrections: the month's filed т. 34 is what the rules compute now, or no record of the employee's own code filed it — nothing to correct. details.period.
net_correction_past_deadline 409 No longer returned since round 9c: a month past 30 April of the year after it is listed carrier and goes in when named, its record to the носител zip of its year (Наредба Н-13, чл. 9, ал. 5). Until then: 30 April of the year after the month had passed, or the package was due after it; details.period, details.deadline.
net_correction_not_offered 409 The same: the corrective record would also move a box the contributions are computed from (details.reason contributions_differ — a Д6 must go with it) or the вид осигурен (insured_type_differs). Correct the month with an adviser.
net_correction_settled 409 DELETE /payroll/net-remuneration-corrections/{id}: the month whose package files it is posted. details.settle_period.
sirv_not_summed 422 Round 11, The поименен график: the person's working time is not summed in the month in the path.
sirv_not_employee 422 …the person is not on a трудов договор.
sirv_period_unlawful 422 …the person's period is one the law no longer allows — a 6, or a 12 with no sirv_ktd_reference: change it first.
sirv_period_mismatch 422 …the period named is not the person's for the month.
sirv_period_changed 422 …the draft was written for a period the setting no longer gives (a setting corrected in the month it began, since round 11b): throw it away and write the period in force.
sirv_day_outside 422 …a shift on a day outside the person's period. details.dates.
sirv_cells 422 …a shift that cannot be read: details.shifts names each (shifts.3 — hours, times, hours_disagree, break_over_shift, break_minutes, break_without_times, night_hours, night_over_hours, kind, rest_hours, date). Nothing was written.
sirv_no_draft 422 …nothing to approve or throw away: the person has no draft for the period.
sirv_checks 422 …the draft breaks a rule that blocks the approval (details.findings, each code, level, dates, params).
sirv_reason_required 422 …a version after the first needs change_reason (НРВПО чл. 9а, ал. 2).
sirv_past_changed 422 …the draft changes days before its own approved_on (details.dates): a version governs from its approval on.
sirv_approved_in_future 422 …approved_on after today (Europe/Sofia).
sirv_approved_before_previous 422 …approved_on before the version it changes was approved.
sirv_acknowledgment 422 …an acknowledgment with no approved version, before its approval or after today.
sirv_not_draft 409 …an approved version is not written again.
sirv_kept 409 …an approved version is never removed — kept at least three years after the period (НРВПО чл. 9а, ал. 1).
approval_required 409 The company asks a second person to approve the month (or the pay act) first. Submit it, have another person approve it, then post (or apply).
approval_off 409 The company does not ask for a second person: there is nothing to submit or approve.
approval_not_submitted 409 Nobody submitted the month since it was last computed.
approval_same_person 409 The approval must come from somebody other than whoever computed or submitted the month, or recorded the act — a key minted by another person.
approval_already_given 409 It is approved already.
settings_owner_only 403 Only an owner or admin of the account that owns the company moves /payroll/settings/enterprise.
nra_route_disabled 409 The company files through НАП's portal: its API route is off.
submission_refused 409 Refused before anything reached НАП (details.reason), unless the reason is outcome_unknown.
nra_refused 502 НАП refused the submission; details carries its answer.

What the payroll API will not do

  • Reopen a posted month. Posting is final: there is no unpost and no correction run. What a posted month owes is settled in an open one (Corrections above) — a termination dated inside it (settle), a raise dated back over it (retro), an обезщетение confirmed after it, a late болничен for it (A month's inputs above). Any other absence reaching back into a posted month is still refused (409 period_posted).
  • Import the previous system's months one by one. The year so far is one set of totals per person and year (year-openings above), not a monthly history: the payslips, ведомости and monthly declarations of those months stay in the previous system, and the leave balance goes in on its own (leave-opening).
  • Print the whole month's payslips as one PDF. Fetch them per employee.
  • Pay anybody. Wages and remittances are paid from register.csv, from the SEPA bank file (bank-file.xml, uploaded at your bank) or in the app. Nothing here files with НОИ, and nothing with НАП but two signed submissions: the package of ЕТЗ (POST /payroll/employment-register/{YYYY-MM}/submit) and the month's Д1/Д6 (POST /payroll/runs/{YYYY-MM}/nra-submissions), both above.
  • Change a deduction's or an allowance's amounts, or delete either. Each is recorded once; afterwards a deduction's status and its order's account change, and an allowance's end date and cancellation. A wrong one is cancelled (or ended) and recorded again.
  • Split one person's month between two departments, or decide a person's tax residence or a treaty's application. A month is under one department; residence and treatment are what you state (tax_resident, non_resident_tax), never inferred.

6. Sandbox

Create a key with environment sandbox.

Who may hold one. Anyone with a confirmed email address. Sign up, open Developers, create a key. No invitation, no EIK, no card.

Where it points — one rule for everyone. Every sandbox key points at your account's sample company: a company we create for you with your first sandbox key, holding invented data, on the same endpoints returning the same shapes as production. Whatever your plan — a paying customer's sandbox key goes there too, because a sandbox key never writes a real company's books, and a sandbox you cannot write to is no place to build a write integration. Nothing you do there touches a real document, and nothing real is visible from it. It starts with the chart of accounts a new company gets, so an invoice, a purchase, a stock document or a payroll month posts there as it would on a real company. Its keys stay on Settings → Developer API — listed, rotatable and revocable — whichever company you have open there.

That is what makes free minting safe. It used to be by invitation, because a sandbox key read the customer's actual books on a separate meter - so anyone who could mint one for free could read data for free. Moving the data solved the problem the gate was standing in for, so the gate is gone.

Sandbox keys already on your real company. Until 28 September 2026 a plan that carries the API put its sandbox keys on the customer's own company. Those keys keep working until they expire, as they always did: they read, and never write. Their POST, PUT, PATCH or DELETE is 403 sandbox_real_company, before anything is written or numbered: a document a test key wrote there would be a real one — an invoice number in the company's real series, in the дневник НАП is sent — and "it was only the test key" undoes none of it. They are not rotated either (a rotation would renew the old arrangement for another 90 days); the key list says so beside each one. To test writes, create a new sandbox key — it lands on the sample company. To read your real data from a script, use a live key.

Live keys need a plan that carries the API, or an enterprise contract. A sponsorship does not give one: the sponsored developer's account reaches only its own company, whose plan has no API, so a live key there would answer 403 api_not_in_plan on every call. The live key for a sponsor's books is created by the sponsor, on their own Settings → Developer API, and handed over — or the sponsor gives the developer's account access to the company as its accountant, and the key is minted there. Withdrawing a sponsorship still revokes any live key minted under it earlier, immediately.

Its own budget. Sandbox traffic never touches the customer's plan: it has separate counters and a flat ceiling of its own, the same for everybody, and whoami with a sandbox key reports that allowance and that counter.

2 000 units/day per company
6 000 units/day across your account
2 live sandbox keys                60 requests/minute

Sized for BUILDING — a working day of writing and re-running an integration — and deliberately not for running anything. No nightly batch, no bulk import, no pointing production at test "for now". There is no grace band in the sandbox: the band exists because a refused real supplier invoice is a real document a customer loses, and a test one is not.

  • There are no separate sandbox paths: a sandbox key calls the same URLs, and the environment is part of the key itself. The atn_test_ / atn_live_ prefix must be the key's own, so a sandbox key cannot pass for a live one (401 invalid_token).
  • Sandbox writes on the sample company are genuinely real: numbering, duplicate detection and the VAT breakdown behave exactly as they will in production, which is the only thing a sandbox is for.
  • Sandbox documents are never filed with the NRA, never emailed, never counted in the customer's usage or plan limits. POST /sales/invoices/{id}/send answers 403 send_not_in_sandbox rather than pretending.

What the sandbox is not: an isolated staging environment. It is a separated company on the same deployment, sharing this code and this database. In practice that means what you test is exactly what you ship against, and it also means sandbox traffic is subject to the same rate limits and the same maintenance windows as everything else.

Testing your integration

What a sandbox key reaches. Your account's sample company and nothing else — the same URLs as production, with the permissions you ticked. GET /whoami with the key names the company (its id and EIK), says "environment": "sandbox", and reports the sandbox allowance it spends.

What the sample company contains. The chart of accounts a new company gets, two invented sales invoices (numbers 1001 and 1002) and the client they were issued to — enough that the first read returns something. It is VAT-registered, so the monthly VAT return is generated there as for any registered company, and GET /filings has something to list after the first month. Everything else is what you write.

Under an enterprise contract that includes payroll, the sample company is a payroll sandbox too. It mirrors the contract's permissions, payroll:* included, and starts with a department and four invented employees on an employment contract from the start of the year, with salaries — three with an ЕГН and one with a ЛНЧ (declared as "personal_identifier_type": "lnch") — so your first POST /payroll/runs computes a month. They are added once, only while the sample company has never had anybody on its roster, and no чл. 62 notice is opened for them.

Real writes, contained. A write in the sample company is a real write: numbering, duplicate detection, the VAT breakdown and the posting behave exactly as they will in production. And it stays there. Nothing from the sample company is ever filed with the NRA (a submission is refused before anything is sent), emailed, billed or counted in your plan's usage — the sandbox has its own allowance (above). It never connects a bank or initiates a payment, and nothing about it appears in your calendar, notifications, deadlines, reports or change log.

How to verify it works.

  • The integration checklist on Developers ticks itself: your first successful call with a sandbox key, your first successful write, your first webhook delivered (the „Test delivery" button counts), your first payroll month computed in the sample company (payroll contracts), and your first successful live call. Each open step shows the one command that does it, with $AUTONIFY_KEY in place of the key, and each done step says when.
  • The sample company page (Developers → „What is in your sample company") lists what the sample company holds, newest first — sales invoices with their PDF, purchase documents, counterparties, employees (identifiers masked), payroll months with their payslips, and the filings generated. Read-only.
  • The request log on Developers shows every answer the API gave your keys, refusals included, with the request id your integration holds. Filter it to Live or Sandbox; every row says which.
  • Test webhooks. Add an endpoint and press „Test delivery": one signed ping, and the far end's answer shown beside the endpoint. Events about the sample company reach an endpoint pinned to it and your account-wide ones, and every delivery carries X-Autonify-Environment: sandbox or live (§9), so a production receiver can set a test event aside before it parses the body.
  • Read it back. Every write answers with what it wrote; GET it again with the same key and compare. That proves your mapping, not only your transport.

Going live. Create a live key on the company you are integrating — your plan or your contract decides whether you may — put it in $AUTONIFY_KEY instead, and run the checklist's last step: the first successful live call ticks it. The URLs do not change; the key decides everything.


7. What this API will not do, and why

The endpoint list is deliberate. Do not plan around these arriving — they are absent by decision, not by backlog:

  • The reader's raw output. You may send a file with a purchase; what comes back is your own persisted document, never the extraction, confidences or bounding boxes, and never synchronously.
  • Registry enrichment. Autonify fills a company's details from the Commercial Register when a person types an EIK in the app. There is no endpoint for it, and none is planned — it is not a bulk lookup service.
  • Computing a return for you. No VAT return, no SAF-T, no ГДД, no ГФО. You can read what was filed and fetch the files it was filed with (§5); you cannot ask Autonify to compute one on demand.
  • Filing anything but a package of ЕТЗ and the month's Д1/Д6. Two endpoints talk to НАП, each only when the company's API route is on (409 nra_route_disabled otherwise) and each with files the person signed with their КЕП: POST /payroll/employment-register/{YYYY-MM}/submit sends a package of електронни трудови записи (DEC_ETZ62), and POST /payroll/runs/{YYYY-MM}/nra-submissions the month's Д1/Д6 (DEC_1_6, since 2026-11-07) — never a month already filed, and never a corrective one. Those are what НАП's declarations API carries; ДДС, VIES, SAF-T and the rest are not in it. filings:write records what a human did at the portal, and the portal is mTLS with the КЕП signing every handshake — that last mile is not automatable by anyone.
  • Signing with a КЕП, and moving money. No endpoint signs a document with a customer's certificate, and none initiates a payment. Both exist in the app, behind a person, and that is where they stay.
  • Billing, users, other companies. No endpoint, no permission. Payroll exists only under an enterprise contract that includes it, with limits of its own (§5, „What the payroll API will not do").

What changed, and it is a widening rather than an erosion. This section used to list "the ledger, the trial balance" among the absences. It should not have: the point being made was about generation, and it read as a promise never to show a customer their own posted books. Refusing that was the one gap that made Autonify unusable as a system of record — an accountant could not pull a trial balance into their own working papers, and a customer's data was exportable only through a browser download. books:read closes it, read-only, off by default, on the customer's own ledger and nobody else's. Nothing above moved to make room for it.

Terms, in one sentence — the long version is in the Terms of Service: you may integrate your own or your client's software with Autonify; you may not resell, sublicense, or expose the API — or anything derived from it — as a service to third parties. The version you accepted is stamped on the key when it is created.


8. Error codes

Every response carries X-Autonify-Request-Id — successes and file downloads included — and every error body carries the same value as error.request_id. It is the id of our own record of that call: quote it when you contact support and we find the request at once, refusals included. Log the header on your side, so you have it for the call you are asking about. (Refusals are sampled: past sixty in a minute from one address with one key, the rest are answered with an id but not kept.)

One answer has a shape of its own and carries the id in the header only: a body that fails field validation in the framework's shape (§4). An unexpected server error is 500 server_error in the ordinary envelope. An idempotent replay (§3) is the first answer again, byte for byte, so the request_id in its body names the request that did the work; the replay's own id is in its header.

A path or a method this API does not have — a typo in the URL, a DELETE where there is none — is answered by the router before any of this: 404 or 405, with no envelope and no request id. Nothing was recorded, so there is nothing to quote; check the path against §5.

Code Status What to do
unauthenticated 401 Send the key as a Bearer token.
invalid_token 401 Wrong key — or an atn_test_ / atn_live_ prefix that is not the key's own.
token_expired / token_revoked 401 Rotate in Settings → Developer API. Counts as a failed authentication from your address (§2), like a wrong key.
token_orphaned 403 The person who minted the key is no longer on its account. Mint a new key as someone who is.
seat_stopped 403 Since 2026-10-30: the person who minted the key is still on the account, but their team seat is suspended or past its last day. details.suspended (true/false) and details.access_until (the last day, Europe/Sofia) say which. An owner or admin restores or extends the seat on the Team page, and the same key answers again; or mint a key as another person.
team_access 403 Since 2026-10-30: the key reaches no further than the team seat of the person who minted it, and that seat's access does not include this — payroll set to „no access", for example, or approving payroll. The account's owner or an admin changes it on the Team page; the same key answers again then. A suspended seat, or one past its last day, refuses the key with seat_stopped; whoami's seat shows the access the key stands on.
company_unavailable 403 The company was deleted, or a delegation was withdrawn.
account_suspended 403 The customer's account is suspended.
api_not_in_plan 403 The plan does not include the API. whoami still answers.
ability_missing 403 The key was not created with that permission — for the files of a payroll filing, payroll:read (§5, „Filings").
ability_not_in_plan 403 The key has it; the plan does not. Retry after upgrade — no re-key needed.
ability_not_in_contract 403 The key has it; the account's enterprise contract does not include it (or a payroll permission outlived its contract). Re-keying changes nothing — the contract has to.
contract_suspended 403 The account's enterprise contract is suspended. details.resumes_on is the day access returns (null = until further notice). Nothing was charged; the same key answers again then.
sandbox_real_company 403 A sandbox key minted on a real company (before 28 September 2026) reads its books and never writes to them — no POST, PUT, PATCH or DELETE. Use a live key, or a new sandbox key: every one lands on your sample company and writes there (§6).
filings_artefacts_not_in_orders_tier 403 The orders tier may see that a filing exists, not the files it was filed with.
subscription_read_only 403 Billing lapsed — or, since 2026-10-18, the key's account is held for an unpaid plan upgrade (details.reason unpaid_upgrade): writes are refused until the upgrade is paid on the Billing page, at any size, as in the browser. All reads keep working.
terms_reacceptance_required 403 The terms changed and the grace window closed. The customer accepts on Settings → Developer API; your existing key answers again on the next request. See §1.
ocr_not_in_plan 403 The plan does not include document reading. JSON capture still works.
inventory_not_in_plan 403 The plan does not include the stock module (§ Наличности). Purchases and orders still keep the sub-ledger and COGS.
recurring_not_in_plan 403 The plan does not include recurring invoices, so work cannot be logged for them. Reading and deleting billable entries still work.
vat_crosscheck_not_in_plan 403 Since 2026-11-08: the plan does not include the NRA data cross-check (§5, „The NRA data cross-check"). A practice's own plan counts on a client's company.
analytics_not_in_plan 403 Since 2026-11-16: the plan does not include cost centres, projects and budgets (§5, „Cost centres, projects and budgets") — a catalogue write, GET /books/by-analytics, a budget read, or an analytics object that changes a document's tags. The catalogue reads and the journal still answer; a practice's own plan counts on a client's company.
send_not_in_sandbox 403 Sandbox documents are never emailed.
send_not_in_demo 403 The company belongs to a demo account, whose invented documents are never emailed.
idempotency_key_required 400 Send one on every POST, PUT and PATCH.
idempotency_key_reused 422 Same key, different body. Fix your key generation.
idempotency_in_progress 409 The first attempt is still running. Retry shortly. A reservation unanswered for 10 minutes is treated as abandoned, and the retry goes through (§3).
idempotency_key_invalid 400 The key is longer than 255 characters.
body_too_large 413 A JSON body over 4 MB, or over 500 000 values in all. Nothing was read; send the work in several requests. details.max_bytes / details.max_values.
download_key_unusable 403 A payroll archive's download_url whose key no longer may read the company's payroll. Read the archive again with a working key.
invalid_json 400 A PATCH body that is not JSON at all (the payroll API's PATCH endpoints). Nothing was changed; send the body again as JSON.
idempotency_key_expired 409 The key's window lapsed and could not be reclaimed mid-request. Retry, or send a new key.
validation_failed 422 The body — or a list's query string — does not match the contract. details has the field errors.
not_found 404 No such record on this company. Never 403 — see §5.
no_contract 404 GET /usage with a key no enterprise contract stands behind.
no_file 404 That purchase was captured without a file.
not_oss_registered 404 Since 2026-11-15: GET /oss-register for a company with no OSS registration date recorded (§5, „OSS register (чл. 159г)").
ubl_not_available 404 That document kind has no e-invoice form.
checks_not_supported 404 Since 2026-11-08: GET /filings/{id}/checks of a filing the check before signing does not cover — anything but a monthly vat_return, saft_monthly or d1_d6 (§5, „Filings").
ubl_refused 409 The document's lines no longer reproduce its total.
duplicate_document 409 Already captured. details.existing_id is the one you have.
document_posted 409 Its figures are in the ledger. Issue a storno instead.
document_annulled 409 An annulled document is immutable.
exchange_rate_missing 422 No published exchange rate for the document's currency on its date.
unknown_analytic 422 Since 2026-11-16: no cost centre, project or value of this company has that code (§5, „Cost centres, projects and budgets"). details.field / details.code. Released (§3): create the item and send the same request again.
analytic_archived 422 Since 2026-11-16: that cost centre, project or value is archived, and the document does not already hold it. details.field / details.code. Released (§3): restore it, or name another.
analytic_code_taken 409 Since 2026-11-16: another item of that kind already has the code, archived ones included.
analytic_in_use 409 Since 2026-11-16: the item is used, so its code no longer changes (the name still does) — or something that will post later still names it, so it is not archived; details.references lists what.
analytic_dimension_missing 409 Since 2026-11-16: the company has not named its own dimension yet. It is named in the app.
analytic_refused 409 Since 2026-11-16: a rule of the catalogue — details.reason is parent_cycle, parent_depth, limit or restore_parent.
analytics_on_posted_document 409 Since 2026-11-16: PATCH /purchases/{id}/fields with analytics that change a posted document's tags. Re-tag it in the app.
annul_refused 409 Annulment needs a posted document, or the document is already credited.
storno_refused 409 The service refused the credit note. The message says why.
convert_refused 409 Not a proforma, or already converted.
einvoice_not_resendable 409 Since 2026-11-15: POST /sales/invoices/{id}/einvoice/resend of an invoice that is not not_sent, held or rejected as an e-invoice — or an annulled one (§5, „E-invoicing").
einvoice_in_flight 409 Since 2026-11-15: that invoice's e-invoice is on its way or awaiting its answer. Wait for the answer. On POST /orders: the order's change waits for its invoice's answer; nothing was changed — send it again after the answer.
einvoice_no_channel 409 Since 2026-11-15: there is no e-invoice channel for this company — today, every real company. Nothing was sent.
entry_billed 409 The billable entry is on an issued invoice. details.sales_document_id names it; correct it with a credit note.
invoice_refused 409 The company's state refused the posting. Fix it and retry.
protocol_requires_reverse_charge 409 Not a reverse-charge acquisition.
period_locked 409 The accounting period is closed.
invalid_transition 409 Not legal from this status. details.from / details.to.
send_in_progress 409 POST /filings/{id}/transition: the app is sending this Д1/Д6 or package of ЕТЗ to НАП right now; nothing was recorded. Retry once the send is over (since 2026-11-08).
entry_number_mismatch 422 The entry_number a НАП verdict names is not the submission's; nothing recorded. The answer does not say which number is — read it from the month's submissions.
verdict_needs_result 409 НАП's result of the submission is not fetched and it is not yet 7 days old; try again once either holds.
verdict_final 409 The verdict on a НАП submission can no longer be taken back: its year or part went again, or the month was prepared again.
not_rejectable 409 The НАП submission takes no verdict: test environment, refused, answer lost, or already rejected.
no_carrier_file 409 POST /filings/{id}/carrier: the filing holds no носител of that year (since round 9, 2026-10-06). details.year / details.years (the ones it holds).
carrier_already_recorded 409 POST /filings/{id}/carrier: the носител the filing holds now is already recorded as handed in (details.handed_in_on). Take it back (DELETE …/carrier/{year}) to correct it.
carrier_not_recorded 409 DELETE /filings/{id}/carrier/{year}: no hand-in of that year's носител is recorded. details.year.
thin_cap_stale 409 An annual tax return whose Art. 43 carry-forward must be recomputed. Close the year again and retry. details.key.
no_buyer_email 409 Add an address to the document and retry.
store_not_push 409 That store is synchronised by pulling.
order_refused 409 The ledger refused the order — or, since 2026-11-15, a change to an order whose invoice a live e-invoice channel accepted. The message says why.
refunded_order_changed 409 Since 2026-11-15: a refund is already booked on that order, and the body changes it. Nothing was booked; reconcile the sale and its refund by hand.
transfer_refused 409 A fact about the stock. details.reason names it.
adjustment_refused 409 A fact about the stock, or a reason fighting its sign. details.reason names it.
count_refused 409 Most often a snapshot older than that place's last count. details.reason names it.
conversion_refused 409 The service or the ledger refused the преработка — including a manual split that does not meet the total. details.reason names it where the refusal has a name.
production_refused 409 The service or the ledger refused a production order or document (§5, „Производство"). details.reason names it where the refusal has a name, and the message is in the key holder's language. Nothing was written and no number was taken.
plan_required 402 No active plan or trial. Hold the document; details.retryable is true.
quota_exceeded 429 Wait for X-Autonify-Units-Reset.
rate_limited 429 More requests in a minute than the burst allows — per key, or per address and endpoint (§2). Wait Retry-After seconds.
too_many_failed_attempts 429 Too many failed authentications from your address (§2). Wait Retry-After seconds and fix the key.
send_cooldown / send_daily_limit 429 details.retry_after is seconds.
server_error 500 Something failed on our side. Quote the request_id.
api_disabled 503 The API is off on this installation.
Payroll codes 409 / 422 / 403 period_posted, run_stale, payroll_busy, employee_exists, employee_limit_reached (403) and the rest — see §5, „Payroll error codes".
Company add codes 409 / 422 / 403 eik_taken, registry_not_found, no_company_slot, company_slot_maximum, slot_purchase_in_app, trial_company_blocked, key_ability_not_permitted (403) and the rest — see §5, „The account's companies".

9. Webhooks — the other direction

Some things are worth knowing about the moment they happen, and polling for them costs you units and costs us a query. So you can be told instead.

Manage endpoints on /developers. Up to five per account. The signing secret is shown once, at creation; if you lose it, delete the endpoint and create another.

HTTPS on port 443, and public hosts only. The body carries a customer's document ids and the header carries an HMAC — over plain http both are readable by anything on the path, and a signature an eavesdropper can copy is not a signature. The address is checked when you save it and again at every delivery, because a hostname that resolved publicly in March can resolve to 10.0.0.1 in April.

An endpoint is created either pinned to one company — which is what a practice creating it while on a client's books gets — or for every company of your own account. Not every company you can reach: a delegation is permission to do the work, not a standing subscription to a client's events. A seat narrowed to some of the account's clients creates only endpoints pinned to one of them, and sees and manages only those.

Events

Event Fires when resource.type Follow up with
sales.invoice.issued A чл. 114 document reached its number sales_invoice GET /v1/sales/invoices/{id}
sales.einvoice.cleared An issued invoice was accepted as an e-invoice by the channel it was sent through and has its compliance code — today only the simulator (since 2026-11-15) sales_invoice GET /v1/sales/invoices/{id} (its einvoice)
sales.einvoice.rejected …or was rejected by it: its problems and fix-by are on the document (since 2026-11-15) sales_invoice GET /v1/sales/invoices/{id} (its einvoice)
purchase.upload.finished A file you sent has a verdict purchase_upload GET /v1/purchases/uploads/{id}
purchase.approved A supplier document was approved and posted purchase GET /v1/purchases/{id}
filing.generated A filing's artefacts were written — never for a regeneration that leaves the filing with none (a НОИ package taken back after a rejection) filing GET /v1/filings/{id}/files
filing.superseded A submitted filing — or, since 2026-10-13, a year that went of a d1_d6 not yet submitted whole — was regenerated and now differs from what was filed — a correction is owed filing GET /v1/filings?kind=…&period=… (correction_required, regenerated_after_submission)
filing.checks.flagged The check before signing of a newly prepared ДДС return or monthly SAF-T file found something to look at — a stop or a warn flag (since 2026-11-08) filing GET /v1/filings/{id}/checks
payroll.run.computed A month was computed, with its Д1/Д6 — asked for by you (POST /payroll/runs), recomputed in the app, or by the monthly auto-run payroll_run GET /v1/payroll/runs/{YYYY-MM}
payroll.run.failed …or that computation failed payroll_run GET /v1/payroll/runs/{YYYY-MM}
payroll.run.posted A payroll month was posted — from the API or the app payroll_run GET /v1/payroll/runs/{YYYY-MM}
payroll.employment_records.generated A package of ЕТЗ records was prepared — from the API or the app filing GET /v1/payroll/employment-records?period={YYYY-MM}, its file GET /v1/payroll/employment-register/{YYYY-MM}/xml
payroll.employment_records.submitted A package of ЕТЗ records was submitted to НАП over its API and has an entry number — from the API, the app, the company's automatic submission, or a batch of an accounting practice's clients (since 2026-11-07) filing GET /v1/payroll/employment-records?period={YYYY-MM}
payroll.declarations.submitted A month's Д1/Д6 — one year, or one part of a year — was submitted to НАП over its API and has an entry number — from the API, the app, or a batch of an accounting practice's clients (since 2026-11-07) filing GET /v1/payroll/runs/{YYYY-MM}/nra-submissions
payroll.pay_act.prepared A raise rule prepared an occurrence as a pay act — it waits to be applied (or applies itself on its date, a rule in auto_apply) pay_act GET /v1/payroll/pay-acts/{id}
payroll.pay_act.held_for_approval A pay act waits for a second person's approval before it can be applied — recorded under the company's switch, or its approval taken away by an edit pay_act GET /v1/payroll/pay-acts/{id}, then POST …/approve
payroll.pay_act.applied A pay act was applied — in the app, through the API (one entity's or the account-wide apply) or by its rule on its own pay_act GET /v1/payroll/pay-acts/{id}
filing.deadline.upcoming A filing's deadline is 7, 3, 1 or 0 days away and the filing is not marked submitted — the same morning, from the same scan, that reminds your people filing_deadline GET /v1/filings?kind=…&period=…, or GET /v1/filings/{id}/files once the filing exists (the url in the body)
filing.deadline.missed …and 1, 3, 7 and 14 days after it passed with nothing filed filing_deadline the same
payroll.employment_record.deadline.upcoming An employment record's (ЕТЗ) deadline — a hire's three days — is 7, 3, 1 or 0 days away and the record is not filed employment_record GET /v1/payroll/employment-records?period=…&employee=…&kind=…
payroll.employment_record.deadline.missed …and the day after it passed unfiled (once) employment_record the same

The payroll events reach only an account whose enterprise contract includes payroll:read, and nobody else. The payroll.run.* events' resource.id is the month ("2026-10"), which with company_id is the address of the run. payroll.employment_records.generated points at the package's filing, and carries source (api or web) and the package's period — "2026-10", or "2026-10-2" for a follow-up of the records a filed month did not carry. It fires for the same write as filing.generated, which a payroll-only contract without filings:read does not hear. payroll.employment_records.submitted points at the same filing and carries source (api, web, auto_submit, or batch — since 2026-11-07, a batch of an accounting practice's clients), period, document_type (since 2026-11-07: DEC_ETZ62 for the records of чл. 62 КТ, DEC_ETZ123 for a change of employer under чл. 123 КТ), environment (production, or test, which files nothing) and НАП's entry_number. payroll.declarations.submitted points at the month's d1_d6 filing and carries source (api, web or batch), period, the year and part the files declared (part is null for a year in one part), environment and entry_number; it fires once per submission, so a month that corrects another year, or a year filed in parts, fires once for each. payroll.run.computed fires however the month was computed: the answer to your POST /payroll/runs (only the latest one for the month — an older computation overtaken by a newer request says nothing), and equally a recompute from the app's own button or by the monthly auto-run, which change every payslip you read just as much. payroll.run.failed answers a computation asked for through the API. payroll.run.posted fires however the month was posted — the payroll team's button in the app included.

The payroll events carry two more keys beside the pointer:

{ "…": "…", "resource": { "type": "payroll_run", "id": "2026-10" },
  "source": "web", "generation": 4 }

source is the door — api, web or auto_run (on computed and failed). generation counts the month's computations through every door, and is the number GET /payroll/runs/{YYYY-MM} returns as run.generation (posted carries the generation that was posted). Deliveries are retried and can arrive out of order: keep the highest generation you have seen, and drop a computed with a lower one.

The pay act events (since 2026-10-22) follow a raise from the day it is prepared to the day it is applied, and point at the act — its status (pending, awaiting_approval, applied) and preview are one GET away. Beside the pointer they carry the act's effective_from and, for an act a rule prepared, its raise_rule_id:

{ "…": "…", "resource": { "type": "pay_act", "id": "01k…" },
  "effective_from": "2026-11-01", "raise_rule_id": "01k…", "approval_required": true }

prepared adds approval_required — whether the company asks a second person first (then held_for_approval follows for the same act). held_for_approval adds source, the door that recorded the act (rule, web, api), and is sent again only when an edit takes an approval away. applied adds source, the door that applied it: web, api or auto_apply (the rule on its own). Each is sent once per fact — an occurrence is prepared once, and an act applied twice (a newcomer under a КТД applied later) is two applications. An act recorded before the company switched the approval on is not announced as held: GET /payroll/pay-acts?status=awaiting_approval lists every act still waiting.

The deadline events (since 2026-10-22) are told by the morning scan (07:15, Sofia time) that sends your people their reminders, from the same set of deadlines — so the two cannot disagree. filing.deadline.upcoming fires 7, 3, 1 and 0 days before the due date and filing.deadline.missed 1, 3, 7 and 14 days after it, for a filing that is not yet marked submitted. The employment-record pair is for ONE record — a hire's three days, a termination's seven — and its missed event is sent once, the day after. The body says what is due and where to look, nothing more:

{ "id": "01K…", "event": "filing.deadline.upcoming", "occurred_at": "…", "company_id": "01K…",
  "resource": { "type": "filing_deadline", "id": "vat_return:2026-09" },
  "deadline": "vat_return", "kind": "vat_return", "period": "2026-09",
  "due_on": "2026-10-14", "days_left": 3,
  "filing_id": null, "url": "/v1/filings?kind=vat_return&period=2026-09" }

days_left (upcoming: 7, 3, 1 or 0) and days_overdue (missed: 1, 3, 7 or 14) are the one key that tells the two apart. resource.id is {deadline}:{period} and is the same on every mark of one deadline, so you can group them. deadline names the duty (vat_return, d1_d6, spravka_73_6, prilozhenie_9 …), kind the filing it ends in — the kind of GET /filings — or null for a duty no filing records, filing_id the filing's id once one exists, and url where to fetch: that filing's files, or the filtered list while it is not prepared (null with no kind). An employment record's:

{ "…": "…", "resource": { "type": "employment_record", "id": "01K…" },
  "kind": "hire", "employee": "01K…", "period": "2026-10",
  "due_on": "2026-10-23", "days_left": 1,
  "filing_id": null, "url": "/v1/payroll/employment-records?period=2026-10&employee=01K…&kind=hire" }

resource.id is the record's id (the {id} of PATCH /payroll/employment-records/{id}), employee the employee's id as POST /payroll/employees answered it, kind hire, change, termination or correction (the ?kind= of the list), and filing_id the month's package once one is prepared.

Once, and only to those who asked. Each mark of each deadline is sent once per endpoint, however often the scan runs or is run again. The two pairs are subscribed to separately. filing.deadline.* needs a plan or contract that reads filings:read (payroll filings included — their place in GET /filings needs no payroll:read); the employment-record pair names an employee, so it is payroll:read and, like the other payroll events, an enterprise contract's.

What is not announced. A deadline that depends on a fact nobody has stated (the conditional rows of the calendar): your people are told it may concern them, and a machine is not told "maybe". A Д1/Д6 носител still to hand in, which is a state of a filed return. A tax payment. And anything of your sample (sandbox) company, which has no calendar. A filing marked submitted stops the chain at once — for your people and for you.

filing.checks.flagged (since 2026-11-08) is the check before signing (GET /filings/{id}/checks, §5) finding something to look at in a ДДС return or a monthly SAF-T file that was just prepared. It points at the filing and carries its kind, its period and how many stop and warn flags the comparison found:

{ "…": "…", "resource": { "type": "filing", "id": "01k…" },
  "kind": "vat_return", "period": "2026-10", "stop": 0, "warn": 2 }

What moved, by how much and why it matters is the follow-up GET's. It is sent once for each preparation compared with its previous period — whichever read made the comparison: the morning check at 06:05 Sofia time, a person opening the filing in the app, or your own GET. A new preparation of the return, or of the month it is compared with, is a new comparison and may be announced again. The counts are those of the comparison; the live flags the GET adds (documents changed since, data the portal needs) may differ by the time you ask. Never for a Д1/Д6: what a payroll month's comparison says (how many people's pay moved) leaves this API through the payroll API only. It needs a plan or contract that reads filings:read.

sales.invoice.issued covers invoices, credit notes and debit notes. A проформа is not a tax document and an order document (чл. 52о) carries no чл. 114 number, so neither is announced — an integrator acting on this event is acting on something that exists in the VAT дневник.

sales.einvoice.cleared and sales.einvoice.rejected (since 2026-11-15) are the channel's two answers about an issued invoice's e-invoice (§5, „E-invoicing"). There is no channel to the NRA yet: today only the simulator answers, in the sandbox where it runs. They point at the sales invoice and carry three facts beside the pointer — the attempt, the channel's environment and the new status:

{ "…": "…", "resource": { "type": "sales_invoice", "id": "01k…" },
  "attempt": 2, "environment": "simulation", "status": "rejected" }

attempt counts from 1 per invoice; environment is simulation (the simulator), test or production. Each is sent once per attempt: a rejected invoice sent again is a new attempt, and its answer a new event. The code, the fix-by and the problems are the follow-up GET's (einvoice). Nothing is announced while an e-invoice is queued, submitted, held or unknown — those are on the document. Both need sales:read.

purchase.upload.finished fires for every outcome, failed included. The answer you are waiting for is as often "it could not be read" as "here is your document", and a push that only fired on success would leave you polling for ever on the case where polling costs the most. The resource is the upload, not a purchase document — for a review or a failure there is no document.

There is one more event on the wire, ping, sent only by the „Тестова доставка" button. It is not subscribable: nobody subscribes to a ping, and an endpoint that could would be one whose real events nobody ever checked. Its resource.type is ping and its resource.id is the endpoint's own id, so no receiver can mistake it for a document to go and fetch. A ping is sent once: its answer is what the button reports, it is never retried, and it counts neither towards switching the endpoint off nor towards keeping it on.

The delivery

POST https://hooks.example.bg/autonify
Content-Type: application/json
User-Agent: Autonify-Webhooks/1
X-Autonify-Event: sales.invoice.issued
X-Autonify-Delivery: 01K3H2N7Q9YV6M4W8ZB5R1TCXE
X-Autonify-Environment: live
X-Autonify-Signature: t=1785312000,v1=6f1c…a93b
{
  "id": "01K3H2N7Q9YV6M4W8ZB5R1TCXE",
  "event": "sales.invoice.issued",
  "occurred_at": "2026-07-27T12:00:00+03:00",
  "company_id": "01K2…",
  "resource": { "type": "sales_invoice", "id": "01K3…" }
}

That is the whole body, and the thinness is the design. No amounts, no document fields, no counterparty. The push is free and the follow-up GET is metered, so a fat payload would be the metering quietly undone — and it would make every webhook a copy of the books travelling to a third party's server on our initiative rather than on their request. Take the pointer and fetch what you need.

id is the delivery id, not the resource's, and it is what you deduplicate on. It is in the body and in X-Autonify-Delivery, so you can drop a repeat before you parse anything.

X-Autonify-Environment is sandbox when the event is about your account's sample company (§6) and live for everything else. An account-wide endpoint hears the sample company too, so a production receiver sets a sandbox delivery aside without looking anything up. It is a header, outside the signed body: verify the signature as below either way.

Verifying the signature

X-Autonify-Signature: t=<unix seconds>,v1=<hex hmac-sha256>

The HMAC is computed with your endpoint's secret over the string "{t}.{raw body}".

  • Verify over the raw bytes. A receiver that parses the JSON, re-encodes it and hashes that will get a different answer for the same message: key order, unicode escaping and float formatting all differ between languages. Take the body exactly as it arrived.
  • The timestamp is inside the signed string, not merely beside it, so it cannot be rewritten in flight. Enforce your own replay window — five minutes is the right one — by comparing t to your clock. We only timestamp; the window is yours.
  • v1= is a version. A future scheme will travel in the same header beside it, and your existing code will go on reading v1.
  • Compare in constant time. hash_equals, crypto.timingSafeEqual, or your language's equivalent.
<?php
$secret = getenv('AUTONIFY_WEBHOOK_SECRET');          // whsec_…
$raw    = file_get_contents('php://input');           // RAW, never json_encode(json_decode(…))
$header = $_SERVER['HTTP_X_AUTONIFY_SIGNATURE'] ?? '';

parse_str(str_replace(',', '&', $header), $parts);    // t=…&v1=…
$t  = (int) ($parts['t'] ?? 0);
$v1 = (string) ($parts['v1'] ?? '');

// Your replay window, not ours.
if ($t === 0 || abs(time() - $t) > 300) {
    http_response_code(400);
    exit;
}

if (! hash_equals(hash_hmac('sha256', $t.'.'.$raw, $secret), $v1)) {
    http_response_code(401);
    exit;
}

$event = json_decode($raw, true);

// Deduplicate on the DELIVERY id: a retry carries the original body and a
// fresh signature, so the id is the only thing that is stable.
if (alreadySeen($event['id'])) {
    http_response_code(200);
    exit;
}

enqueueForProcessing($event);                          // then fetch the resource
http_response_code(202);
// Node — the body must be the RAW buffer:
//   app.post('/autonify', express.raw({ type: 'application/json' }), handler)
const crypto = require('crypto');

function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(
    String(header).split(',').map((p) => p.split('=')),
  );

  const t = Number(parts.t);
  if (!Number.isFinite(t)) return false;
  if (Math.abs(Date.now() / 1000 - t) > 300) return false;   // your replay window

  const expected = crypto
    .createHmac('sha256', secret)
    .update(`${t}.${rawBody}`)
    .digest();

  const given = Buffer.from(String(parts.v1 || ''), 'hex');

  return given.length === expected.length && crypto.timingSafeEqual(expected, given);
}

Retries, and what a dead endpoint costs

Success is a 2xx and nothing else. A 3xx is not an acceptance and is never followed: replaying a body signed for one endpoint at whatever a redirect names would hand a customer's event, correctly signed, to a host they never registered.

A refused attempt is retried on a fixed ladder — 1 minute, 10 minutes, 1 hour, 6 hours, across five attempts — after which the delivery is dead and nobody will try it again. Each attempt is signed fresh, with a new t, and carries the original body. A retry six hours later is therefore a legitimate delivery with a current timestamp; it is not a replay, and your replay window will accept it. Deduplicate on the delivery id.

An attempt that takes longer than 8 seconds is abandoned. Answer first, process afterwards.

An endpoint that has answered nothing for 72 hours is switched off the next time a delivery dies on it, and the account's owners are told — an integration that has silently stopped is worse than one that has visibly stopped. It is measured in time, not in dead deliveries: a payroll batch of forty entities sends dozens of events in an hour, and a receiver down for one morning must not be switched off for it. The clock starts at the first failed attempt after the last success; any delivery that succeeds stops it, including one of a different event — the question is whether the address is alive at all, and one 2xx is a complete answer. (A test ping is not a delivery here, either way.) Switch it back on from /developers when the far end is fixed: every delivery that died while it was failing is sent again — the same delivery id and body, one more attempt each, so deduplicating on the id covers a repeat.

The plan still decides. An account whose API has lapsed keeps its endpoint rows — re-subscribing must not be a re-integration — and hears nothing meanwhile. Free pushes to a plan that does not include the API would be the metering handed back with the other hand.

And it decides event by event, the way it narrows a key: an event is delivered only when a key on the plan could read what it points at. The orders tier subscribes to and hears sales.invoice.issued and filing.generated, and not the purchase events. Events about your own sandbox company reach your endpoints whatever the plan — the sandbox is yours to build against — and the payroll events stay with an enterprise contract that includes them.

Delivery records are kept for thirty days, which is long enough to answer „why did I not get it last week?". The fact a delivery describes lives on the document itself, in the books, for as long as the law says.

Autonify is accounting and compliance software.

Privacy Terms