User clock-ins
Set a clock-out adjustment offset
POST
/a/UserClockin_setClockoutDiff
Replace the stored clock-out adjustment offset for one session.
When to use this endpoint
Use UserClockin_setClockoutDiff for the CRM1 Clock-out detail editor. New integrations should normally use UserClockin_updateData.
Authentication and permissions
The API call needs an authenticated tenant context, but this legacy handler does not itself call the login guard.
It performs no page-permission, user-ownership, or actor check.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | Integer string | Yes | Existing clock-in ID; must integer-convert above zero. |
diff | Integer seconds | No | Replacement signed offset in seconds. Omission and nonnumeric text become 0; negative values are allowed. |
Example request
$result = FM_api('UserClockin_setClockoutDiff', [
'id' => '481',
'diff' => '-900',
]);
Example response
{
"ok": 1
}
Errors and unusual responses
| Response | Condition |
|---|---|
{"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 integer-converts below 1. |
{"error":"clockin does not exist"} | No tenant row has that ID. |
Legacy application errors may be returned with HTTP 200. Check the decoded response for error, not only the HTTP status.
Behaviour and edge cases
- An unchanged value is a successful no-op. Write failures are not surfaced and the endpoint still returns
{"ok":1}. - The CRM1 editor displays this value as minutes but sends seconds. Positive export values are formatted; negative/raw values remain seconds.
Side effects
- Updates only
clockout_diffand invalidates the user-clock-ins cache. It does not modify the time, duration, creation time, flag, or audit history.
See it in Fieldmotion
CRM1
Open a Clock-ins row’s Clock-out detail and change Lateness; the UI multiplies minutes by 60.
CRM2
No direct CRM2 caller was found; CRM2 uses the mapped update route.
Related endpoints
UserClockin_setClockinDiffupdates the start offset.UserClockins_getExportDataexposes formatted and raw offsets.