/api/v1/businesses/:businessId/accounting/eposnow/connect
auth: jwt (administrator)Connect an EposNow account to one VSMS Location. Rejects Epos Key/Secret pairs already active on another connection, live-validates the credentials against EposNow, then persists the connection and generates the outgoing webhook Key/Secret (returned once). Subject to the connector licence gate and the connection-limit gate when wired, and the 10/min open rate limit.
handlers: EposNowConnectionController.connect
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
eposKey bodystring | yes | — | EposNow Epos Key. Trimmed, 1-200 chars. |
eposSecret bodystring | yes | — | EposNow Epos Secret. Trimmed, 1-200 chars. |
locationId bodystring (uuid) | yes | — | VSMS Location whose certificate signs this connection's sales. |
APIResponseDataObject<ConnectEposNowResult>APIErrorAPIError/api/v1/businesses/:businessId/accounting/eposnow/status
auth: jwt (administrator)List every EposNow connection for the business, one row per connection (active, deactivated or needing reconnect), newest first. Soft-deleted history is returned separately in `deletedConnections`. Never exposes tokens or hashes.
handlers: EposNowConnectionController.status
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
APIResponseDataObject<EposNowStatusResponse>/api/v1/businesses/:businessId/accounting/eposnow/connections/:connectionId/devices
auth: jwt (administrator)Return the raw, unfiltered device list EposNow reports for one active connection, so an admin can bind a physical device to a printer. Calls EposNow live with the connection's stored credentials.
handlers: EposNowConnectionController.devices
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
connectionId pathstring (uuid) | yes | — | EposNow connection id (EposNowConnectionId). |
APIResponseDataObject<EposNowDevicesResponse>APIError/api/v1/businesses/:businessId/accounting/eposnow/connections/:connectionId/location
auth: jwt (administrator)Re-point a connection at a different VSMS Location (the one whose certificate signs its sales). The location is required and cannot be cleared. Fires `EPOSNOW_CONNECTION_LOCATION_ASSIGNED` audit with the previous and new location.
handlers: EposNowConnectionController.setLocation
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
connectionId pathstring (uuid) | yes | — | EposNow connection id (EposNowConnectionId). |
locationId bodystring (uuid) | yes | — | VSMS Location id; must belong to the caller's business. |
emptyAPIError/api/v1/businesses/:businessId/accounting/eposnow/discover
auth: jwt (administrator)Business-wide location and device auto-discovery. Uses the first active connection whose credentials still work to pull EposNow's locations (upserted as Locations, new ones auto-accepted) and all devices (upserted as tills), and back-fills the EposNow location id on connections that lack it. Fires location/till audit events.
handlers: EposNowConnectionController.discoverAll
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
APIResponseDataObject<EposNowDiscoverAllResponse>APIErrorAPIErrorAPIError/api/v1/businesses/:businessId/accounting/eposnow/connections/history/:connectionId
auth: jwt (administrator)Soft-delete an already-disconnected connection from the working list into the 'deleted' history. Nothing is removed from the database. Fires `EPOSNOW_CONNECTION_DELETED` audit.
handlers: EposNowConnectionController.deleteConnection
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
connectionId pathstring (uuid) | yes | — | EposNow connection id (EposNowConnectionId). |
emptyAPIErrorAPIError/api/v1/businesses/:businessId/accounting/eposnow/connections/:connectionId
auth: jwt (administrator)Deactivate an EposNow connection. Idempotent: an absent or already-inactive connection returns 204 without a second audit event. Fires `EPOSNOW_DISCONNECTED` audit when a live connection is deactivated.
handlers: EposNowConnectionController.disconnect
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
connectionId pathstring (uuid) | yes | — | EposNow connection id (EposNowConnectionId). |
empty/api/v1/businesses/:businessId/accounting/eposnow/connections/:connectionId/reconnect
auth: jwt (administrator)Re-enter the Epos Key/Secret for an existing connection, live-validate them against EposNow and reactivate it. Guards against credentials already used by another active connection and against credentials belonging to a different EposNow location unless confirmed. No new webhook credentials are generated. Rate-limited (10/min open bucket).
handlers: EposNowConnectionController.reconnect
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
connectionId pathstring (uuid) | yes | — | EposNow connection id (EposNowConnectionId). |
eposKey bodystring | yes | — | EposNow Epos Key. Trimmed, 1-200 chars. |
eposSecret bodystring | yes | — | EposNow Epos Secret. Trimmed, 1-200 chars. |
confirmLocationChange bodyboolean | no | — | Operator acknowledgement that the reconnect deliberately repoints the connection at a different EposNow location; send only after the EPOSNOW_RECONNECT_LOCATION_MISMATCH prompt is confirmed. |
emptyAPIErrorAPIErrorAPIError/api/v1/businesses/:businessId/accounting/eposnow/connections/:connectionId/regenerate-credentials
auth: jwt (administrator)Rotate the outgoing webhook Key/Secret for an active connection. The stored EposNow Epos Key/Secret are untouched and nothing is validated against EposNow. The new pair is returned once. Fires `EPOSNOW_CREDENTIALS_REGENERATED` audit. Rate-limited (10/min open bucket).
handlers: EposNowConnectionController.regenerateCredentials
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
connectionId pathstring (uuid) | yes | — | EposNow connection id (EposNowConnectionId). |
APIResponseDataObject<RegenerateEposNowCredentialsResult>APIError/api/v1/businesses/:businessId/accounting/eposnow/connections/:connectionId/sync
auth: jwt (administrator | view invoices | submit invoices)Manual Sync Now for one EposNow connection. Pulls transactions from EposNow, inserts new invoices and dispatches auto-fiscalisation jobs when enabled. Has database side effects, so HTTP caching is disabled (Cache-Control: no-store). The optional window is one-shot and never persisted; the next ordinary sync resumes from the connection's LastSyncedAt watermark. Runs in the background: replies `202 { runId }` at once and stores the outcome on the run. The finished run's `result` is the old synchronous body: `data` is now an empty list, `totalRows` the fetched count and `message` the counters string.
handlers: EposNowSyncController.sync
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id; must match the caller's own business (requireBusinessAccess). |
connectionId pathstring (uuid) | yes | — | EposNow connection id (EposNowConnectionId). |
modifiedSince querystring (ISO datetime) | no | — | One-shot backfill lower bound. |
dateTo querystring (ISO datetime) | no | — | One-shot backfill upper bound; defaults to now. |
APIResponseDataObject<BackgroundRunAcceptedDTO>APIError/api/v1/businesses/:businessId/accounting/eposnow/sync-all
auth: jwt (administrator | view_invoices | submit_invoices)Sync All for EposNow: syncs the listed connections one after another in ONE background run, never two at once, so a multi-store backlog does not load the provider or the database in parallel. Each connection takes its own sync lock as it is reached; one already syncing is reported `skipped`, and one failing does not stop the rest. Replies `202 { runId }`; the finished run's `result` is an `APIResponseDataObject<SyncAllResultDTO>` whose `connections[]` hold each connection's status and the body its single Sync Now would have returned.
handlers: EposNowSyncController.syncAll
| name | required | default | description |
|---|---|---|---|
businessId pathuuid | yes | — | Target business UUID. |
connectionIds bodyuuid[] (1-50) | yes | — | The connections to sync, in order. |
modifiedSince bodystring | no | — | Optional lower bound, same format as the single-connection sync. |
dateTo bodystring | no | — | Optional upper bound, same format as the single-connection sync. |
APIResponseDataObject<BackgroundRunAcceptedDTO>APIErrorAPIError/api/v1/accounting/eposnow/tax-mappings
auth: jwt (administrator)List the EposNow tax-type to V-SDC tax-label mappings for the business (active and inactive).
handlers: EposNowTaxMappingsController.list
No parameters.
APIResponseDataList<TaxRateMappingDTO>APIError/api/v1/accounting/eposnow/tax-mappings/auto-map
auth: jwt (administrator)Fetch EposNow tax rates (from the first active connection) and the current V-SDC rates and return mapping suggestions. Does not persist mappings; the admin confirms each via PUT. As a best-effort side effect it drift-checks confirmed mappings and seeds unseen tax codes, including the synthetic EPOSNOW_TAX_EXCL code, as proposals under 'Other tax codes'; failures there never fail the response. Rate-limited (10/min open bucket).
handlers: EposNowTaxMappingsController.autoMap
No parameters.
APIResponseDataList<TaxRateMappingSuggestion>APIErrorAPIError/api/v1/accounting/eposnow/tax-mappings
auth: jwt (administrator)Create or update one EposNow tax-type to V-SDC label mapping (MERGE on businessId, 'eposnow', providerTaxType).
handlers: EposNowTaxMappingsController.upsert
| name | required | default | description |
|---|---|---|---|
providerTaxType bodystring | yes | — | EposNow tax code. Trimmed, 1-100 chars. |
providerTaxName bodystring | null | no | — | Display name of the EposNow tax. Max 500 chars. |
providerRate bodynumber | null | no | — | EposNow rate percent. |
vsdcTaxLabel bodystring | yes | — | Target V-SDC tax label. Trimmed, 1-10 chars. |
vsdcRate bodynumber | null | no | — | V-SDC rate percent for display. |
APIResponseDataObject<TaxRateMappingDTO>APIError/api/v1/accounting/eposnow/tax-mappings/:providerTaxType
auth: jwt (administrator)Soft-delete an EposNow tax mapping (sets IsActive=0). The row is retained and can be re-activated via the restore endpoint.
handlers: EposNowTaxMappingsController.remove
| name | required | default | description |
|---|---|---|---|
providerTaxType pathstring | yes | — | EposNow tax code to deactivate. Trimmed, 1-100 chars. |
empty/api/v1/accounting/eposnow/tax-mappings/:providerTaxType/restore
auth: jwt (administrator)Re-activate a previously soft-deleted EposNow tax mapping (IsActive 0 to 1).
handlers: EposNowTaxMappingsController.restore
| name | required | default | description |
|---|---|---|---|
providerTaxType pathstring | yes | — | EposNow tax code to re-activate. Trimmed, 1-100 chars. |
empty/webhooks/eposnow/:businessId/:connectionId
auth: none (HTTP Basic per connection)EposNow-initiated outgoing-webhook receiver. Not JWT-authenticated: the Authorization Basic credential (base64 of outgoingApiKey:outgoingApiSecret) is checked against the connection's stored SHA-256 hash. A valid delivery is acked 200 immediately and a wake-signal (transaction id) is fanned to the EposNow webhook Redis stream; the worker re-fetches the canonical transaction. A body with no resolvable numeric transaction id is acked 200 and dropped.
handlers: EposNowWebhookController.handle
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | Business id. |
connectionId pathstring (uuid) | yes | — | EposNow connection id. |
Authorization headerstring | yes | — | HTTP Basic: base64(outgoingApiKey:outgoingApiSecret). |
TransactionId bodyinteger | string | no | — | EposNow transaction id; also read from transactionId, Id or id. Only the id is trusted. |
emptyemptyAPIError