false, 'ERROR' => 'missing_servicepoint_id', 'MESSAGE' => 'ServicePointID is required']); } $q = queryOne(" SELECT ID, BusinessID, Name, Code, TypeID, IsActive, SortOrder FROM ServicePoints WHERE ID = ? AND BusinessID = ? LIMIT 1 ", [$servicePointId, $businessId]); if (!$q) { apiAbort(['OK' => false, 'ERROR' => 'not_found']); } jsonResponse([ 'OK' => true, 'ERROR' => '', 'SERVICEPOINT' => [ 'ServicePointID' => (int) $q['ID'], 'BusinessID' => (int) $q['BusinessID'], 'Name' => $q['Name'], 'Code' => $q['Code'] ?? '', 'TypeID' => (int) $q['TypeID'], 'IsActive' => (int) $q['IsActive'], 'SortOrder' => (int) $q['SortOrder'], ], ]);