Invoices
Resolve invoice sync providers
POST
/a/Invoices_getSyncProvidersByIds
Resolve accounting providers linked to selected invoice or credit-note IDs.
When to use this endpoint
Use this to populate accounting-sync badges without loading full invoice records.
Authentication and permissions
The request must authenticate with signed API-key fields or a logged-in CRM session and is scoped to the authenticated tenant.
The handler performs no additional invoice page, record-owner, or department permission check unless stated below.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
ids | Array, JSON array, or comma-separated string | No | Invoice IDs. Positive values are deduplicated; zero and nonnumeric values are discarded. Omission is treated as an empty list. |
Example request
$providers = FM_api('Invoices_getSyncProvidersByIds', ['ids' => ['981', '982']]);
Example response
{
"981": ["quickbooks", "businesscentral"],
"982": []
}
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: ids"} | The value is neither an array nor a parseable string form. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- Every valid requested ID is present even when it has no supported provider. Unknown invoice IDs therefore appear with empty arrays.
- Both
invoiceandcreditsync records are considered. Providers normalize toquickbooks,xero,businesscentral,sage, orgnucash. - DataSync links are resolved through the referenced DataSync configuration’s
sync_type. Provider order follows database row order and is not guaranteed.
See it in Fieldmotion
CRM1
The main invoice page requests badges for visible invoice IDs.
CRM2
The invoice module requests badges in bulk for its current rows.
Related endpoints
Invoices_getDataTablealso appends direct QuickBooks and Xero remote IDs.