vsmsconnect — API — accounting-sync

← all endpoints

GET/api/v1/accounting/xero/sync auth: jwt (administrator | view_invoices | submit_invoices)

Pull-sync PAID invoices from the active Xero tenant: fetch via `XeroProvider.getInvoices`, normalise to `AccountingInvoice[]`, persist to `Invoices` table (`Source='xero'`) with one `ImportBatches` row per call. Idempotency key = `SHA-256(businessId:xeroTenantId:xeroInvoiceId)`. When `AutoFiscaliseInvoices=1`, newly-inserted eligible invoices are chunked (10) and dispatched as fiscalisation jobs. Returns the `AccountingInvoice[]` plus a summary message including `jobIds=`. HTTP caching disabled.

handlers: AccountingInvoicesController.xeroSync

Inputs

namerequireddefaultdescription
contactId query
string
no—Provider-native contact GUID — narrows the result to invoices for that contact.
modifiedSince query
ISO-8601 datetime
no—Only invoices updated after this date are returned (passed as `If-Modified-Since` to Xero).
dateTo query
ISO-8601 datetime
no—Post-fetch filter on `updatedAt` (Xero has no `dateTo` param).
page query
integer
no—1-based page. Omit to auto-paginate.
pageSize query
integer
no—1–100. Capped by the provider.

Outputs

200
APIResponseDataList<AccountingInvoice>
Provider-agnostic invoice list plus a summary message `fetched=X inserted=Y duplicates=Z[ jobIds=<uuid>,…]`.
401
APIError
REAUTH_REQUIRED — Xero refresh token rejected.
409
APIError
ACCOUNTING_PROVIDER_NOT_CONFIGURED — no active Xero connection.
429
APIError
XERO_RATE_LIMITED — propagated from Xero with `Retry-After`.
GET/api/v1/accounting/sage/sync auth: jwt (administrator | view_invoices | submit_invoices)

Pull-sync invoices from the active Sage connection. Fetches OUTSTANDING / OVERDUE / PAID via three API calls merged client-side, normalises, persists to `Invoices` (`Source='sage'`). Idempotency key = `SHA-256(businessId:sageBusinessId:sageInvoiceId)`. `modifiedSince` is silently ignored (Sage's `sales_invoices` has no date filter). Auto-fiscalisation behaviour matches Xero. HTTP caching disabled.

handlers: AccountingInvoicesController.sageSync

Inputs

namerequireddefaultdescription
contactId query
string
no—Sage contact id — narrows the result to one contact.
modifiedSince query
ISO-8601 datetime
no—Silently ignored for Sage.
dateTo query
ISO-8601 datetime
no—Post-fetch filter on `updatedAt`.
page query
integer
no—1-based page.
pageSize query
integer
no—1–100.

Outputs

200
APIResponseDataList<AccountingInvoice>
Provider-agnostic invoice list plus summary message.
401
APIError
REAUTH_REQUIRED — Sage refresh token rejected.
409
APIError
ACCOUNTING_PROVIDER_NOT_CONFIGURED.
429
APIError
SAGE_RATE_LIMITED.
GET/api/v1/accounting/myob/sync auth: jwt (administrator | view_invoices | submit_invoices)

Pull-sync `Closed` invoices from the active MYOB company file. Fetches `/Sale/Invoice/Service` and `/Sale/Invoice/Item` merged by UID, normalises, persists to `Invoices` (`Source='myob'`). Idempotency key = `SHA-256(businessId:myobFileId:myobInvoiceId)`. Auto-fiscalisation behaviour matches Xero. HTTP caching disabled.

handlers: AccountingInvoicesController.myobSync

Inputs

namerequireddefaultdescription
contactId query
string
no—MYOB contact UID — narrows the result.
modifiedSince query
ISO-8601 datetime
no—Forwarded to MYOB OData `$filter`.
dateTo query
ISO-8601 datetime
no—Post-fetch filter on `updatedAt`.
page query
integer
no—1-based page.
pageSize query
integer
no—1–100.

Outputs

200
APIResponseDataList<AccountingInvoice>
Provider-agnostic invoice list plus summary message.
401
APIError
MYOB_REAUTH_REQUIRED.
409
APIError
ACCOUNTING_PROVIDER_NOT_CONFIGURED.
429
APIError
MYOB_RATE_LIMITED.