vsmsconnect — API — sage200evolution

← all endpoints

GET/api/v1/accounting/sage200evolution/tax-mappings auth: jwt (administrator)

List all Sage 200 Evolution tax-mappings for the business (`Provider='sage200evolution'`). The path-param `:id` everywhere else in this surface is the Sage `idTaxRate` (the provider tax type).

handlers: Sage200EvolutionTaxMappingsController.list

Inputs

No parameters.

Outputs

200
APIResponseDataList<TaxRateMappingDTO>
Sage 200 Evolution mappings.
PUT/api/v1/accounting/sage200evolution/tax-mappings/:id auth: jwt (administrator)

Upsert a single Sage 200 Evolution mapping. `:id` is the Sage `idTaxRate` (provider tax type). Body carries the V-SDC label + optional metadata.

handlers: Sage200EvolutionTaxMappingsController.upsert

Inputs

namerequireddefaultdescription
id path
string
yes—Sage `idTaxRate` — the provider tax type.
providerTaxName body
string | null
no—Human-readable Sage tax name.
providerRate body
number | null
no—Sage tax rate percent.
vsdcTaxLabel body
string
yes—V-SDC label.
vsdcRate body
number | null
no—V-SDC rate percent.

Outputs

200
APIResponseDataObject<TaxRateMappingDTO>
Upserted mapping.
422
APIError
Invalid V-SDC label.
DELETE/api/v1/accounting/sage200evolution/tax-mappings/:id auth: jwt (administrator)

Soft-delete a Sage 200 Evolution mapping (`IsActive=0`). Idempotent.

handlers: Sage200EvolutionTaxMappingsController.remove

Inputs

namerequireddefaultdescription
id path
string
yes—Sage `idTaxRate`.

Outputs

204
empty
No content.
POST/api/v1/accounting/sage200evolution/tax-mappings/:id/restore auth: jwt (administrator)

Re-activate a deactivated Sage 200 Evolution mapping (`IsActive=1`). Note: uses POST (unlike the Xero/Sage/MYOB restore endpoints which use PATCH). Idempotent.

handlers: Sage200EvolutionTaxMappingsController.restore

Inputs

namerequireddefaultdescription
id path
string
yes—Sage `idTaxRate`.

Outputs

204
empty
No content.
POST/api/v1/businesses/:businessId/accounting/sage200evolution/sync auth: apikey

On-premise Sage 200 Evolution agent push. Scope-bound to `sage200evolution`. Per-row register→till routing via `Tills.PosRegisterId`; unrouted invoices return `outcomes[].outcome='register_unmapped'` and fire `SAGE200_RECEIPT_UNROUTED` audit. Supports advance-sale deposits (one `AccountingInvoicePayment` per `_etblInvoiceDeposits` row, fan-out to N `NormalizedInvoicePayment`s).

handlers: AccountingAgentSyncController.syncSage200Evolution

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID.
Authorization header
string
yes—`ApiKey <key>`.
invoices body
PushInvoice[]
yes—Array of pushed invoices. Deposit rows arrive as separate payments under the same invoice.

Outputs

200
APIResponseDataObject<PushInvoicesResponse>
Push result summary including per-invoice `outcomes` for unrouted receipts.
401
APIError
Missing or invalid API key.
403
APIError
API key scope does not match `sage200evolution`.
POST/api/v1/businesses/:businessId/accounting/sage200evolution/register-manifest auth: apikey

Sage 200 Evolution register discovery. The agent posts its warehouse (`WhseMst`) and till snapshot. The cloud upserts one `Locations` row per warehouse keyed on the warehouse code and auto-accepts every newly created one, then upserts one `Tills` row per register keyed on `PosRegisterId` with a null `MachineId` (no hostname is available to auto-bind a print agent). Existing rows are not overwritten apart from source-wins renames and till moves. Fires `SAGE200_MANIFEST_RECEIVED` plus per-row rename/move audits.

handlers: AccountingAgentSyncController.registerSage200EvolutionManifest

Inputs

namerequireddefaultdescription
businessId path
uuid
yes—Target business UUID. Must match the API key's `BusinessId`; a mismatch is rejected with 403.
Authorization header
string
yes—`ApiKey <key>` — validated by `requireApiKey` against the stored key hash.
capturedAt body
number
yes—Epoch-ms time the agent captured the snapshot.
warehouses body
{ code: string; name: string }[]
yes—Sage 200 warehouses.
tills body
{ posRegisterId: string; tillName: string; warehouseCode: string }[]
yes—Sage 200 tills. A till whose warehouse cannot be resolved is skipped.

Outputs

200
APIResponseDataObject<Sage200RegisterManifestResponse>
Counts of what the manifest created / already had / renamed / moved.
401
APIError
AUTH_UNAUTHORIZED — missing or invalid (unknown or revoked) API key.
403
APIError
USER_FORBIDDEN — the API key does not belong to the business in the path.
403
APIError
USER_FORBIDDEN — API key scope does not match `sage200evolution`. Unscoped keys pass.
422
APIError
VALIDATION_ERROR — body or path failed schema validation.
POST/api/v1/accounting/sage200evolution/tax-mappings/seed-from-agent auth: apikey

Sage 200 Evolution agent tax-rate seed. The sales agent posts its `dbo.TaxRate` snapshot on startup and whenever a push response carries `requestTaxRateSeed`. Every not-yet-confirmed code is written as a PROPOSAL (`UnmappedTaxTypes`) with its name and rate; nothing is auto-confirmed into `TaxRateMappings`. Already-confirmed codes are skipped unless the source rate or name has drifted, in which case the mapping is deactivated for admin review. The business comes from the API key (no path businessId); only `requireApiKey` runs, with no scope check.

handlers: Sage200EvolutionTaxMappingsController.seedFromAgent

Inputs

namerequireddefaultdescription
Authorization header
string
yes—`ApiKey <key>` — validated by `requireApiKey` against the stored key hash.
taxRates body
{ code: string; name?: string|null; fiscalLabel?: string|null; rate?: number|null }[]
yes—Rows from `dbo.TaxRate`. `code` is the `idTaxRate`. `fiscalLabel` is accepted by the schema.

Outputs

200
APIResponseDataObject<{ proposed: { code: string; name: string|null; rate: number|null }[]; alreadyMapped: number; driftDetected: number }>
Codes proposed this call, count of already-confirmed codes and count of drift deactivations.
401
APIError
AUTH_UNAUTHORIZED — missing or invalid (unknown or revoked) API key.
422
APIError
VALIDATION_ERROR — body or path failed schema validation.
POST/api/v1/accounting/sage200evolution/tax-mappings/request-seed auth: jwt (administrator)

Admin request for a Sage 200 Evolution tax-rate re-seed. Sets an in-memory per-business flag; the next Sage 200 Evolution agent push response carries `requestTaxRateSeed: true`, prompting the agent to call seed-from-agent again. Business is taken from the JWT. Fires `SAGE200_TAX_MAPPING_SEED_REQUESTED`.

handlers: Sage200EvolutionTaxMappingsController.requestSeed

Inputs

No parameters.

Outputs

202
APIResponseDataObject<{ requested: true }>
Re-seed flagged for the next agent push.
401
APIError
AUTH_UNAUTHORIZED — missing or invalid access token.
403
APIError
USER_FORBIDDEN — caller is not an administrator.
409
APIError
BUSINESS_CONTEXT_REQUIRED — no active business on the JWT.