When to use this endpoint

Use this after loading a Credit Notes table page to show which notes appear in QuickBooks, Xero, Business Central, Sage, or GnuCash.

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 tenant setting accounting_credit_notes must equal 1. Otherwise the handler returns {"error":"Credit Notes are not enabled for this account"}.

Users whose legacy crm_access mask contains bit 64 are denied. The handler does not enforce the CRM2 pageCreditNotes role permission, ownership, or department scope.

Parameters

ParameterTypeRequiredDescription
idsArray, JSON array string, or comma-separated stringYesPositive IDs are integer-normalized and deduplicated. Blank input becomes an empty list.

Example request

$providers = FM_api('CreditNotes_getSyncProvidersByIds', [
	'ids' => json_encode([311, 312]),
]);

Example response

{
  "311": ["xero", "sage"],
  "312": []
}

Errors and unusual responses

ResponseCondition
{"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 supplied value cannot be interpreted as an array or string list.

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 normalized requested ID receives a key even when the credit note does not exist or has no sync mapping.
  • Only api_syncs.object_type=credit is considered. Direct provider names and datasync{id} instances are normalized to quickbooks, xero, businesscentral, sage, or gnucash; unknown/stale providers are omitted.
  • Provider ordering follows database row order and is not guaranteed; duplicates are removed.

See it in Fieldmotion

CRM1

No CRM1 caller was found.

CRM2

Opening or redrawing Credit Notes sends the IDs visible on the current page to this endpoint and renders provider badges in the Status cell.

Related endpoints