Cloud accounting and selective sync
List cloud accounting logs
/a/Accounting_logsList
Retrieve provider-specific log history and obtain IDs for Accounting_logLoad.
When to use this endpoint
Choose the provider first. Treat the three provider log formats separately; this facade preserves their differences.
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. |
from | Unix seconds | No | QuickBooks/Business Central: positive inclusive lower bound, otherwise server now minus seven days. Xero ignores this input. |
to | Unix seconds | No | QuickBooks/Business Central: positive inclusive upper bound, otherwise server now. Reversed bounds are not swapped. Xero ignores this input. |
Example request
$result = FM_api('Accounting_logsList', ['provider'=>'xero']);
Example response
{
"ok": 1,
"logs": [
{
"id": "52",
"cdate": "1794474000"
}
],
"provider": "xero"
}
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. |
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.
- Xero returns only id and cdate from xero2 logs for the last seven days through now. It ignores request from/to, supplies no returned window and establishes no SQL ordering.
- QuickBooks returns logs, summary, sessions, from and to. Its rows are id,cdate,type_name2,description,meta,obj_id; excludes debug; ordered cdate DESC,id DESC. Summary groups have key,label,count,log_ids.
- QuickBooks sessions group chronological entries at explicit start/end descriptions or gaps over six hours, then return newest sessions first. Each has id,cdate,started_at,ended_at,status,count,log_ids,summary. Status complete/paused/errors/activity is inferred from text; it is not an execution receipt.
- Business Central returns logs,from,to using the same row columns/order as QuickBooks, excluding debug and requiring type_name2=sync. Detail lookup can still load another non-debug Business Central log type by ID.
- All windows use inclusive Unix-second boundaries. No endpoint supports page, offset or a row limit. meta remains encoded text; large windows can return many rows.
Side effects
- Database reads only; no seen markers, checkpoint advancement or sync execution.
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. Open the provider’s logs/history tab; the UI uses provider-specific history rendering. 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. Open the provider’s logs/history tab; the UI uses provider-specific history rendering.
Related endpoints
Accounting_logLoad— Read a selected log.Accounting_sync— Execute cloud phases.DataSync_getLogs— Read agent activity.