false, 'ERROR' => 'no_business_selected']); } $servicePointId = (int) ($data['ServicePointID'] ?? 0); if ($servicePointId <= 0) { apiAbort(['OK' => false, 'ERROR' => 'missing_servicepoint_id', 'MESSAGE' => 'ServicePointID is required']); } queryTimed("UPDATE ServicePoints SET IsActive = 0 WHERE ID = ? AND BusinessID = ?", [$servicePointId, $bizId]); $qCheck = queryOne("SELECT ID, IsActive FROM ServicePoints WHERE ID = ? AND BusinessID = ? LIMIT 1", [$servicePointId, $bizId]); if (!$qCheck) { apiAbort(['OK' => false, 'ERROR' => 'not_found']); } jsonResponse(['OK' => true, 'ERROR' => '', 'ServicePointID' => $servicePointId]);