Routes shared by every on-premise connector — AMICUS, Atrex, Sage 100, Sage 200 Evolution and Sage 300. These connectors read the customer's own database through the sales agent, which authenticates with an API key. The agent sends a heartbeat and asks which app location it is scoped to; the app reads the combined push status. Connector-specific routes (register manifests, branch mappings, tax-mapping seeding, sync) are listed under each connector.
/api/v1/businesses/:businessId/accounting/sync/status
auth: jwt (administrator | view_invoices | submit_invoices)Return the last-push timestamp per on-premise source (sage100, sage300, sage200evolution, amicus) for the business. Reads `ImportBatches.CreatedAt` per source via `findLatestCreatedAtBySources`; null when the source has never pushed.
handlers: AccountingAgentSyncController.status
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. |
APIResponseDataObject<PushStatusResponse>APIError/api/v1/businesses/:businessId/accounting/agent/heartbeat
auth: apikeyOn-premise sales-agent heartbeat, sent at most about every 30 s. Any provider scope is accepted. The controller stores the normalised heartbeat in Redis per API-key id with a 600 s TTL (read back by the push-status endpoint), and best-effort records the key's last-seen time and reported `version` in the database. Neither write can fail the request.
handlers: AccountingAgentSyncController.recordHeartbeat
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. Must match the API key's `BusinessId`; a mismatch is rejected with 403. |
Authorization headerstring | yes | — | `ApiKey <key>` — validated by `requireApiKey` against the stored key hash. |
lastPushAt bodynumber | null | no | — | Epoch-ms of the agent's last push. |
lastPushOutcome body'success' | 'transient' | 'persistent_outage' | null | no | — | Outcome of the last push. |
consecutiveFailures bodynumber | no | — | Consecutive failed pushes. |
persistentOutageActive bodyboolean | no | — | Whether a persistent outage is active. |
backlogEstimate bodyRecord<string, number> | no | — | Estimated backlog per source. |
version bodystring | no | — | Agent build version, recorded against the API key. |
voidAPIErrorAPIErrorAPIError/api/v1/businesses/:businessId/accounting/agent/context
auth: apikeyReturns the app-side location the calling API key is scoped to, so the sales-agent setup wizard can show which app location the agent maps to. Any provider scope is accepted. `location` is null when the key has no location or it does not resolve.
handlers: AccountingAgentSyncController.agentContext
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. Must match the API key's `BusinessId`; a mismatch is rejected with 403. |
Authorization headerstring | yes | — | `ApiKey <key>` — validated by `requireApiKey` against the stored key hash. |
APIResponseDataObject<{ businessId: string; location: { id: string; name: string } | null }>APIErrorAPIErrorAPIError