/api/v1/businesses/:businessId/accounting/atrex/sync
auth: apikeyOn-premise Atrex agent push. Same shape as the other agent sync routes but scope-bound to `atrex`. A pushed row with `voided: true` is a cancellation signal for an already-pushed source invoice (identified by `posSaleId`) rather than a new sale. When an admin has requested an Atrex tax-rate re-seed, the response carries `requestTaxRateSeed: true`; an empty `invoices` array is allowed.
handlers: AccountingAgentSyncController.syncAtrex
| 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. |
invoices bodyPushInvoice[] | yes | — | Array of pushed invoices (`AccountingInvoice` shape). Optional provider fields include `posSaleId`, `voided`, `originalPaymentExternalId` and payment `sourceReceiptId`. Empty array allowed. |
APIResponseDataObject<PushInvoicesResponse>APIErrorAPIErrorAPIErrorAPIError/api/v1/accounting/atrex/tax-mappings/seed-from-agent
auth: apikeyAtrex agent tax-rate seed. The sales agent posts its `TaxCat` 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. Also refreshes the business's V-SDC tax-rate snapshot, best-effort. The business comes from the API key (no path businessId); only `requireApiKey` runs, with no scope check.
handlers: AtrexTaxMappingsController.seedFromAgent
| name | required | default | description |
|---|---|---|---|
Authorization headerstring | yes | — | `ApiKey <key>` — validated by `requireApiKey` against the stored key hash. |
taxCats body{ code: string; name?: string|null; rate?: number|null }[] | yes | — | Rows from the Atrex `TaxCat` table. Atrex has no native V-SDC label, so the admin still picks the label. |
APIResponseDataObject<{ proposed: { code: string; name: string|null; rate: number|null }[]; driftDetected: number }>APIErrorAPIError/api/v1/accounting/atrex/tax-mappings/request-seed
auth: jwt (administrator)Admin request for a Atrex tax-rate re-seed. Sets an in-memory per-business flag; the next Atrex agent push response carries `requestTaxRateSeed: true`, prompting the agent to call seed-from-agent again. Business is taken from the JWT. Fires `ATREX_TAX_MAPPING_SEED_REQUESTED`.
handlers: AtrexTaxMappingsController.requestSeed
No parameters.
APIResponseDataObject<{ requested: true }>APIErrorAPIErrorAPIError/api/v1/accounting/atrex/tax-mappings
auth: jwt (administrator)List Atrex tax-mappings for the caller's business (`Provider='atrex'`). Registered by the generic per-provider loop in AccountingAgentTaxMappingsRoute.
handlers: AccountingAgentTaxMappingsController.listFor('atrex')
No parameters.
APIResponseDataList<TaxRateMappingDTO>APIError/api/v1/accounting/atrex/tax-mappings
auth: jwt (administrator)Upsert one Atrex tax-mapping (provider tax code to V-SDC label). Same body shape as the other tax-mapping CRUD surfaces; the service validates the V-SDC label.
handlers: AccountingAgentTaxMappingsController.upsertFor('atrex')
| name | required | default | description |
|---|---|---|---|
providerTaxType bodystring | yes | — | Atrex tax-code (1-100 chars). |
providerTaxName bodystring | null | no | — | Human-readable tax name (max 500 chars). |
providerRate bodynumber | null | no | — | Provider tax rate. |
vsdcTaxLabel bodystring | yes | — | V-SDC tax label (1-10 chars). |
vsdcRate bodynumber | null | no | — | V-SDC rate percent. |
APIResponseDataObject<TaxRateMappingDTO>APIErrorAPIError/api/v1/accounting/atrex/tax-mappings/:providerTaxType
auth: jwt (administrator)Soft-delete a Atrex tax-mapping (`IsActive=0`). Idempotent.
handlers: AccountingAgentTaxMappingsController.removeFor('atrex')
| name | required | default | description |
|---|---|---|---|
providerTaxType pathstring | yes | — | Atrex tax-code to deactivate. |
emptyAPIError/api/v1/accounting/atrex/tax-mappings/:providerTaxType/restore
auth: jwt (administrator)Re-activate a deactivated Atrex mapping (`IsActive=1`). Idempotent.
handlers: AccountingAgentTaxMappingsController.restoreFor('atrex')
| name | required | default | description |
|---|---|---|---|
providerTaxType pathstring | yes | — | Atrex tax-code to re-activate. |
emptyAPIError