/api/v1/businesses/:businessId/accounting/whmcs/connect
auth: jwt (administrator) + business access + connector licence gate; 10/min rate limit (`open` bucket)Connect a WHMCS install. The body carries the install's API credentials, so no response from this router is ever cached (`Cache-Control: no-store`). One install per business: connecting the SAME address again updates its credentials in place, a different address is refused until the existing install is disconnected. The credentials are probed against WHMCS first.
handlers: WhmcsConnectionController.connect
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
baseUrl bodystring | yes | — | WHMCS install URL (1-400 chars). |
apiIdentifier bodystring | yes | — | WHMCS API credential identifier (1-200 chars). |
apiSecret bodystring | yes | — | WHMCS API credential secret (1-200 chars). Never returned. |
displayName bodystring | no | — | Optional label for the install (up to 255 chars). |
APIResponseDataObject<WhmcsConnectionSummary>APIErrorAPIErrorAPIErrorAPIError/api/v1/businesses/:businessId/accounting/whmcs/status
auth: jwt (administrator) + business accessConnection summary: every WHMCS install of the business (no secrets) and the business `syncFromDate`.
handlers: WhmcsConnectionController.status
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
APIResponseDataObject<WhmcsStatusResponse>/api/v1/businesses/:businessId/accounting/whmcs/connections/:connectionId/sync
auth: jwt (administrator) + business access; 10/min rate limit (`open` bucket)Sync now for one install: reads its invoices and persists them. A foreign or disconnected connection answers the same 404 as an unknown one. 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: `APIResponseDataObject<SyncWhmcsInvoicesResult>`.
handlers: WhmcsConnectionController.sync
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
connectionId pathstring (uuid) | yes | — | WHMCS connection id (one per install). |
modifiedSince querystring (YYYY-MM-DD) | no | — | Only read invoices changed on or after this date. |
dateTo querystring (YYYY-MM-DD) | no | — | Only read invoices up to this date. |
APIResponseDataObject<BackgroundRunAcceptedDTO>APIErrorAPIErrorAPIErrorAPIError/api/v1/businesses/:businessId/accounting/whmcs/tax-rates/sync
auth: jwt (administrator) + business access; 10/min rate limit (`open` bucket)Reads the newest invoices of every active install for the tax codes they use and offers the codes that have no mapping yet for mapping. Fans out to WHMCS, so it is rate limited like Sync now.
handlers: WhmcsConnectionController.syncTaxRates
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
APIResponseDataObject<object>APIError/api/v1/businesses/:businessId/accounting/whmcs/connections/:connectionId/hook
auth: jwt (administrator) + business accessThe WHMCS add-on's hook URL and signing secret for one install. The secret is a credential: admin-only, scoped to the caller's business and never cached.
handlers: WhmcsConnectionController.getHook
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
connectionId pathstring (uuid) | yes | — | WHMCS connection id (one per install). |
APIResponseDataObject<WhmcsHookConfigSummary>APIError/api/v1/businesses/:businessId/accounting/whmcs/connections/:connectionId/location
auth: jwt (administrator) + business accessSet which VSMS Location's certificate signs this install's invoices. `null` clears it, which BLOCKS the install's invoices - it never falls back to a default.
handlers: WhmcsConnectionController.setLocation
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
connectionId pathstring (uuid) | yes | — | WHMCS connection id (one per install). |
locationId bodystring (uuid) | null | yes | — | The Location to sign under, or `null` to clear. |
emptyAPIErrorAPIError/api/v1/businesses/:businessId/accounting/whmcs/connections/:connectionId/reject
auth: jwt (administrator) + business accessReject an install that has no location: it will not be fiscalised and stops asking for attention. Refused while a location is assigned - clear it first. Idempotent when already rejected.
handlers: WhmcsConnectionController.reject
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
connectionId pathstring (uuid) | yes | — | WHMCS connection id (one per install). |
emptyAPIErrorAPIError/api/v1/businesses/:businessId/accounting/whmcs/connections/:connectionId/accept
auth: jwt (administrator) + business accessTake a rejected install back: clears the rejection so it asks for a location again.
handlers: WhmcsConnectionController.accept
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
connectionId pathstring (uuid) | yes | — | WHMCS connection id (one per install). |
emptyAPIError/api/v1/businesses/:businessId/accounting/whmcs/connections/:connectionId
auth: jwt (administrator) + business accessDisconnect one WHMCS install, addressed by its connection id (never business-wide).
handlers: WhmcsConnectionController.disconnect
| name | required | default | description |
|---|---|---|---|
businessId pathstring (uuid) | yes | — | The caller's own business. |
connectionId pathstring (uuid) | yes | — | WHMCS connection id (one per install). |
APIResponseDataObject<{ disconnected: boolean }>/webhooks/whmcs/:connectionId
auth: none - signed delivery from the WHMCS add-on (the HMAC signature is the credential); 'default' rate-limit bucketReceives one delivery from the WHMCS PHP add-on. The signature is checked before anything is read or written, and every refusal looks the same (a bare 401). An invoice event is queued as a wake-signal; tax-rule, deleted-transaction and deleted-invoice events are handled here. A delivery that cannot be queued answers 503, so it is never silently lost. Mounted under `/webhooks`, not the API base, so the JWT check never sees it.
handlers: WhmcsHookController.handle
| name | required | default | description |
|---|---|---|---|
connectionId pathstring (uuid) | yes | — | WHMCS connection id the add-on was configured with. |
emptyemptyemptyAPIErrorempty/api/v1/accounting/whmcs/tax-mappings
auth: jwt (administrator)List all per-business WHMCS tax-code to V-SDC label mappings (`Provider='whmcs'`), active and deactivated.
handlers: WhmcsTaxMappingsController.list
No parameters.
APIResponseDataList<TaxRateMappingDTO>APIError/api/v1/accounting/whmcs/tax-mappings
auth: jwt (administrator)Create or update one WHMCS tax mapping.
handlers: WhmcsTaxMappingsController.upsert
| name | required | default | description |
|---|---|---|---|
providerTaxType bodystring | yes | — | WHMCS tax code (1-100 chars). |
providerTaxName bodystring | null | no | — | Human-readable WHMCS tax name. |
providerRate bodynumber | null | no | — | WHMCS tax rate. |
vsdcTaxLabel bodystring | yes | — | V-SDC label (1-100 chars). |
vsdcRate bodynumber | null | no | — | V-SDC rate percent. |
APIResponseDataObject<TaxRateMappingDTO>APIErrorAPIError/api/v1/accounting/whmcs/tax-mappings/:providerTaxType
auth: jwt (administrator)Soft-delete (`IsActive = 0`, row retained).
handlers: WhmcsTaxMappingsController.remove
| name | required | default | description |
|---|---|---|---|
providerTaxType pathstring | yes | — | WHMCS tax code (the immutable key). |
emptyAPIError/api/v1/accounting/whmcs/tax-mappings/:providerTaxType/restore
auth: jwt (administrator)Re-activate a deactivated mapping (`IsActive = 1`).
handlers: WhmcsTaxMappingsController.restore
| name | required | default | description |
|---|---|---|---|
providerTaxType pathstring | yes | — | WHMCS tax code (the immutable key). |
emptyAPIError