When to use this endpoint

Use Customer_setStreet2 for a focused edit to the second address line of a known customer.

Exercise particular care if address history is important: this legacy setter assembles its history input incorrectly.

Authentication and permissions

The request must authenticate with signed API-key fields or a logged-in CRM session. The handler performs no additional page or role-permission check.

The lookup and any write use the authenticated tenant; an ID from another tenant cannot be addressed through this call.

Parameters

ParameterTypeRequiredDescription
idInteger stringYesCustomer to update; it must convert to a positive integer.
valStringYesNew second street-address line, trimmed before comparison and storage. Present blank clears it; no length limit is enforced here.

Example request

$result = FM_api('Customer_setStreet2', [
	'id' => '1088',
	'val' => 'Unit 3',
]);

Example response

{
  "ok": 1
}

An unchanged trimmed value returns {"ok":1,"msg":"no change needed"}.

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"}id is absent or invalid.
{"error":"missing or invalid parameter: val"}val was omitted.
{"error":"customer does not exist"}No matching customer row exists.

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 lookup has no active/deleted filter.
  • The final current-row update correctly changes only street_address2; the query defect affects the history-helper payload.
  • The helper and final update are not transactional.
  • This is a single-record mutation; it provides no list filtering or pagination.

Side effects

  • Address_set can write or merge the incomplete history snapshot, clear linked non-deleted job and invoice customer-detail caches, and mark this customer and descendants as edited.
  • The final write updates street_address2, last_edited, and edited_uuid, invalidates the customer cache, logs the edit, and fires Customer_edit.

See it in Fieldmotion

CRM1

Open the legacy customer edit popup, change Street Address 2, and filter Network requests for Customer_setStreet2.

CRM2

No direct production CRM2 caller was found. CRM2 uses its layout-driven address update.

Related endpoints