When to use this endpoint

Use ScheduleOfRates_delete for the delete action used by CRM1 and CRM2 after the caller has confirmed the row is safe to remove.

Authentication and permissions

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

No additional page or role permission is checked. The CRM screens apply their own client-side Schedule of Rates permissions.

Parameters

ParameterTypeRequiredDescription
idInteger stringYesPositive tenant-local rate ID.

Example request

$result = FM_api('ScheduleOfRates_delete', [
	'id' => '430001',
]);

Example response

"delete from user123_schedule_of_rates where id=430001"

The success value is the executed SQL text as a JSON string, not an ok object. It includes the tenant table prefix.

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 integer-converts below 1.
SQL stringThe positive ID does not exist; absence is not reported.

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

Behaviour and edge cases

  • Exactly one ID is targeted. There is no soft-delete state, filtering, pagination, or transaction around the cleanup queries.
  • When a session parent/tenant ID is available, queued global api_syncs_uploads rows and tenant api_syncs rows for object type sor and this ID are removed.

Side effects

  • Hard-deletes the rate and advances the scheduleOfRates cache marker.
  • Fires the tenant-configurable SOR_edit event with the rate ID. Any configured listeners run synchronously and can add integration-specific side effects.
  • Does not write generic history or the tenant deletes log.

See it in Fieldmotion

CRM1

The Schedule of Rates row action calls this endpoint after a typed confirmation.

CRM2

The Schedule of Rates bulk action first reads archive states, then calls this endpoint sequentially for each selected archived row.

Related endpoints