ValidationError when creating attendance and adding check-in via API

Hi Team,

I was previously marking employee attendance by calling the relevant APIs, and everything was working smoothly. However, after updating ERPNext, I started encountering the following issue:

Whenever I create an attendance record for an employee and try to add a check-in, I receive this error:

 exception: 'frappe.exceptions.ValidationError: An attendance record is linked to this checkin. Please cancel the attendance before modifying time.',
 3|checkpoint  |       exc_type: 'ValidationError',

It seems like the system is preventing the check-in update due to its link with the attendance record. This behavior wasn’t present before the update.

Could you please advise on the correct workflow post-update or suggest a fix for this issue?

Thank you.

Seems like your Employee Checkin Records has already created a record on Attendance Doctype. You are trying to insert the same record what was there in the device. Since the record exists it’s trying to update it.