Cloud accounting and selective sync
Read a cloud accounting log
/a/Accounting_logLoad
Load one tenant log by the ID returned for the same provider.
When to use this endpoint
Use the id in Accounting_logsList; it is a tenant log ID, not a provider invoice, sync mapping or DataSync instruction ID.
Authentication and permissions
Use signed API-key authentication or a logged-in CRM session on the account’s routed host. API keys act as their owner; session requests require the dispatcher’s CSRF token where configured. Tenant rows and settings belong to that authenticated account.
These handlers add no accounting page or CRM2 role check. The dispatcher has no Accounting/DataSync object-scope mapping. Settings-screen access controls are separate from these shared API handlers; CRM2 screen roles are not a CRM1 API requirement.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
provider | String | Yes | Case-insensitive after trimming: quickbooks, xero, or microsoftbusinesscentral. Other names, including datasync, are rejected by the cloud facade. |
id | Integer-compatible | Yes | Positive tenant log ID. Provider type and tenant must match. |
Example request
$result = FM_api('Accounting_logLoad', ['provider'=>'quickbooks', 'id'=>'52']);
Example response
{
"ok": 1,
"log": {
"id": "52",
"cdate": "1794474000",
"type_name2": "sync",
"description": "Starting QuickBooks update sync",
"meta": "[]",
"obj_id": "0"
},
"provider": "quickbooks"
}
Database numeric values can be strings. Read the JSON error/warning fields as well as the HTTP status.
Errors and unusual responses
| Response | Condition |
|---|---|
{"error":"not logged in"} | No authenticated tenant context is available. Invalid signed credentials can be rejected by the dispatcher before the handler runs. |
{"error":"missing or invalid parameter: provider"} | The provider is absent or outside the facade whitelist. |
{"error":"missing or invalid parameter: id"} | The ID integer-converts below 1. |
{"error":"no such log"} | No log matches the tenant, provider and debug restrictions. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- The facade appends provider and supplies ok:1 only when the returned array has no error or ok. Provider-specific fields remain intact; early provider validation errors have no provider field.
- QuickBooks restricts type_name=quickbooks and excludes debug; Business Central restricts type_name=microsoftbusinesscentral and excludes debug. Both select id,cdate,type_name2,description,meta,obj_id.
- Xero restricts type_name=xero2 and selects the whole saved log row, including extra schema fields; it does not exclude debug. Do not assume the list’s two-field shape is the detail shape.
- No time-window filter or pagination is applied to the detail lookup. Encoded meta remains encoded; the handler does not decode provider-specific payloads.
Side effects
- Read only; does not replay an action or change sync state.
See it in Fieldmotion
CRM1
Open Settings → Finances and the QuickBooks or Xero integration. Filter the browser Network panel for this Accounting route; these screens send provider explicitly. Provider-specific setup remains on the original provider routes. Expand a history entry to fetch the selected tenant log ID. Business Central has no CRM1 settings caller; its configuration UI is CRM2-only.
CRM2
Open Settings → Finances and the corresponding provider. The QuickBooks widget, Xero settings/background sync, and Business Central action wrapper call this facade with provider. Filter the browser Network panel for the endpoint name. Expand a history entry to fetch the selected tenant log ID.
Related endpoints
Accounting_logsList— Select provider log IDs.DataSync_getInstruction— Poll the instruction ID.