When to use this endpoint

Use Supplier_updateData for camel-cased mapped fields. CRM2 reaches it indirectly through Layout_setValue when saving a Supplier Update layout.

Unlike Supplier_edit, omitted mapped fields are preserved.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler calls the normal login guard but performs no additional Suppliers-page, stock, purchasing, role, create, edit, or delete permission check.

All records are selected from the authenticated tenant. CRM1 and CRM2 hide some controls through client-side permissions, but these endpoints do not repeat those UI checks.

Parameters

ParameterTypeRequiredDescription
idInteger-compatible or arrayYesSupplier ID. The shared updater also accepts a native array, but callers should use one scalar ID because wrapper events and mention processing are designed for one supplier.
nameStringNoSupplier name. It must be nonempty when creating through the mapped route.
contactName, streetAddress1, streetAddress2, town, county, countryStringNoContact and address values. country maps directly to the tenant table’s three-character country column.
postcodeStringNoMaximum 20 characters.
emailEmail stringNoMaximum 64 characters. A nonblank value must pass PHP email validation.
phoneStringNoMaximum 40 characters.
notesString or notes JSONNoSupplier notes. When the value is a notes array, newly added @username tokens can create Fieldmotion notices.
website, terms, accountNumber, typeStringNoMapped supplier text fields. The mapped website field has no application-level 64-character limit.
taxIdStringNoMaximum 20 characters.
refNumberStringNoMaximum 16 characters.
isActive, onHoldInteger-compatibleNoConverted with intval(). Conventionally use 0 or 1.
metaStringNoComplete raw metadata value. Prefer the named accounting fields when changing their keys.
accountsContact, accountsEmail, additionalEmailStringNoStored inside meta as contact_accounting, email_accounting, and email_extra. accountsEmail validates a nonblank email address.
customValuesJSON-compatible valueNoStored in custom_values. Creation defaults it to an empty JSON object.
createDate, lastEditedSQL datetime stringNoDefault to the server’s current date and time on creation. Normal updates advance lastEdited automatically.
editedUuidStringNoMapped synchronization marker.

Example request

$result = FM_api('Supplier_updateData', [
	'id' => 488104,
	'phone' => '+353 1 555 0199',
	'onHold' => 1,
]);

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"}No id key is present.
{"error":"Invalid email address."}A mapped email field is nonblank but invalid.
{"error":"phone is too long."}A submitted mapped value exceeds its configured maximum; the field name varies.
{"warning":"no updated fields."}The request contains an ID but no recognized mapped field.
{"warning":"No data."}No active supplier has the ID.
{"warning":"No Change."}All recognized values already match the row.

Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.

Behaviour and edge cases

  • Only provided mapped fields are considered. Unknown fields are ignored.
  • Deleted suppliers are excluded and cannot be updated through this route.
  • lastEdited advances automatically when at least one value changes.

Side effects

  • Clears the supplier cache and writes field-level history entries for changed values.
  • Can create notices for usernames newly mentioned in structured notes.
  • Fires the configurable Supplier_edit event after a non-error wrapper result, including warning responses.

See it in Fieldmotion

CRM1

CRM1 does not use this route for its supplier form; it calls Supplier_edit.

CRM2

Open Stock → Suppliers in CRM2 and filter browser developer tools for the exact function name. Open a supplier through a configured Supplier Update layout and save it. The browser calls Layout_setValue, which dispatches internally here.

Related endpoints