When to use this endpoint

Use Supplier_edit only with the complete CRM1 supplier edit form. It is not a partial-update route: most omitted fields are written as blank values.

Authentication and permissions

The request must establish an authenticated tenant context with signed API credentials or a logged-in CRM session. This legacy handler checks for the tenant database prefix rather than calling the normal login guard.

It performs no additional Suppliers-page, stock, purchasing, role, create, edit, or delete permission check.

Parameters

ParameterTypeRequiredDescription
idInteger-compatibleYesPositive tenant supplier ID.
name, contact_name, tax_id, phone, account_number, ref_number, email, websiteStringNoReplacement values. Every omitted value in this group becomes an empty string.
street_address1, street_address2, town, county, country, postcode, notesStringNoReplacement address and notes values. Every omitted value becomes an empty string.
contact_accounting, email_accountingStringNoReplace the corresponding keys inside the existing meta object; omission writes an empty string to that key.
on_holdInteger-compatibleNoReplacement hold marker; omission becomes 0.

Example request

$result = FM_api('Supplier_edit', [
	'id' => 488104,
	'name' => 'Northshore Components',
	'contact_name' => 'Aisling Byrne',
	'account_number' => 'NS-42',
	'on_hold' => 0,
]);

Example response

{"ok":1}

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: id"}The ID is absent or not positive.

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 handler performs no length, email, duplicate-name, active, or deleted-state validation.
  • Unknown IDs and deleted supplier IDs still return {"ok":1}; a deleted row can be edited because the update has no deleted=0 filter.
  • Existing metadata keys other than the two accounting keys are preserved.

Side effects

  • Advances last_edited, sets edited_uuid to Supplier_edit, and clears the supplier cache when a row matches.
  • Fires the configurable Supplier_edit event even when no row matched.

See it in Fieldmotion

CRM1

Open Stock → Suppliers in CRM1 and filter browser developer tools for the exact function name. Open a supplier, change its fields, and choose Save.

CRM2

CRM2 does not call this legacy form replacement. Its layout save reaches Supplier_updateData through Layout_setValue.

Related endpoints